cli
cli copied to clipboard
Delete Scratch Org when force:org:create didn't succeed
BUG With the new mapping between the Metadata API settings and the project-scratch-def.json file, the CLI is now creating a Scratch Org, and then deploy the settings.
This is an implementation detail, but leading to a painful result:
Each time a Scratch Org fails because of a setting issue (ERROR running force:org:create: Failed to deploy settings to scratch org
), the Scratch Org is still created and counts against the active Scratch Org limit (ERROR running force:org:create: The signup request failed because this organization has reached its active scratch org limit
).
What are you trying to do Trying to create a Scratch Org, and if it doesn't work, don't count it in the active scratch org limit as the command failed.
Describe the solution you'd like
When sfdx force:org:create
fails, don't count it in the active scratch org limit (most likely, delete it if settings deployment failed).
Additional context Today we had an issue with Scratch Org creation and its related settings (see #201). When a whole team is trying to create a Scratch Org, that it's failing, and that each failed attempt count against the limit, you quickly reach the limit.