Skip to content
Latchkey

Salesforce scratch org creation timed out in CI

Scratch org provisioning is asynchronous. The CLI polls until the org is ready or the --wait window ends. A timeout means provisioning was still in progress (or the signup was slow), not necessarily that it failed.

What this error means

Scratch org creation ends with a timeout message saying the command stopped waiting for the org to be created within the wait period.

sf
Error (1): The scratch org did not complete within your wait time of 6 minutes. Try again with a longer wait time.

Common causes

Provisioning took longer than the wait window

Signup load or a complex scratch definition can push provisioning past the default --wait, so the CLI gives up waiting.

A slow or busy signup service

Transient signup-side slowness extends provisioning time beyond a short wait.

How to fix it

Increase the wait time

  1. Raise --wait so the CLI polls long enough for provisioning to finish.
  2. If it still times out, check sf org list to see if the org actually came up.
  3. Retry creation if the org never appeared.
Terminal
sf org create scratch \
  --definition-file config/project-scratch-def.json \
  --alias ci-scratch --wait 20 --duration-days 1

Reconcile orgs that finished after the timeout

An org can finish provisioning right after the CLI stops waiting. List scratch orgs and reuse or delete the late one instead of creating another.

Terminal
sf org list --all

How to prevent it

  • Use a generous --wait for scratch org creation in CI.
  • Keep scratch definitions lean so provisioning is fast.
  • Reconcile late-provisioned orgs to avoid leaking active orgs.

Frequently asked questions

What causes ""scratch org ... timed out""?
Signup load or a complex scratch definition can push provisioning past the default --wait, so the CLI gives up waiting.
How do I fix "scratch org ... timed out"?
Increase the wait time

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card