Skip to content
Latchkey

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

  1. Re-run when the failure is a DNS/connection error to releases.hashicorp.com.
  2. Set terraform_wrapper: false if its stdout wrapping interferes with parsing command output.
  3. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →