cli
cli copied to clipboard
Issue creating package version for packages containing fields for object owned by dependant package
Summary
Yesterday we encountered and error when versioning one of our packages:
{
"status": 1,
"name": "",
"message": "Multiple errors occurred:\n(1) XXXX__c.YYYY__c: An object 'XXXX__c.YYYY__c' of type CustomField was named in package.xml, but was not found in zipped directory\n(2) XXXX__c.ZZZZ__c: An object 'XXXX__c.ZZZZ__c' of type CustomField was named in package.xml, but was not found in zipped directory",
"exitCode": 1,
"context": "PackageVersionCreateCommand",
"stack": "Multiple errors occurred:\n(1) XXXX__c.YYYY__c: An object 'XXXX__c.YYYY__c' of type CustomField was named in package.xml, but was not found in zipped directory\n(2) XXXX__c.ZZZZ__c: An object 'XXXX__c.ZZZZ__c' of type CustomField was named in package.xml, but was not found in zipped directory\n at Function.wrap (/tmp/sfdx/node_modules/@salesforce/core/lib/sfError.js:61:25)\n at PackageVersionCreateCommand.catch (/tmp/sfdx/node_modules/salesforce-alm/dist/ToolbeltCommand.js:255:44)\n at async PackageVersionCreateCommand._run (/tmp/sfdx/node_modules/@salesforce/command/lib/sfdxCommand.js:106:13)\n at async Config.runCommand (/tmp/sfdx/node_modules/@oclif/core/lib/config/config.js:272:25)\n at async run (/tmp/sfdx/node_modules/@oclif/core/lib/main.js:76:5)\nCaused by: Error: Multiple errors occurred:\n(1) XXXX__c.YYYY__c: An object 'XXXX__c.YYYY__c' of type CustomField was named in package.xml, but was not found in zipped directory\n(2) XXXX__c.ZZZZ__c: An object 'XXXX__c.ZZZZ__c' of type CustomField was named in package.xml, but was not found in zipped directory\n at /tmp/sfdx/node_modules/salesforce-alm/dist/lib/package/packageUtils.js:712:27\n at processTicksAndRejections (node:internal/process/task_queues:96:5)",
"warnings": [],
"commandName": "PackageVersionCreateCommand"
}
This seems to include both custom objects and custom settings with the same package dependency structure.
Steps To Reproduce:
- Create a package A containing a new custom object.
- Create package B with a dependency to A. Add a custom field to the object owned by package A
- Version the package
Expected result
A new version of package B should be created containing the new fields.
Actual result
Encountered error as described above ☝️
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.
We are also experiencing this issue
Same here.
Same issue here.
Thanks for posting. Does the same error happen when using the beta command? force:package:beta:version:create? What is the output of sfdx version --verbose?
It worked with the beta command, and here is the output of sfdx version --verbose.
Run sfdx version --verbose
CLI Version:
sfdx-cli/7.171.0
Architecture:
linux-x6[4](https://github.com/navikt/crm-ips/actions/runs/3215132392/jobs/5256014833#step:4:5)
Node Version:
node-v16.17.0
Plugin Version:
@oclif/plugin-autocomplete 1.3.0 (core)
@oclif/plugin-commands 2.2.0 (core)
@oclif/plugin-help [5](https://github.com/navikt/crm-ips/actions/runs/3215132392/jobs/5256014833#step:4:6).1.12 (core)
@oclif/plugin-not-found 2.3.1 (core)
@oclif/plugin-plugins 2.1.0 (core)
@oclif/plugin-update 3.0.0 (core)
@oclif/plugin-version 1.1.2 (core)
@oclif/plugin-warn-if-update-available 2.0.4 (core)
@oclif/plugin-which 2.1.0 (core)
alias 2.1.3 (core)
apex 1.2.0 (core)
auth 2.2.10 (core)
community 2.0.3 (core)
config 1.4.21 (core)
custom-metadata 2.0.1 (core)
data 2.1.4 (core)
generator 2.0.2 (core)
info 2.1.[6](https://github.com/navikt/crm-ips/actions/runs/3215132392/jobs/5256014833#step:4:7) (core)
limits 2.0.3 (core)
org 2.2.[7](https://github.com/navikt/crm-ips/actions/runs/3215132392/jobs/5256014833#step:4:8) (core)
packaging 1.9.2 (core)
schema 2.1.[8](https://github.com/navikt/crm-ips/actions/runs/3215132392/jobs/5256014833#step:4:9) (core)
signups 1.2.4 (core)
source 2.0.16 (core)
telemetry 2.0.2 (core)
templates 55.1.0 (core)
trust 2.0.4 (core)
user 2.1.7 (core)
@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)
salesforce-alm 54.8.1 (core)
OS and Version:
Linux 5.15.0-[10](https://github.com/navikt/crm-ips/actions/runs/3215132392/jobs/5256014833#step:4:11)[20](https://github.com/navikt/crm-ips/actions/runs/3215132392/jobs/5256014833#step:4:21)-azure
Shell:
unknown
Root Path:
/tmp/sfdx
Facing the same issue. Any intention of having this fixed in 7.173.0?
We solved it by changing from
force:package:version:create
to
force:package:beta:version:create
Note when using force:package:beta:version:create, sfdx-project.json needs a versionName (could be static). If no versionName is present, package creation fails.
Also note, using force:package:beta:version:create, there's currently a bug when using branches on packages. If a package on a branch has a higher version number than another branch, finding the x.x.x.LATEST when using force:package:beta:version:create doesn't work because it ignores which branch you're trying to create a package for.
I'm not talking about GitHub branches, but package branches.
We are having the same issue too. Did anyone try with latest version (7.172.0)?
We are having the same issue too. Did anyone try with latest version (7.172.0)?
Yes...
- 7.170.0 - Success
- 7.171.0 - Failure
- 7.172.0 - Failure
- 7.173.0 - Failure
Same issue here
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.
Any updates regarding this? We are now currently running on 7.170 as this is the last version before the error occurred.
We got this issue on Monday, we already tried to update to all versions possible, but still not working. We need an urgent fix
hey @SRS-Dxtreme @dieffrei @arafesthain and any one else, it sounds like using the beta commands doesn't run into this error. We're hoping to verify that the beta commands are working as expected and will be GA'ing them in the near-future
@WillieRuemmele yep you right but it has an other error (#1764) that prevent us to use it, so how should we proceed?
We used the beta command for a few days and encountered another error where the packaged metadata was installed differently in a sandbox and production environment. In our case an Apex class was installed in sandbox with a correctly commented line of code whereas when the package version was promoted and installed in production, the very same code line was not commented out.
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.
We still get issues with latest CLI.
@WillieRuemmele beta package command did not solve our error. We still get the same error that we get in normal package create command.
This issue has been linked to a new work item: W-12034397
Version 7.179.0 is working for me.
Thanks for letting us know @6ithu8u53r.
Fixed with https://github.com/salesforcecli/toolbelt/pull/279