When creating a DX Unlocked Package version from a DevHub org and user with Second Generation Packages Enabled (1h ago)

sfdx force:package:version:create -p "myapp" -x -json 

I get the following errors:

ERROR running force:package:version:create: No such column 'Instance' on sobject of type Package2VersionCreateRequest

Try this: Your org does not have permission to specify a build instance for your package version. Verify that you are authenticated to the desired org and try again. Otherwise, contact Salesforce Customer Support for more information.

When I call the command without the -json param it takes a minute and then comes back with other metadata errors that all seem to miss a custom object which is part of the package.

ERROR running force:package:version:create: TestQuoteCtrl: Invalid type: MyQuote__c,TestMyQuoteCtrl: Invalid type: MyLineItem__c,QuoteManager: Invalid type


My solution was two-fold:

  1. Don't use the -json parameter as it doesn't print the real root causes
  2. As many documentations and blogs about this topic I forgot to specify the -f parameter in my version create command. If omitted the version is created from a default scratch org which in my case was incompatible with some metadata settings.

    sfdx force:package:version:create -p my-app -d force-app --wait 10 -v DevHub -x -f config/project-scratch-def.json

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.