hashicorp/setup-terraform "401" from releases.hashicorp.com
setup-terraform fetches the binary from releases.hashicorp.com. A 401 or transient network failure during that download fails the step before Terraform is available.
What this error means
The setup-terraform step fails with a 401 or download error against releases.hashicorp.com.
github-actions
Error: Failed to download Terraform: unexpected status code 401 from https://releases.hashicorp.com
##[error]Error: Failed to download TerraformCommon causes
Transient endpoint error
A momentary 401/5xx from the releases CDN drops the download.
Proxy or rate interference
A network proxy or rate limit on the runner blocks the binary fetch.
How to fix it
Pin a version and retry the download
- Pin terraform_version to a released version.
- Wrap flaky setup in a retry, or re-run the job for transient CDN errors.
- Confirm terraform --version after setup.
.github/workflows/terraform.yml
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.9.5
- run: terraform versionHow to prevent it
- Pin terraform_version so the download target is deterministic.
- Latchkey managed runners auto-retry transient download failures from upstream release CDNs, so these flakes usually clear without manual re-runs.
Frequently asked questions
What causes ""401 Unauthorized from releases.hashicorp.com""?
A momentary 401/5xx from the releases CDN drops the download.
How do I fix "401 Unauthorized from releases.hashicorp.com"?
Pin a version and retry the download
Related guides
azure/setup-helm "chart version not found" / version resolution failureFix azure/setup-helm failing to resolve a pinned Helm version that does not exist or is unreachable.
GitHub Actions hashicorp/setup-terraform wrapper conflictFix hashicorp/setup-terraform wrapper conflicts - the action wraps the terraform binary, and steps that call…
GitHub Actions hashicorp/setup-terraform Fails to Install TerraformFix hashicorp/setup-terraform failing - a non-existent terraform_version, a transient releases.hashicorp.com…