GitHub Actions hashicorp/setup-terraform Fails to Install Terraform
By Kaveh Alemi·Latchkey
hashicorp/setup-terraform could not install the requested Terraform. Either the terraform_version does not exist, or the binary download from releases.hashicorp.com failed transiently.
What this error means
The setup-terraform step fails while resolving or downloading the binary, with a version-not-found message or a network error fetching the release. Later terraform commands then fail with "command not found".
Actions log
Error: Unable to find Terraform version '1.99.0'
# or
Error: getaddrinfo EAI_AGAIN releases.hashicorp.com (transient)
Common causes
Non-existent terraform_version
A pinned terraform_version that was never released (or a typo) cannot be resolved against the HashiCorp release index.
Transient download failure
The binary is fetched from releases.hashicorp.com; a brief DNS or connectivity blip fails the download even with a valid version.
How to fix it
Pin a real version (or a constraint)
.github/workflows/ci.yml
- uses:hashicorp/setup-terraform@v3with:terraform_version:"1.8.5" # a released version, or "~> 1.8"
Retry transient fetches; keep the wrapper in mind
Re-run when the failure is a DNS/connection error to releases.hashicorp.com.
Set terraform_wrapper: false if its stdout wrapping interferes with parsing command output.
Verify the pinned version exists before committing it.
How to prevent it
Pin to a released terraform_version or a version constraint.
Retry transient binary-download failures.
Disable terraform_wrapper when you parse raw command output.
Frequently asked questions
What causes "setup-terraform install"?
A pinned terraform_version that was never released (or a typo) cannot be resolved against the HashiCorp release index.
How do I fix setup-terraform install?
Pin a real version (or a constraint)
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.