3

I am trying to upgrade from v0.6 to v0.7 of a Managed Package which uses 2GP.

I am getting this error message:

This app can't be upgraded.
There are problems that prevent this package from being installed.
Invalid Upgrade.
The currently installed version does not share a common ancestor with this version.

I understand what this error message is trying to tell me.

But when I run command:

sfdx force:package:version:list

I can see all the package versions and their Ancestors and Ancestor Versions and they are all the same.

04t4J000002AXX7QXX  0.4.0.1
04t4J000002AXX7QXX  0.4.0.1
04t4J000002AXX7QXX  0.4.0.1
04t4J000002AXX7QXX  0.4.0.1
04t4J000002AXX7QXX  0.4.0.1
04t4J000002AXX7QXX  0.4.0.1

As suggested by the legend Mohith Shrivastava I tried running the command:

sfdx force:package:version:displayancestry -p "My Awesome App"

Output:

─┬ 0.1.0.26
 ├── 0.2.0.1
 ├─┬ 0.3.0.1
 │ └─┬ 0.4.0.1
 │   ├── 0.5.0.1
 │   ├── 0.6.0.3
 │   ├── 0.7.0.1
 │   └── 0.8.0.1
 └── 1.2.0.1
── 1.0.0.1
── 1.1.0.2

First off you will notice (and most likely laugh at the fact) that I've messed up the package version ancestry once before.

Currently v0.5.0.1 is used by most people.

Questions

  1. Why am I getting this error if they do share a common ancestor with this version?
  2. How can I fix this?
1
  • 2
    force:package:version:displayancestry what does this display? Commented Feb 28, 2021 at 14:23

1 Answer 1

0

When you create your package with ancestry make sure to use the immediate parent as the ancestor for the next package so that the package can be upgraded!

In your case you needed 0.6 to have ancestry as 0.5 and 0.6 should be ancestry for 0.7

Then only one can upgrade the package in orgs installed with 0.5 and 0.6! You have branched off now meaning you can only install these new packages in orgs that have 0.4!

At this point you can easily create a new package say 0.9 to allow upgrade by making sure you specify installed version like 0.5 as ancestry!

Similarly for the next version that is 1.0 specify 0.9 as ancestry

Remember the rule of thumb with ancestry is to make the immediate parent as ancestry for the next version unless and otherwise, you are looking to discard the branch and currently installed package in the org!

Learn more about the Package Ancestors here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .