1

I received some misleading suggestion to visit documentation page when I try to create a scratch org and it fails with SH-0002.

sfdx force:org:create -s -d 30 -a shape$(( RANDOM % 1000)) -f config/project-scratch-def.json
ERROR running force:org:create: Can’t create scratch org. No org shape exists for the specified sourceOrg. Create an org shape and try again.

Try this:
See https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_signuprequest.htm for information on error code SH-0002.

When I follow the link, I can't see this error in the list.

What is this error about?

1 Answer 1

2

When I opened a SF Support case, they refered to the another link https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_error_codes.htm which does include error SF-0002, but doesn't provide any additional information comparing to this already provided by the error text.

This error may happens if the default devhub user name is different from the devhub where org shape was created.

So to fix this, we need either change default devhub username by command

sfdx config:set defaultdevhubusername=desired-devhub-alias

or use -v switch parameter to the org creation command

sfdx force:org:create -s -d 30 -a shape$(( RANDOM % 1000)) -f config/project-scratch-def.json -v desired-devhub-alias

You must log in to answer this question.

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