highIntermediateSymptom-first#registry#network#proxy#download

Registry unreachable — cannot download provider or module

Failed to request access to registry.terraform.io

Likely source:connectivityconfiguration

Focused incident mode — strips away everything but this runbook.

Symptoms

  • Failed to request access to registry.terraform.io
  • Error: Unable to locate package for provider
  • terraform init fails with connection timeout to registry

Evidence to grab

Collect these artifacts before you change anything — they prove (or rule out) each cause.

  • Init error output

    terraform init 2>&1 | tail -20
  • Network connectivity test

    curl -sI https://registry.terraform.io | head -5

Diagnostic flow

Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.

Guided decision tree is ready.

Steps with commands, expected output, and pass/fail branches.

Ranked root causes

Evidence checklist

  • curl works but terraform init times out
  • HTTPS_PROXY is not set or is wrong
  • TLS certificate from proxy MITM is not trusted

Confirm before fixing

curl -sI https://registry.terraform.io --proxy <PROXY-URL>
READ

Test via the proxy

Fix

export HTTPS_PROXY=<PROXY-URL> && export SSL_CERT_FILE=<CA-BUNDLE> && terraform init
CHANGE

Set proxy and CA cert for Terraform

Resolution runbook

Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.

1
curl -sI https://registry.terraform.io
READ

Test basic registry connectivity

2
env | grep -iE 'http_proxy|https_proxy'
READ

Check proxy settings

3
export HTTPS_PROXY=<PROXY-URL> && export SSL_CERT_FILE=<CA-BUNDLE>
CHANGE

Configure proxy and TLS for corporate networks

4
terraform init
CHANGE

Re-run init with correct proxy settings

Prevention

  • Document proxy settings and CA bundle requirements for the team.
  • Use terraform providers mirror for air-gapped environments.
  • Pre-download providers in CI and cache them for offline use.
  • Test terraform init in the same network environment as production CI.

Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.