Terraform "timeout while waiting for plugin to start" in CI
Terraform launches each provider as a subprocess and waits for it to report ready. If the handshake does not complete in time -- a slow or starved runner, a partial download -- it errors.
What this error means
init/plan fails with "timeout while waiting for plugin to start" or "Failed to instantiate provider". It can be intermittent, passing on retry, which points at a transient launch problem rather than bad config.
Error: Failed to instantiate provider
"registry.terraform.io/hashicorp/aws" to obtain schema: timeout while waiting
for plugin to startCommon causes
Resource-starved or slow runner
A CPU/memory-starved runner, or heavy parallelism, can delay the plugin handshake past the startup timeout.
Partially downloaded or incompatible binary
A truncated provider download or an arch mismatch (e.g. arm64 vs amd64) leaves a binary that cannot start.
How to fix it
Retry and reduce parallelism
Re-run init/plan and lower -parallelism so plugin startup is not starved; clear the cache if a binary is suspect.
rm -rf .terraform/providers
terraform init -input=false
terraform plan -input=false -parallelism=5Ensure the correct provider binary
- Confirm the provider supports the runner OS/arch.
- Clear .terraform/providers and re-init to redownload cleanly.
- Avoid extreme parallelism on small runners.
How to prevent it
- Use adequately sized runners for large provider graphs.
- Keep provider downloads clean (cache validation, correct arch).
- Run plan/apply on a platform that auto-retries transient plugin-start timeouts.