Skip to content
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

force: package: version: create fails to reference Case metadata #1751

Closed
6ithu8u53r opened this issue Oct 13, 2022 · 10 comments
Closed

force: package: version: create fails to reference Case metadata #1751

6ithu8u53r opened this issue Oct 13, 2022 · 10 comments
Labels
investigating We're actively investigating this issue

Comments

@6ithu8u53r
Copy link

6ithu8u53r commented Oct 13, 2022

Summary

Running sfdx force:package:version:create command fails to find references to Case object metadata

Steps To Reproduce:

I've opened a case regarding this advised to add an issue here and link the case to it. The case contains the failing DX Project code.

Expected result

Successful package creation.

Actual result

Package creation fails. Error message appears to indicate that Case metadata (standard or custom) does not exist.

{
  "status": 1,
  "name": "",
   "message": "Multiple errors occurred:\n(1) ClassA: Variable does not exist: CaseFieldA__c\n(2) ClassATest: Field does not exist: RecordtypeId on Case\n(3) ClassATest: Variable does not exist: CaseFieldB__c\n(4) ClassATest: Variable does not exist: CaseFieldC__c\n
   ...
   (490) ClassZTest: Variable does not exist: CaseFieldY__c\n(491) ClassZTest: Variable does not exist: CaseFieldZ__c\n",
   "exitCode": 1,
  "context": "PackageVersionCreateCommand",
  "stack": "Multiple errors occurred:\n(1) ClassA: Variable does not exist: CaseFieldA__c\n(2) ClassATest: Field does not exist: RecordtypeId on Case\n(3) ClassATest: Variable does not exist: CaseFieldB__c\n(4) ClassATest: Variable does not exist: CaseFieldC__c\n
   ...
   (490) ClassZTest: Variable does not exist: CaseFieldY__c\n(491) ClassZTest: Variable does not exist: CaseFieldZ__c\n    at Function.wrap (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/sfError.js:61:25)\n    at PackageVersionCreateCommand.catch (/usr/local/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/dist/ToolbeltCommand.js:255:44)\n    at async PackageVersionCreateCommand._run (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/command/lib/sfdxCommand.js:106:13)\n    at async Config.runCommand (/usr/local/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/config/config.js:272:25)\n    at async run (/usr/local/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/main.js:76:5)\nCaused by: Error: Multiple errors occurred:\n(1) ClassA: Variable does not exist: CaseFieldA__c\n(2) ClassATest: Field does not exist: RecordtypeId on Case\n(3) ClassATest: Variable does not exist: CaseFieldB__c\n(4) ClassATest: Variable does not exist: CaseFieldC__c\n
   ...
   (490) ClassZTest: Variable does not exist: CaseFieldY__c\n(491) ClassZTest: Variable does not exist: CaseFieldZ__c\n    at /usr/local/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/dist/lib/package/packageUtils.js:712:27\n    
at processTicksAndRejections (node:internal/process/task_queues:96:5)",
  "warnings": [],
  "commandName": "PackageVersionCreateCommand"
}

System Information

  • Which shell/terminal are you using? bash
{
  "cliVersion": "sfdx-cli/7.172.0",
  "architecture": "linux-x64",
  "nodeVersion": "node-v16.18.0",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 1.3.1 (core)",
    "@oclif/plugin-commands 2.2.0 (core)",
    "@oclif/plugin-help 5.1.14 (core)",
    "@oclif/plugin-not-found 2.3.3 (core)",
    "@oclif/plugin-plugins 2.1.1 (core)",
    "@oclif/plugin-update 3.0.2 (core)",
    "@oclif/plugin-version 1.1.2 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.6 (core)",
    "@oclif/plugin-which 2.1.0 (core)",
    "alias 2.1.5 (core)",
    "apex 1.2.0 (core)",
    "auth 2.2.13 (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.5 (core)",
    "info 2.1.9 (core)",
    "limits 2.0.5 (core)",
    "org 2.2.7 (core)",
    "packaging 1.9.4 (core)",
    "schema 2.1.10 (core)",
    "signups 1.2.7 (core)",
    "source 2.0.17 (core)",
    "telemetry 2.0.2 (core)",
    "templates 55.1.0 (core)",
    "trust 2.0.4 (core)",
    "user 2.1.10 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
    "salesforce-alm 54.8.1 (core)"
  ],
  "osVersion": "Linux 5.15.0-1021-azure",
  "shell": "unknown",
  "rootPath": "/usr/local/lib/node_modules/sfdx-cli"
}

Additional information

Using same package files to create a package version...
Works on cli version 7.170.0 on linux or win32-x64
Works on cli version 7.171.0 on win32-x64 only

@6ithu8u53r 6ithu8u53r added the investigating We're actively investigating this issue label Oct 13, 2022
@github-actions
Copy link

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.

@6ithu8u53r 6ithu8u53r changed the title force: package: beta: version: create fails to reference Case metadata on linux force: package: version: create fails to reference Case metadata on linux Oct 19, 2022
@WillieRuemmele
Copy link
Member

hi @6ithu8u53r sorry for the delayed response, have you tried using the force:package:beta commands? It might be fixed in there

@6ithu8u53r
Copy link
Author

hi @6ithu8u53r sorry for the delayed response, have you tried using the force:package:beta commands? It might be fixed in there

Yes, but it doesn't work due to issue #1750. We are also running the commands in an automated pipeline and it's easier for us to use 7.1.70.0 until it's fixed so we don't need to make modifications to our codebase.

@WillieRuemmele
Copy link
Member

yes, I'll close this to keep #1750 as the original

@6ithu8u53r
Copy link
Author

yes, I'll close this to keep #1750 as the original

1750 is a different issue with the beta version that prevents me from answering the question if this error also occurs the beta version. Please keep this issue open.

@WillieRuemmele
Copy link
Member

Hi @6ithu8u53r what is the exact command you're executing?

@6ithu8u53r
Copy link
Author

Hi @6ithu8u53r what is the exact command you're executing?

I did obfuscate a few values, but this the the command with all the switches that is failing.
sfdx force:package:version:create --json -c -v [email protected] -x -b refs/pull/28/merge -d source/sfdx/force-app -f ./config/project-scratch-def.json -t example/sfdx-project__20221109.1 -w 320

@6ithu8u53r 6ithu8u53r changed the title force: package: version: create fails to reference Case metadata on linux force: package: version: create fails to reference Case metadata Nov 15, 2022
@6ithu8u53r
Copy link
Author

When I was changing cli versions I noticed this warning...

 »   Warning: You still have the deprecated salesforcedx plugin installed in Salesforce CLI. If you continue using this plugin, you'll be running old and out-of-date versions of
 »   sfdx commands.
 »       Uninstall the plugin with this command: 'sfdx plugins:uninstall salesforcedx'.
 »       See https://github.com/forcedotcom/cli/blob/main/releasenotes/sfdx/README.md#71063-june-17-2021 for more information about this change.

After uninstalling the plugin, the package version create process now fails on my Windows based system. I've removed references to linux in the issue title and description.

@6ithu8u53r
Copy link
Author

This appears to be fixed in the latest (7.179.0) release.

@cromwellryan
Copy link
Member

Thanks for following up here @6ithu8u53r! Glad you're unblocked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

3 participants