forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
491 stars 79 forks source link

Cannot promote a package #2961

Closed ShubhankarSinghTroopr closed 2 months ago

ShubhankarSinghTroopr commented 2 months ago

I am able to create a package using sfdx But while promotion it throws an error

$ sfdx force:package:version:promote -p 04txxxxxxxxxxxxxxx -v MyPackagingOrgAlias Error (ErrorInvalidIdNoMatchingVersionIdError): The Subscriber Package Version Id 04txxxxxxxxxxxxxxx is invalid, as a corresponding Package Version Id was not found`

steps to reproduce:

  1. Create a package version using sfdx : sfdx force:package:version:create -p packegename -d force-app/ --installationkeybypass --wait 10 -v orgAlias -c
  2. Then promote it: sfdx force:package:version:promote -p 04txxxxxxxxxxxxxxx -v orgAlias

More info:

$ sfdx version --verbose --json
{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.50.6",
  "nodeVersion": "node-v20.10.0",
  "osVersion": "Windows_NT 10.0.22631",
  "rootPath": "C:\\Users\\shubh\\AppData\\Roaming\\npm\\node_modules\\@salesforce\\cli",
  "shell": "C:\\Program Files\\Git\\usr\\bin\\bash.exe",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.1.6 (core)",
    "@oclif/plugin-commands 4.0.6 (core)",
    "@oclif/plugin-help 6.2.5 (core)",
    "@oclif/plugin-not-found 3.2.10 (core)",
    "@oclif/plugin-plugins 5.3.4 (core)",
    "@oclif/plugin-search 1.2.2 (core)",
    "@oclif/plugin-update 4.4.7 (core)",
    "@oclif/plugin-version 2.2.6 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.8 (core)",
    "@oclif/plugin-which 3.2.6 (core)",
    "@salesforce/cli 2.50.6 (core)",
    "apex 3.2.4 (core)",
    "auth 3.6.33 (core)",
    "data 3.5.5 (core)",
    "deploy-retrieve 3.9.13 (core)",
    "info 3.3.17 (core)",
    "limits 3.3.17 (core)",
    "marketplace 1.2.17 (core)",
    "org 4.3.4 (core)",
    "packaging 2.7.0 (core)",
    "schema 3.3.19 (core)",
    "settings 2.3.8 (core)",
    "sobject 1.4.19 (core)",
    "source 3.5.3 (core)",
    "telemetry 3.6.1 (core)",
    "templates 56.3.2 (core)",
    "trust 3.7.13 (core)",
    "user 3.5.17 (core)",
    "@salesforce/sfdx-scanner 4.3.2 (user) published 14 days ago (Wed Jul 03 2024)"
  ]
}
github-actions[bot] commented 2 months ago

Hello @ShubhankarSinghTroopr :wave: None of the versions of sf you shared match the latest release.

Shared: 2.49.7 Latest: 2.50.6

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

github-actions[bot] commented 2 months ago

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.

ShubhankarSinghTroopr commented 2 months ago

issue fixed by adding --api-version=61.0 to promoto code

Zibcio commented 2 months ago

i have the same issue, adding --api-version=61.0 doesnt work for me. Below output from mine sf version --verbose --json:

sf version --verbose --json
{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.50.6",
  "nodeVersion": "node-v20.15.0",
  "osVersion": "Windows_NT 10.0.19045",
  "rootPath": "C:\\Users\\UserName\\AppData\\Local\\sf\\client\\2.50.6-6e9d7f7",
  "shell": "cmd.exe",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.1.6 (core)",
    "@oclif/plugin-commands 4.0.6 (core)",
    "@oclif/plugin-help 6.2.5 (core)",
    "@oclif/plugin-not-found 3.2.10 (core)",
    "@oclif/plugin-plugins 5.3.4 (core)",
    "@oclif/plugin-search 1.2.2 (core)",
    "@oclif/plugin-update 4.4.7 (core)",
    "@oclif/plugin-version 2.2.6 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.8 (core)",
    "@oclif/plugin-which 3.2.6 (core)",
    "@salesforce/cli 2.50.6 (core)",
    "apex 3.2.4 (core)",
    "auth 3.6.33 (core)",
    "data 3.5.5 (core)",
    "deploy-retrieve 3.9.13 (core)",
    "info 3.3.17 (core)",
    "limits 3.3.17 (core)",
    "marketplace 1.2.17 (core)",
    "org 4.3.4 (core)",
    "packaging 2.7.0 (core)",
    "schema 3.3.19 (core)",
    "settings 2.3.8 (core)",
    "sobject 1.4.19 (core)",
    "source 3.5.3 (core)",
    "telemetry 3.6.1 (core)",
    "templates 56.3.2 (core)",
    "trust 3.7.13 (core)",
    "user 3.5.17 (core)"
  ]
}

Even from sf package version report --package 04t************** i receive the same issue Error (ErrorInvalidIdNoMatchingVersionIdError): The Subscriber Package Version Id 04t************** is invalid, as a corresponding Package Version Id was not found

ShubhankarSinghTroopr commented 2 months ago

sfdx force:package:version:promote -p 04txxxxxxxxxxxxxxx -v YourDEvHUBAlias --api-version=61.0 ///This should work

ShubhankarSinghTroopr commented 2 months ago

better take a call with saleaforce team to see if its 62 or 63 now..these guys just keep on increasing without telling people

Zibcio commented 2 months ago

@ShubhankarSinghTroopr i tried SF and SFDX commands also the command that you wrote with a different parameters and different API versions and it doesn't work even package version report returns the same error message. I already had a call with SF support and it wasn't helpful for me and "they are investigating my case"..

RupertBarrow commented 2 months ago

better take a call with saleaforce team to see if its 62 or 63 now..these guys just keep on increasing without telling people

API version is incremented at every Salesforce release, which happens 3 times a year. It's very public !

https://help.salesforce.com/s/articleView?id=release-notes.rn_api_nc.htm&release=248&type=5