OpenTofu Error: 'Failed to install provider' During tofu init
Fix OpenTofu's 'Failed to install provider' error on tofu init: diagnose registry, network, proxy, and platform issues so provider plugins download and install.
- #opentofu
- #terraform
- #iac
- #troubleshooting
- #errors
Stuck on this OpenTofu error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
Exact Error Message
╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/aws v5.60.0: could not query provider
│ registry for registry.opentofu.org/hashicorp/aws: failed to retrieve
│ authentication checksums for provider: 429 Too Many Requests
╵
The tail of the message varies — dial tcp: i/o timeout, x509: certificate signed by unknown authority, no available releases match the given constraints, or unsupported platform linux_arm64 — but the headline is always Failed to install provider during tofu init.
What It Means
During tofu init, OpenTofu contacts a provider registry (by default registry.opentofu.org), resolves a version that satisfies your constraints, downloads the plugin package for your OS and CPU architecture, verifies it, and unpacks it into .terraform/providers. Failed to install provider means one of those steps did not complete — most commonly a network, proxy, TLS, rate-limit, or platform-availability problem.
Because init runs before any planning, nothing in your infrastructure is affected. The fix is about connectivity, registry configuration, or version constraints rather than anything in your state or cloud account. Reading the exact tail of the message is the fastest way to know which of those you are dealing with.
Common Causes
- No outbound network access, or a corporate proxy that blocks the registry.
- A TLS-intercepting proxy whose CA certificate is not trusted by the runner (
x509: certificate signed by unknown authority). - Registry rate limiting (
429 Too Many Requests), common on busy shared CI without a mirror. - A version constraint that no released package satisfies (
no available releases match). - The provider does not publish a build for your platform (for example an ARM Linux runner).
- A wrong or unreachable
sourceaddress inrequired_providers.
Diagnostic Commands
Reproduce the failure with full logs to see the underlying HTTP or TLS error:
TF_LOG=DEBUG tofu init 2>&1 | tail -n 40
Confirm the runner can reach the registry at all:
curl -sS -o /dev/null -w '%{http_code}\n' https://registry.opentofu.org/.well-known/terraform.json
Check the exact source and constraints your config declares:
tofu providers
Verify your platform, since not every provider ships every architecture:
tofu version && uname -sm
Step-by-Step Resolution
-
Read the underlying cause from the
TF_LOG=DEBUGoutput — timeout, 429, TLS, or “no available releases” each need a different fix. -
If it is a proxy/network issue, export proxy variables so OpenTofu’s HTTP client uses them:
export HTTPS_PROXY=http://proxy.internal:3128
export NO_PROXY=localhost,127.0.0.1
tofu init
- For a TLS-intercepting proxy, trust the corporate CA on the runner rather than disabling verification:
export SSL_CERT_FILE=/etc/ssl/certs/corp-ca-bundle.pem
tofu init
- For rate limits or air-gapped runners, use a local filesystem mirror and point init at it:
tofu providers mirror ./tofu-mirror
tofu init -plugin-dir=./tofu-mirror
- If no release matches, relax or correct the constraint in
required_providers:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0, < 6.0"
}
}
}
- Re-run init and confirm success:
tofu init
OpenTofu has been successfully initialized!
If you are unsure which constraint to set, the OpenTofu provider prompts can suggest a safe version range for a given provider.
Prevention
- Run a shared provider mirror or network cache for CI so runners are not rate-limited by the public registry.
- Set
TF_PLUGIN_CACHE_DIRso repeated inits reuse already-downloaded plugins instead of re-fetching. - Trust corporate CAs on runners via
SSL_CERT_FILErather than turning off verification. - Pin provider versions and commit
.terraform.lock.hclso the exact package is resolved every time. - Confirm your target provider publishes a build for your OS/architecture before adopting it on unusual platforms.
- Fail fast in pipelines by running
tofu initas an early, isolated step so a registry outage is obvious rather than buried in a later plan.
Related Errors
Failed to query available provider packages— registry discovery failed before any download started.- Provider checksum mismatch — the package downloaded but did not match the lock file’s recorded hashes.
Failed to download module— the same class of network/source problem, but for a module source rather than a provider.Backend initialization required— a separate init-time step unrelated to provider installation.
Frequently Asked Questions
Does this error mean my infrastructure is broken? No — init runs before any plan or apply, so nothing in your cloud has changed; the problem is fetching or installing the provider plugin.
How do I fix it on an air-gapped or rate-limited CI runner? Build a local mirror with tofu providers mirror and run tofu init -plugin-dir=<mirror>, or set TF_PLUGIN_CACHE_DIR to reuse cached plugins.
Why do I get a certificate error only behind the company proxy? A TLS-intercepting proxy re-signs traffic with a CA the runner does not trust; add that CA via SSL_CERT_FILE instead of disabling verification.
What does ‘no available releases match’ mean? Your version constraint excludes every published release; loosen or correct the version in required_providers. For more init and provider fixes, see the OpenTofu guides.
Fixed it? Get 500 OpenTofu & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Did this fix your issue?
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.