Closed aidan-harding closed 2 years ago
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.
This issue has been linked to a new work item: W-11410766
Hello, @aidan-harding I opened a new bug W-11410766 where you can privately upload a sample org for us to repro, thanks !
based on the gack, the metadata API is complaining that received two objects that are exactly the same (==)
which is why sequential deploy fixed it.
So I see potentially 2 bugs here
Hi @maggiben, thanks for that!
When I open the link to the bug, it invites me to sign in to Okta. I guess I sign in with my Salesforce credentials from our org? I tried that but it won't accept it.
So, I've put a zip file up on our Google Drive. If you use this link, it'll ask me to approve and I'll grant it https://drive.google.com/file/d/1-X_LFVHkhM0WndyQjqPq_ygYw_jekj__/view?usp=sharing
You'll need to install the package dependencies before pushing. Those are just packages listed in the sfdx-project.json, and I think that anyone will have the required access to do that. They don't have installation keys.
@mshanemc That makes sense. The project is an unlocked package where some data is in an unpackaged directory. The unpackaged elements are things that are separate files in sfdx format, but I think they are the same files in old-school XML. I think it all becomes XML for the deployment, so maybe that's the issue. It's a legit use-case because I need stuff like page layouts to test my package in the scratch org. But I don't want the package to control/overwrite what the subscriber org does with layouts.
@aidan-harding thanks for the metadata!
The issue is definitely the duplicate for those 2 layouts, which is why sequential
helped. To check my understanding, you want to have 1 layout that gets packaged, and then another layout (same obj, same name) that is just for testing in your scratch org, presumably more cases than the "basic" on that gets packaged?
I think that's a good use case for sequential (which is what legacy push was doing) OR a follow-on deploy of just that folder (ex: sfdx force:source:deploy -p unpackaged --tracksource
)
Alternatively, you could have it be a standalone page layout (same obj, different page layout name) so the conflict isn't an issue. You could probably even update Profile.PageLayoutAssignments to default your scratch to the 'alternative' layouts.
I'm gonna close the issue because other than the gack, it's working like it's supposed to (not allowing duplicate metadata in the same deployment)
Ha... thanks for looking into it @mshanemc. The layout is not supposed to be in the package at all. It must have been pulled down by accident 😳
I'm happy to take your opinion on closing this issue, but I would say that this is exactly the sort of behaviour from the CLI that makes it hard for people to adopt. Confusing or missing error messages can end up with the user having to spend a lot of time finding the source of their own mistake (and blaming the tool along the way!).
100% with you that gacks are uncool and that a better error message from the server would have been nice--the CLI could then tell you what component(s) caused the issue.
the CLI (and SDR library) could maybe produce warnings about duplicate components (we expect customObjects to be duplicated across packages sometimes, but most types shouldn't), which would have helped even with the gack.
Summary
I have an unlocked package repo that I haven't built for a while. When setting up my scratch org for work recently, I ran
sfdx force:source:push
. The response from the CLI was:However, when I go to the scratch org, the deployment status says that it failed with
UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 2080389041-229584 (208639346)
. And nothing is deployed.When I run the legacy command, it succeeds:
I was able to get the non-legacy command to work by adding
"pushPackageDirectoriesSequentially": true
to mysfdx-project.json
file.Steps To Reproduce:
The metadata causing this issue is in a private repository. If the gack code and other details are not enough, then I may be able to share the code with individuals at Salesforce but I cannot post it here. If that's not workable, I could perhaps try to trim it down to a minimal reproduction, but I don't have much time to spare on that since I have viable workarounds for the customer (use legacy mode or the extra property in sfdx-project.json).
Expected result
Source should have deployed, as per the legacy push. Or, at least, provided an error message in the CLI.
Actual result
No error message, no code deployed.
System Information
zsh on Mac.