-
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 force:source:push failing with duplicate objects #1726
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. |
Ah... think I might be onto something. @deb761 Do you think you could attempt to push to a new scratch again but beforehand change the name of the RecordType to |
OK, so I'm a plum. |
I'm not able to repro this because of the namespace issues (can't create a scratch org with your namespace, looks like you've got code that has that namespace in it). We've also deprecated the |
Hey @mshanemc I know this was closed but I'm also in the same situation. For reference we have a bunch of custom labels that we had already deployed in an organization (not a scratch org) via the Now we moved the And when we try to redeploy, using the same two step process of source convert followed by the project deploy start, we get a "duplicate name" on all of the labels contained in the labels-meta.xml file. When I try the exact same steps in a scratch org however, it doesn't create the issue, even after moving the file, the labels deploy with a mark as "Unchanged". I am thinking that's because a scratch org might have better file tracking than the "regular" organization? If you have a suggestion, I would take it. Otherwise I'm still experimenting and will try to update if I find a solution. |
@erocheleau my theory is that tracking is handling what you really need (moving a label is the equivalent of creating one and deleting another). If that's true, then you should be able to deploy that moved label using |
I would like to try that yes I had that in my list of ideas, unfortunately these labels are managed in a package in the org I'm trying to deploy to. I think? it wouldn't let me do that then because they are managed no? AKA you can't delete a managed label it looks like so unless the destructive-changes pre follow different rules it wouldn't work? What I'm reading between the lines of your answer is that essentially moving the labels is not something we CAN do? Since it's equivalent essentially as delete + create? Is there no way of saying that these are the same labels as before, just overwrite the existing ones instead of trying to create new ones? Update: I have tried the same process with a scratch org that I created with the Our folder structure looked like this before:
And now it looks like this:
|
yeah, that sounds right. I'm guessing your sbox has the managed package in there, but the scratch org doesn't? So the scratch org thinks you're managing stuff that belongs to you and the sbox knows you're not. [I'd advise against managing source you don't own] |
Not sure I understand, this is all code we manage, we've just split it in sub-folders to make more sense. I confirmed that it's not the "location" of the file that is causing issues afaik, Since we run What I've found so far is that the result of the
So all the specific labels are in the first "CustomLabel" type, even if they are all in the same CustomLabels.labels file. I believe this is what is creating the duplicate error. But I still can't figure out why this gets duplicated like this. I just run the command, and I don't modify anything in the resulting package.xml file. So is that a bug in the code that generates the package.xml when you run the |
Oh wow, I figured out what the problem was, we DID have duplicate labels in the code generated on our CI, and when running I know it's our fault, but it's also the only metadata type we had where it did that. All the other LWCs, Apex classes, etc. etc. all didn't get duplicated even if we had multiple copies of the same files in our source code when running the |
Summary
I've tested this with multiple versions of the cli. Package has multiple projects, but no repeats of the metadata within them.
currently: sfdx-cli/7.169.1 darwin-x64 node-v16.15.0
Output:
I may have had a hidden file allowing me to push successfully, because when I cleaned out my directory,
git clean -ffdx
, I was able to reproduce what I have been seeing in github actions and my colleague has been seeing on windows.Steps To Reproduce:
Repository to reproduce: atlas-dogs
NOTE: If your issue is not reproducable by dreamhouse-lwc, i.e. requires specific metadata or files, we require a link to a simple Salesforce project repository with a script to setup a scratch org that reproduces your problem.
sfdx force:source:push
to the scratch org.Expected result
Source should have deployed to the scratch org.
Actual result
Describe what actually happened.
System Information
The text was updated successfully, but these errors were encountered: