Skip to content
Latchkey

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 Terraform

Common 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

  1. Pin terraform_version to a released version.
  2. Wrap flaky setup in a retry, or re-run the job for transient CDN errors.
  3. Confirm terraform --version after setup.
.github/workflows/terraform.yml
- uses: hashicorp/setup-terraform@v3
  with:
    terraform_version: 1.9.5
- run: terraform version

How 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

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card