-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sfdx package:version:create fails, tests failing due to a missing profile which should be there #2218
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Hi @mwannamaker41 - could you, and your colleague whose command is working run the command with that'll run the command with logging enabled and produce 3 files, could you attach those files for the two different versions? |
1686837663910-command-debug.log Here are my files from the failed package creation. Had to rename .json to .json.txt in order to upload |
1686840869047-diagnosis.json.txt Here are the files from my colleague with successful package creation. Had to rename .json to .json.txt in order to upload |
Thanks for providing those @mwannamaker41 - could you try having the working cli install the latest version of the packaging plugin... this will help us determine if it's a windows vs mac bug, or a bug in newer versions of packaging...
once you rerun the failing command, you can |
@WillieRuemmele Do you mean you want my colleague where it works to install this plugin? Or me where it doesn't work to install the plugin? |
I meant where to works, install the newer version of the plugin. I met with some members of the packaging team that actually own these commands. They brought up this PR forcedotcom/packaging#265 that changed the way unpackaged profiles are bundled. It seems like before they were incorrectly being added to the package. They suggested that you might need to
hopefully that PR will shed some insight into why things changed. It was also roughly released around |
Thing is my profiles are in package directory. Therefore that PR does not apply from what I can see. My colleague just installed the package plugin and ran the package version create command and now it fails for him and in the md-files/profiles/ folder there is no profile metadata. So he is seeing the same behaviour as me with this new plugin. But like I say the profiles are in the package directory. |
Here are files from doctor command after installing new package plugin: 1686856958052-diagnosis.json.txt |
Thanks for verifying that - your coworker can uninstall the new version, and you can install the old version by specifying the version like I've let the packaging team know |
When they say unpackaged metadata directories does it mean this in the project json file?
|
If this is what the PR is talking about then we may have other issues. We have other projects that use that to push profiles to the packaging org for testing purposes. The profiles are actually from another package/project, but since profiles are not installed with the dependency, we have to put a copy of them in this unpackagedMetadata folder so that our tests will run. As long as these profiles in the unpackagedMetadata folder is still "pushed" to the packaging org to run tests, then all will be okay. |
yes, I believe that's what they mean by "unpackaged metadata" |
We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on. |
Facing the same issue in our github action. Any workaround on this? |
This is also effecting us. We were forced to use older sfdx version - 7.196 for packaging for quite some time now. Is this on the roadmap to be fixed? Links for versions that this issue isn't present aren't even available on the older versions links lists. |
this is fixed as of yesterday. for We don't plan to release further updates to sfdx. #2132 If you want to keep using |
Summary
Trying to build a package version via the following command
sfdx package:version:create -p 0Ho.... -r -c -x -w 100
Fails due to tests failing.
This project has been built many times, the tests are not new and have existed in previous packages created.
Steps To Reproduce
Have a project with a profile in the profiles/ directory.
Build a package version using the command:
sfdx package:version:create -p 0Ho.... -r -c -x -w 100
Expected result
New package version is created
Actual result
All tests are failing:
Error (1): Multiple errors occurred:
(1) Apex Test Failure: Class.PTT_TestHelper.createTestUsers: line 291, column 1
Class.PTT_TestHelper.createResource: line 605, column 1
Class.PTT_TestHelper.createResourceDirectorate: line 526, column 1
Class.PTT_ResourceDirectorateTriggerTest.should_change_enddate_of_remaining_records_on_delete: line 321, column 1 System.NullPointerException: Attempt to de-reference a null object
All tests fail at same place Class.PTT_TestHelper.createTestUsers: line 291, column 1
Here we create a test user and assign them a profile 'PTT_ProjectUser' profile which is in the profiles/ folder of our package directory. I believe that this profile can't be queried in the test because it doesn't exist.
In the temp directory under the md-files/ directory I see a profiles/ directory but it is empty. I would expect that my PTT_ProjectUser.profile-meta.xml should be in that directory.
System Information
Using zsh but running the command through a bash script file.
On a mac
My SFDX output
Additional information
I had a colleague build a package version and they were successful. They checked and the profile is being copied into the profiles/ folder in the md-files/ directory. They are on a windows machine and here is their sfdx information:
Possibly is due to the difference in our sfdx versions.
The text was updated successfully, but these errors were encountered: