cli icon indicating copy to clipboard operation
cli copied to clipboard

Issue creating package version for packages containing fields for object owned by dependant package

Open SRS-Dxtreme opened this issue 3 years ago • 13 comments

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:

  1. Create a package A containing a new custom object.
  2. Create package B with a dependency to A. Add a custom field to the object owned by package A
  3. 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 ☝️

SRS-Dxtreme avatar Oct 07 '22 08:10 SRS-Dxtreme

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.

github-actions[bot] avatar Oct 07 '22 08:10 github-actions[bot]

We are also experiencing this issue

warbio avatar Oct 07 '22 10:10 warbio

Same here.

chfosli avatar Oct 07 '22 11:10 chfosli

Same issue here.

osjurso avatar Oct 07 '22 11:10 osjurso

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?

shetzel avatar Oct 07 '22 15:10 shetzel

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

chfosli avatar Oct 09 '22 18:10 chfosli

Facing the same issue. Any intention of having this fixed in 7.173.0?

ganesh2109-cloud avatar Oct 11 '22 09:10 ganesh2109-cloud

We solved it by changing from force:package:version:create to force:package:beta:version:create

warbio avatar Oct 11 '22 09:10 warbio

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.

johnforeland avatar Oct 13 '22 08:10 johnforeland

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.

johnforeland avatar Oct 13 '22 08:10 johnforeland

We are having the same issue too. Did anyone try with latest version (7.172.0)?

pranitjain1 avatar Oct 14 '22 08:10 pranitjain1

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

6ithu8u53r avatar Oct 14 '22 16:10 6ithu8u53r

Same issue here

arafesthain avatar Oct 17 '22 13:10 arafesthain

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

github-actions[bot] avatar Oct 25 '22 02:10 github-actions[bot]

Any updates regarding this? We are now currently running on 7.170 as this is the last version before the error occurred.

SRS-Dxtreme avatar Oct 25 '22 07:10 SRS-Dxtreme

We got this issue on Monday, we already tried to update to all versions possible, but still not working. We need an urgent fix

dieffrei avatar Oct 25 '22 08:10 dieffrei

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 avatar Oct 25 '22 14:10 WillieRuemmele

@WillieRuemmele yep you right but it has an other error (#1764) that prevent us to use it, so how should we proceed?

arafesthain avatar Oct 25 '22 15:10 arafesthain

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.

SRS-Dxtreme avatar Oct 25 '22 19:10 SRS-Dxtreme

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

github-actions[bot] avatar Nov 03 '22 02:11 github-actions[bot]

We still get issues with latest CLI.

pranitjain1 avatar Nov 03 '22 11:11 pranitjain1

@WillieRuemmele beta package command did not solve our error. We still get the same error that we get in normal package create command.

pranitjain1 avatar Nov 08 '22 14:11 pranitjain1

This issue has been linked to a new work item: W-12034397

git2gus[bot] avatar Nov 09 '22 12:11 git2gus[bot]

Version 7.179.0 is working for me.

6ithu8u53r avatar Nov 30 '22 16:11 6ithu8u53r

Thanks for letting us know @6ithu8u53r.

peternhale avatar Nov 30 '22 16:11 peternhale

Fixed with https://github.com/salesforcecli/toolbelt/pull/279

RodEsp avatar Dec 01 '22 20:12 RodEsp