GitHub Actions hashicorp/setup-terraform Fails to Install Terraform
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@v3
with:
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.
Related guides
GitHub Actions gradle/actions/setup-gradle Fails to Download the DistributionFix gradle/actions/setup-gradle failing to fetch the Gradle distribution - a transient services.gradle.org ou…
GitHub Actions ruby/setup-ruby bundler-cache Fails to Restore GemsFix ruby/setup-ruby with bundler-cache: true failing - a missing Gemfile.lock, an uncommitted lockfile, or bu…
GitHub Actions aws-actions/amazon-ecr-login Fails to AuthenticateFix aws-actions/amazon-ecr-login errors - missing AWS credentials in the job, no ecr:GetAuthorizationToken pe…