Newer Version Available

This content describes an older version of this product. View Latest

Troubleshoot Package Conversion Failures

Here are some possible error scenarios that could occur when you convert a package.

RecordType Errors

If the package you’re converting contains a RecordType, you must specify it under object settings in a scratch org definition file. For example,

Then specify the scratch org definition file when you run the package conversion CLI command.

Org Shape Errors

If during package conversion you receive an error related to org shape, make sure the package version you’re converting was created using Salesforce API version 57 or later. If your package is using a lower API version, create a new 1GP package version using the latest API version.

If you followed the steps from Workflow for Converting Your Managed 1GP Package and your org shape creation failed, try these steps.

  • Create a scratch org definition file that mirrors the dependencies present in your packaging org. Note: The sourceOrg defaults to your 1GP packaging org, and can’t be overridden.
  • Retry the package conversion command, and reference the scratch org definition file you created. In this example, we named our scratch org file, packaging-org-scratch-def.json.

When this command is run, you create an org shape using your scratch org definition file. If this doesn’t work, please report the issue.

If you encounter an error during conversion, run the following command and report the issue:

To troubleshoot other org shape errors, see Scratch Org Error Codes.

Picklist Value Errors

If your package references a custom picklist value that isn’t included in Salesforce’s StandardValueSet, a picklist error occurs during package conversion.

For more details on Standard Value Sets, StandardValueSet in Metadata API Developer Guide.

To resolve this error, follow these steps.

  1. Create a package.xml file that follows this example. Replace the example AccountType value with the object identified in the error you received. Update the version field to the current Salesforce API version
  2. Authenticate to your packaging org. The required picklist values should be present in your packaging org
  3. Run the project retrieve Salesforce CLI command. Replace the variables for org alias and path, with the actual values you need.

    After the retrieve command completes, a new file is created in your force-app/main/default/standardValueSets directory. The name of the file will be AccountType.standardValueSet-meta.xml, where AccountType is the object you specified in your package.xml file.

  4. Create a parent and child folder in your project root

    New parent folder: seed-metadata/

    New child folder: standardValueSets/

    Only standardValueSet metadata type is allowed in the seed-metadata folder

    Note

  5. Move the <object>.standardValueSet-meta.xml file into the seedmetadata/standardValueSets/ directory you created.
  6. Run the package conversion CLI command and specify the --seed-metadata flag and the path to your seed metadata file.

    sf package convert --package <033xxxx> --seed-metadata=<path-to-seedmetadata>

If you package encounter new errors for other picklist values, repeat these steps.