Newer Version Available

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

Error: Lightning Experience-Enabled Custom Domain Is Unavailable

If you create a scratch org with force:org:create, and then immediately try to use it, you sometimes get an error after waiting a few minutes for the command to finish.

For example, if you try to open the new scratch org in a browser with force:org:open, you might get this error:

1Waiting to resolve the Lightning Experience-enabled custom domain...
2ERROR running force:org:open:  The Lightning Experience-enabled custom domain is unavailable.

The error occurs because it takes a few minutes for the Lightning Experience-enabled custom domain to internally resolve.

When using the CLI interactively, wait a few more minutes and run the command again. In a CI environment, however, you can avoid the error altogether by changing how long the CLI itself waits.

By default, the CLI waits 240 seconds (4 minutes) for the custom domain to become available. You can configure the CLI to wait longer by setting the SFDX_DOMAIN_RETRY environment variable to the number of seconds you want it to wait. For example, to wait 5 minutes (300 seconds):

1export SFDX_DOMAIN_RETRY=300

If you want the CLI to bypass the custom domain check entirely, set SFDX_DOMAIN_RETRY to 0.