Upgraded my sfdx cli to the new 7.65.2 version and my sfdx force:source:push fails with an error having to do with "Duplicate name
This is proven in my gitlab pipeline log.
Repository to reproduce: dreamhouse-lwc
Successful push to a scratch org.
Push fails
_Feel free to attach a screenshot_.
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.65.2-0f0403b8cc linux-x64 node-v10.21.0
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
salesforcedx 48.22.1 (core)
โโ @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)
โโ custom-metadata 1.0.4 (core)
โโ salesforcedx-templates 48.18.0 (core)
โโ salesforce-alm 48.23.0 (core)
sfdx-cli 7.65.2 (core)
OS and version:
docker image sha256:a5c07a6f3bb6342e4d3ca4c7b7e13016c6949dd64f9a93edb618e293d8ad9c4a
7.65.2 Log - Errored.log
7.63.0 - Success.txt
Getting this on in our CI system as well for brand new pushes on commits that worked a day ago. Must be server side:
sfdx-cli/7.65.2-0f0403b8cc linux-x64 node-v10.21.0
This is stopping us cold for development right now
Getting this on in our CI system as well for brand new pushes on commits that worked a day ago. Must be server side:
sfdx-cli/7.65.2-0f0403b8cc linux-x64 node-v10.21.0This is stopping us cold for development right now
Downgrading to 7.63.0 worked like a charm in our pipeline - If you have access to the CI script you can likely just have it download the older version when the docker image is initialized (assuming you're using Docker).
We're seeing this issue as well.
I am facing this issue as well.
We were not able to reproduce this with dreamhouse-lwc with changing a class. Does anyone have a repo?
I don't have a repo I can share but I can add a little context around what is happening for me:
force:source:deploy after doing a push. The deploy is pushing up some unpackaged dependencies that are not part of what we are developing.Do you all have the same path specified in multiple packages in sfdx-project.json?
@amphro yes, we do
No but we do actually have multiple sfdx-project.json (due to limitations now, theoretically fixed in this latest version) files and packages and the push and deploy are being done from different sfdx-project.json directories
actually, yea, our two sfdx-project.json files both have a "force-app" path in them
@yippie how do you have two sfdx-project.json files? Can you give me an example of the folder structure you have and where you run the commands? Do each sfdx-project.json only have the one "force-app" entry in the packageDirectorie property?
It is a little complicated because we were working around issues with not being able to declare objects in one package folder and add fields to it in another in another but I will try. I believe the latest update is supposed to allow us to do this now but we don't currently have time to re-work ourr dev-ops to take advantage of it.
Our folder structure:
sfdx-project.json (packageDir = dummy)
packages/project1/sfdx-project.json (packageDir = force-app)
packages/project1/force-app
packages/project2/sfdx-project.json(packageDir = force-app)
packages/project2/force-app
packages/unpackaged
during org setup we run the following script:
cd packages/project1 && sfdx force:source:push
cd ../project2 && sfdx force:source:push
cd ../.. && sfdx force:source:deploy packages/unpackaged <- this is where we get the error
I was able to mimic that flow and reproduce it. I think I have a fix and will work on getting it out hopefully by tomorrow morning.
Do you all have the same path specified in multiple packages in
sfdx-project.json?
yes.
@amphro we're still seeing this issue after updating to 48.22.8
@yippie @ashaale1 are you still seeing the issue?
I had removed the multiple paths mentioned in the sfdx-project.json. It worked when I kept only one entry.
From: Thomas Dvornik notifications@github.com
Sent: Thursday, July 16, 2020 5:41 AM
To: forcedotcom/cli cli@noreply.github.com
Cc: Alex, Asha asha.alex@intel.com; Mention mention@noreply.github.com
Subject: Re: [forcedotcom/cli] Deploy fails with "Duplicate name
@yippiehttps://github.com/yippie @ashaale1https://github.com/ashaale1 are you still seeing the issue?
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/forcedotcom/cli/issues/468#issuecomment-659079462, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMMLRTRNLRNXEU54A2CZ4FTR3ZASRANCNFSM4OWHFITA.
I am still getting the error with:
sfdx-cli/7.65.6-23e8b7f47e darwin-x64 node-v12.13.0
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.0.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.7.10 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.12.0 (core)
generator 1.1.3 (core)
salesforcedx 48.22.11
โโ salesforce-alm 48.24.3
โโ @salesforce/sfdx-plugin-lwc-test 0.1.7
โโ salesforcedx-templates 48.18.0
โโ custom-metadata 1.0.4
sfdx-cli 7.65.6 (core)
texei-sfdx-plugin 1.2.1 (1.2.1)
@amphro we're seeing a similar error with salesforcedx 49.2.3 (core).
TYPE FILE NAME PROBLEM
โโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Error sdx_sourceDeploy_1595279537202/objects/Account.object Account.FLD_Email__c Duplicate name 'Account.FLD_Email__c' specified
Error sdx_sourceDeploy_1595279537202/objects/Account.object Account.FLD_Email__c Duplicate name 'Account.FLD_Email__c' specified
Error sdx_sourceDeploy_1595279537202/objects/Account.object Account.FLD_Email__c Duplicate name 'Account.FLD_Email__c' specified
Error sdx_sourceDeploy_1595279537202/objects/Account.object Account.FLD_Email__c Duplicate name 'Account.FLD_Email__c' specified
However the structure is different:
project/a/sfdx-project.json
references paths:
../../client-app/subpackage1
../../client-app/subpackage2
../../client-app/subpackage3
And inspecting the Account.object file it does have the field definition repeated in the xml even though the field only exists once:
../../client-app/subpackage2/objects/Account/fields/FLD_Email__c.field-meta.xml
sfdx-cli/7.66.2-4f159a1d07 darwin-x64 node-v12.13.0
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.0.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.7.10 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.12.0 (core)
generator 1.1.3 (core)
salesforcedx 49.2.3 (core)
โโ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
โโ custom-metadata 1.0.7 (core)
โโ salesforce-alm 49.3.0 (core)
โโ salesforcedx-templates 48.32.0 (core)
sfdx-cli 7.66.2 (core)
this is still happening for me too still with the v49 cli
started to show up again recently for me as well.
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.0.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.7.10 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.12.0 (core)
generator 1.1.3 (core)
salesforcedx 49.4.1 (core)
@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
salesforcedx-templates 48.32.0 (core)
custom-metadata 1.0.7 (core)
salesforce-alm 49.4.0 (core)
sfdx-cli 7.68.6 (core)
siri 1.0.1
I am trying to convert my codebase into a single, multi-package project per https://github.com/forcedotcom/cli/issues/379 and I am getting the duplicate name error to a much bigger degree.
sfdx-cli/7.68.6-d37008df83 darwin-x64 node-v12.18.3
@mavens/mavens-cli 1.0.0-6 (link) /Users/kaiamundsen/.local/share/sfdx/node_modules/@mavens/mavens-cli
@mavens/mic-cli-plugin 9.0.0-0 (link) /Users/kaiamundsen/workspace/MedInfoCloud-CLI-Plugin
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.0.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.7.10 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.12.0 (core)
generator 1.1.3 (core)
salesforcedx 49.4.1
โโ salesforce-alm 49.4.0
โโ salesforcedx-templates 48.32.0
โโ @salesforce/sfdx-plugin-lwc-test 0.1.7
โโ custom-metadata 1.0.8
sfdx-cli 7.68.6 (core)
texei-sfdx-plugin 1.2.1 (1.2.1)
I might have a bit of a breakthrough here. It seems that main/default is REQUIRED.
I had the following package directories defined in my sfdx-project file:
packages/core/force-app
packages/defaults/force-app
These had all metadata in the root of them with no main/default in existance
removing force-app from the sfdx-project file and moving the actual files into
packages/core/main/default
packages/defaults/main/default
completely fixed the issue.
I can confirm this bug exists and resolves when I downgrade to an older version of SFDX
# Downgrading package
npm install [email protected] --global --force
In order to speed things up -- this is a snippet to delete :
sudo rm -rf /usr/local/sfdx
sudo rm -rf /usr/local/lib/sfdx
sudo rm -rf /usr/local/bin/sfdx
sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx
sudo rm -rf ~/Library/Caches/sfdx
Can confirm we have seen this issue return as well.
Salesforce: I understand you are trying to push high value features to us as fast as you can, but the last few releases have seriously & significantly hurt our productivity and ability to work. I've personally spent multiple days troubleshooting and working around broken continuous deployment jobs and broken development environments for engineers on my team. This has a negative impact on our productivity, and therefore our bottom line. It also greatly frustrates my team.
Suggestion: Introduce a stable branch that only gets significant bug fixes, and have developers "opt-in" to a faster paced release cycle, and work with the tooling ecosystem to ensure they will support the stable branch. E.g. a driver for trying to keep sfdx up to date on our team is to ensure compatibility with Illuminated Cloud - a recent series of SFDX cli upgrades broke Illuminated Cloud too and required constant updating of SFDX to be able to work at all.
@dennismphil solution worked for me
Im getting a similar error just doing a sfdx force:source:push --forceoverwrite, our CI process did use deploy to push un-package meta data, prior to the push, but it was not in the same path. I have tried multiple times to push and get the same error. Tried reduceing the packageDirectories down to just the single path, same error. I have also rebuilt the sourcePathInfos.json, and manually checked and there are only single entries for the files listed with an error. I would have expected to find duplicate file entries or overlapping packageDirectories, that is not the case.
This is with the latest version. sfdx-cli/7.70.1-3d8a6229fc darwin-x64 node-v12.18.3
TYPE PROJECT PATH PROBLEM
โโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Error Duplicate name 'Case.FLD_SAP_Return_Order_Number__c' specified
Error Duplicate name 'Opportunity.FLD_SAP_Order_Number__c' specified
Error Duplicate name 'Opportunity.FLD_SAP_CreditMemo_Number__c' specified
Error Duplicate name 'Opportunity.FLD_SAP_Contract_Number__c' specified
Error Duplicate name 'OpportunityLineItem.FLD_SAP_Item_Number__c' specified
Error Duplicate name 'Opportunity.FLD_SAP_ReturnOrder_Number__c' specified
Error Duplicate name 'Opportunity.FLD_SAP_Quote_Number__c' specified
Error Duplicate name 'Opportunity.FLD_SAP_Inquiry_Number__c' specified
Error Duplicate name 'Opportunity.FLD_SAP_DebitMemo_Number__c' specified
ERROR running force:source:push: Push failed.
Im getting a similar error just doing a
sfdx force:source:push --forceoverwrite, our CI process did use deploy to push un-package meta data, prior to the push, but it was not in the same path. I have tried multiple times to push and get the same error. Tried reduceing the packageDirectories down to just the single path, same error. I have also rebuilt the sourcePathInfos.json, and manually checked and there are only single entries for the files listed with an error. I would have expected to find duplicate file entries or overlapping packageDirectories, that is not the case.This is with the latest version.
sfdx-cli/7.70.1-3d8a6229fc darwin-x64 node-v12.18.3TYPE PROJECT PATH PROBLEM โโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Error Duplicate name 'Case.FLD_SAP_Return_Order_Number__c' specified Error Duplicate name 'Opportunity.FLD_SAP_Order_Number__c' specified Error Duplicate name 'Opportunity.FLD_SAP_CreditMemo_Number__c' specified Error Duplicate name 'Opportunity.FLD_SAP_Contract_Number__c' specified Error Duplicate name 'OpportunityLineItem.FLD_SAP_Item_Number__c' specified Error Duplicate name 'Opportunity.FLD_SAP_ReturnOrder_Number__c' specified Error Duplicate name 'Opportunity.FLD_SAP_Quote_Number__c' specified Error Duplicate name 'Opportunity.FLD_SAP_Inquiry_Number__c' specified Error Duplicate name 'Opportunity.FLD_SAP_DebitMemo_Number__c' specified ERROR running force:source:push: Push failed.
@mhail you have to uninstall the existing version 7.70.1 and then install salesforce cli 7.65.4 from your CI machine and wait for the bug to be fixed in later versions.
I agree with many people here, so many weird issues lately. We need more stability between releases. Many deployment and many companies rely on salesforce cli now.
599740167179/objects/AccountContactRelation.object AccountContactRelation.Account_Name__c Duplicate name 'AccountContactRelation.Account_Name__c' specified
Error sdx_sourceDeploy_1599740167179/objects/AccountContactRelation.object AccountContactRelation.Contact_Name__c Duplicate name 'AccountContactRelation.Contact_Name__c' specified
Error sdx_sourceDeploy_1599740167179/objects/AccountContactRelation.object AccountContactRelation.Reference_ID__c Duplicate name 'AccountContactRelation.Reference_ID__c' specified
Error sdx_sourceDeploy_1599740167179/objects/AccountContactRelation.object AccountContactRelation.Roles Duplicate name 'AccountContactRelation.Roles' specified
Error sdx_sourceDeploy_1599740167179/objects/AccountContactRelation.object AccountContactRelation.Updated__c Duplicate name 'AccountContactRelation.Updated__c' specified
Found out the problem is actually with source:pull from scratch org, it seems sfdx is adding the fields into the .object-meta.xml which end up being duplicates as they are also in the fields folders.

Just looking at our commit history, the fix (or what we thought was the fix) was already released. Is everyone still seeing this in cli v7.74.1 - salesforcedx v49.11.0?
Hi Everyone,
We started seeing the similar issue in my application while setting up the DevOps CICD pipeline with the GitLab CICD tool.
it was working fine 2 weeks before with the version sfdx-cli:7.68.6 and surprising with the latest sfdx-cli: 7.74.1, started seeing error like not able to convert the package for the custom object. Could anyone pls here as we are not able to get the right url for stable verion of the code which was working earlier. Appreciate your support.
We are trying to convert the package using package.xml instead of force-app, but with the latest version of SFDX cli, the package.xml is converting properly for the custom object as it throws duplicate fields or "Dependent class is invalid and needs recompilation" even though object lies in the folders but not in converted package.xml file.
Here is my sfdx cli installation script:
mkdir sfdx
CLIURL=https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
wget -qO- $CLIURL | tar xJ -C sfdx --strip-components 1
"./sfdx/install"
export PATH=./sfdx/$(pwd):$PATH
sfdx update
sfdx --version
sfdx plugins --core
Output of SFDX Cli installation
$ install_salesforce_cli
sfdx installed to /usr/local/bin/sfdx
sfdx-cli/7.74.1-32db2396ed linux-x64 node-v12.18.3
sfdx-cli: Updating CLI...
sfdx-cli: Updating CLI from 7.74.1-32db2396ed to 7.75.0-5521f40d11... done
sfdx-cli: Updating CLI... done
sfdx-cli/7.75.0-5521f40d11 linux-x64 node-v12.18.3
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.0 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
analytics 1.12.1 (core)
config 1.1.8 (core)
generator 1.1.3 (core)
salesforcedx 49.13.0 (core)
โโ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
โโ custom-metadata 1.0.10 (core)
โโ salesforce-alm 49.12.1 (core)
โโ templates 49.9.1 (core)
โโ apex 0.1.0 (core)
sfdx-cli 7.75.0 (core)
sfdx cli installation done
No change in the sfdx-project.json file
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "49.0"
Thanks a lot for your support.
Hi Everyone,
We started seeing the similar issue in my application while setting up the DevOps CICD pipeline with the GitLab CICD tool.
it was working fine 2 weeks before with the version sfdx-cli:7.68.6 and surprising with the latest sfdx-cli: 7.74.1, started seeing error like not able to convert the package for the custom object. Could anyone pls here as we are not able to get the right url for stable verion of the code which was working earlier. Appreciate your support.We are trying to convert the package using package.xml instead of force-app, but with the latest version of SFDX cli, the package.xml is converting properly for the custom object as it throws duplicate fields or "Dependent class is invalid and needs recompilation" even though object lies in the folders but not in converted package.xml file.
Here is my sfdx cli installation script:
mkdir sfdx
CLIURL=https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
wget -qO- $CLIURL | tar xJ -C sfdx --strip-components 1
"./sfdx/install"
export PATH=./sfdx/$(pwd):$PATH
sfdx update
sfdx --version
sfdx plugins --core
echo "sfdx cli installation done"
Output of SFDX Cli installation
$ install_salesforce_cli
sfdx installed to /usr/local/bin/sfdx
sfdx-cli/7.74.1-32db2396ed linux-x64 node-v12.18.3
sfdx-cli: Updating CLI...
sfdx-cli: Updating CLI from 7.74.1-32db2396ed to 7.75.0-5521f40d11... done
sfdx-cli: Updating CLI... done
sfdx-cli/7.75.0-5521f40d11 linux-x64 node-v12.18.3
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.0 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
analytics 1.12.1 (core)
config 1.1.8 (core)
generator 1.1.3 (core)
salesforcedx 49.13.0 (core)
โโ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
โโ custom-metadata 1.0.10 (core)
โโ salesforce-alm 49.12.1 (core)
โโ templates 49.9.1 (core)
โโ apex 0.1.0 (core)
sfdx-cli 7.75.0 (core)
sfdx cli installation doneNo change in the sfdx-project.json file
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "49.0"Thanks a lot for your support.
Here's a URL to use in your script to get the specific version of the CLI you want:
SALESFORCE_CLI_URL='https://developer.salesforce.com/media/salesforce-cli/sfdx-cli/channels/stable/sfdx-cli-v7.63.0-c897e8bb1a-linux-x64.tar.xz'
Just change the version to a working version. 7.63.0 seems to work for me, but ymmv.
Most helpful comment
I can confirm this bug exists and resolves when I downgrade to an older version of SFDX