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

InvalidPackageIdError: The id [My] is invalid. #1936

Closed
fischerp opened this issue Feb 15, 2023 · 4 comments · Fixed by oclif/core#614
Closed

InvalidPackageIdError: The id [My] is invalid. #1936

fischerp opened this issue Feb 15, 2023 · 4 comments · Fixed by oclif/core#614
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@fischerp
Copy link

fischerp commented Feb 15, 2023

Summary

Commands are not working when packageAliases contains spaces. For example, "My Package".

"packageAliases": {
    "My Package": "0Ho4...",

When removing the whitespace, it works as expected. E.g.: "MyPackage": "0Ho4...",

Steps To Reproduce:

  1. Add a space to your package alias.
  2. Execute a command that uses the alias. For instance: sfdx package version list --packages "My Package" --released --json
  3. Check the error

Expected result

List of released packages

{
  "status": 0,
  "result": [
    {
      "Package2Id": "0Ho4x...",
      "Branch": null,
      "Tag": null,
      "MajorVersion": 1,
      "MinorVersion": 0,
      "PatchVersion": 0,
      "BuildNumber": 3,
      ...

Actual result

Error:

{
  "code": 1,
  "message": "The id [My] is invalid. It must start with \"0Ho\".",
  "name": "InvalidPackageIdError",
  "status": 1,
  "stack": "InvalidPackageIdError: The id [My] is invalid. It must start with \"0Ho\".

System Information

  • Which shell/terminal are you using? zsh
{
  "cliVersion": "sfdx-cli/7.187.1",
  "architecture": "darwin-arm64",
  "nodeVersion": "node-v19.2.0",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 1.4.4 (core)",
    "@oclif/plugin-commands 2.2.5 (core)",
    "@oclif/plugin-help 5.2.2 (core)",
    "@oclif/plugin-not-found 2.3.17 (core)",
    "@oclif/plugin-plugins 2.3.0 (core)",
    "@oclif/plugin-search 0.0.11 (core)",
    "@oclif/plugin-update 3.1.1 (core)",
    "@oclif/plugin-version 1.2.1 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.24 (core)",
    "@oclif/plugin-which 2.2.12 (core)",
    "alias 2.2.0 (core)",
    "apex 1.5.0 (core)",
    "auth 2.4.0 (core)",
    "community 2.2.0 (core)",
    "config 1.5.0 (core)",
    "custom-metadata 2.1.0 (core)",
    "data 2.2.0 (core)",
    "generator 2.0.17 (core)",
    "info 2.4.0 (core)",
    "limits 2.3.0 (core)",
    "org 2.3.0 (core)",
    "packaging 1.14.1 (core)",
    "schema 2.3.0 (core)",
    "signups 1.4.0 (core)",
    "source 2.4.1 (core)",
    "telemetry 2.1.0 (core)",
    "templates 55.3.0 (core)",
    "trust 2.4.0 (core)",
    "user 2.3.0 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
    "salesforce-alm 54.8.5 (core)"
  ],
  "osVersion": "Darwin 21.6.0",
  "shell": "zsh",
  "rootPath": "/opt/homebrew/lib/node_modules/sfdx-cli"
}

@fischerp fischerp added the investigating We're actively investigating this issue label Feb 15, 2023
@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.

@mshanemc mshanemc added the bug Issue or pull request that identifies or fixes a bug label Feb 15, 2023
@git2gus
Copy link

git2gus bot commented Feb 15, 2023

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

@mshanemc
Copy link
Contributor

@fischerp could you try this with our current RC? We saw something similar bug in another place (an array falg using quotes with spaces) and fixed that down in oclif. I'm hoping the fix solved it for this command, too.

And that would save me the time of setting up a package, alias, etc. 😄

@fischerp
Copy link
Author

Hi @mshanemc, thanks! Yes, I confirm that it works as expected when using the current RC.

System Information
Which shell/terminal are you using? zsh

{
  "cliVersion": "sfdx-cli/7.189.1",
  "architecture": "darwin-arm64",
  "nodeVersion": "node-v19.2.0",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.1.0 (core)",
    "@oclif/plugin-commands 2.2.9 (core)",
    "@oclif/plugin-help 5.2.4 (core)",
    "@oclif/plugin-not-found 2.3.20 (core)",
    "@oclif/plugin-plugins 2.3.2 (core)",
    "@oclif/plugin-search 0.0.13 (core)",
    "@oclif/plugin-update 3.1.4 (core)",
    "@oclif/plugin-version 1.2.1 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.27 (core)",
    "@oclif/plugin-which 2.2.15 (core)",
    "alias 2.2.2 (core)",
    "apex 2.2.0 (core)",
    "auth 2.5.0 (core)",
    "community 2.2.3 (core)",
    "config 1.5.1 (core)",
    "custom-metadata 2.1.2 (core)",
    "data 2.2.1 (core)",
    "generator 2.0.17 (core)",
    "info 2.4.2 (core)",
    "limits 2.3.3 (core)",
    "org 2.4.0 (core)",
    "packaging 1.14.4 (core)",
    "schema 2.3.1 (core)",
    "signups 1.4.1 (core)",
    "source 2.5.3 (core)",
    "telemetry 2.1.1 (core)",
    "templates 55.4.1 (core)",
    "trust 2.4.1 (core)",
    "user 2.3.2 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)"
  ],
  "osVersion": "Darwin 21.6.0",
  "shell": "zsh",
  "rootPath": "/opt/homebrew/lib/node_modules/sfdx-cli"
}

Command used to install lastest-rc:
npm install --global sfdx-cli@latest-rc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants