Skip to content

Cannot create new build version of a released package version #3211

@jclappsy

Description

@jclappsy

Note
Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

As of today, I cannot increment the build version number of a package if the package is already released

Example:

    {
      "path": "my-package",
      "package": "My Package",
      "versionName": "Summer '23",
      "versionNumber": "0.1.0.NEXT",
      "default": false
    },

When running: sf package version create --package "My Package", I would expect the build version number to be bumped to 0.1.0.2 but I receive the following error:

Can't create package version. A managed released package version with version number 0.1.0 already exists. For new package versions, use a version number that is higher than the latest managed released package version. Format package version numbers as major.minor.patch.build.

Here is a working example. 1.42.0.1 was in a released state on 2/6. I was able to run sf package version create --package "Working Example" multiple times to increment the build version number on 2/7. This is evident as the build version number is 4.

sf package version list --released --packages "Working Example" 
{
  "packageName": "Working Example",
  "packageVersion": "id",
  "version": "1.42.0.1",
  "CreatedDate": "2025-02-06 20:14"
}
sf package version list --packages "Working Example"
{
  "packageName": "Working Example",
  "packageVersion": "id",
  "version": "1.42.0.4",
  "CreatedDate": "2025-02-07 18:45"
}

Steps To Reproduce

IMPORTANT
Provide a repository that's configured to reproduce the issue. If you are unable to provide a repo, please explain why not. The more info we have from the start, the faster we can resolve your issue.
We may close your issue if you don't include proper instructions.

  • Generate a project with sf project generate or fork dreamhouse-lwc.
  • Provide detailed step-by-step instructions on how to reproduce the issue.

Tip

use sf doctor --create-issue to automatically fill the required information

Expected result

running sf package version create --package "My Package" on a released package should increment the build number if the version number in the sfdx-project.json file is in the following format: MAJOR.MINOR.PATCH.NEXT

Actual result

Package creation fails with the following error: Can't create package version. A managed released package version with version number 0.1.0 already exists. For new package versions, use a version number that is higher than the latest managed released package version. Format package version numbers as major.minor.patch.build.

Additional information

System Information

zsh

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.75.5",
  "nodeVersion": "node-v18.19.1",
  "osVersion": "Darwin 23.6.0",
  "rootPath": "/Users/name/.nvm/versions/node/v18.19.1/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.18 (core)",
    "@oclif/plugin-commands 4.1.18 (core)",
    "@oclif/plugin-help 6.2.23 (core)",
    "@oclif/plugin-not-found 3.2.38 (core)",
    "@oclif/plugin-plugins 5.4.28 (core)",
    "@oclif/plugin-search 1.2.19 (core)",
    "@oclif/plugin-update 4.6.27 (core)",
    "@oclif/plugin-version 2.2.21 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.31 (core)",
    "@oclif/plugin-which 3.2.26 (core)",
    "@salesforce/cli 2.75.5 (core)",
    "apex 3.6.8 (core)",
    "api 1.3.3 (core)",
    "auth 3.6.90 (core)",
    "data 4.0.7 (core)",
    "deploy-retrieve 3.18.0 (core)",
    "info 3.4.34 (core)",
    "limits 3.3.44 (core)",
    "marketplace 1.3.7 (core)",
    "org 5.2.25 (core)",
    "packaging 2.9.14 (core)",
    "schema 3.3.46 (core)",
    "settings 2.4.10 (core)",
    "sobject 1.4.49 (core)",
    "telemetry 3.6.31 (core)",
    "templates 56.3.35 (core)",
    "trust 3.7.59 (core)",
    "user 3.6.6 (core)"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingWe're actively investigating this issuevalidatedVersion information for this issue has been validated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions