{"record":{"id":"d5612ced532502c9","repo":"hashicorp/terraform","slug":"resp-status","errorCode":null,"errorMessage":"resp.Status","messagePattern":"resp\\.Status","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/getproviders/didyoumean.go","lineNumber":229,"sourceCode":"\tplaceholderProviderAddr := addrs.NewLegacyProvider(typeName)\n\n\tresp, err := c.httpClient.Do(req)\n\tif err != nil {\n\t\treturn \"\", \"\", c.errQueryFailed(placeholderProviderAddr, err)\n\t}\n\tdefer resp.Body.Close()\n\n\tswitch resp.StatusCode {\n\tcase http.StatusOK:\n\t\t// Great!\n\tcase http.StatusNotFound:\n\t\treturn \"\", \"\", ErrProviderNotFound{\n\t\t\tProvider: placeholderProviderAddr,\n\t\t}\n\tcase http.StatusUnauthorized, http.StatusForbidden:\n\t\treturn \"\", \"\", c.errUnauthorized(placeholderProviderAddr.Hostname)\n\tdefault:\n\t\treturn \"\", \"\", c.errQueryFailed(placeholderProviderAddr, errors.New(resp.Status))\n\t}\n\n\ttype ResponseBody struct {\n\t\tId      string `json:\"id\"`\n\t\tMovedTo string `json:\"moved_to\"`\n\t}\n\tvar body ResponseBody\n\n\tdec := json.NewDecoder(resp.Body)\n\tif err := dec.Decode(&body); err != nil {\n\t\treturn \"\", \"\", c.errQueryFailed(placeholderProviderAddr, err)\n\t}\n\n\tprovider, diags := addrs.ParseProviderSourceString(body.Id)\n\tif diags.HasErrors() {\n\t\treturn \"\", \"\", fmt.Errorf(\"Error parsing provider ID from Registry: %s\", diags.Err())\n\t}\n","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/getproviders/didyoumean.go#L211-L247","documentation":"Emitted from the 'did you mean' provider lookup (getproviders.didyoumean). After a provider address is not found, Terraform queries the registry's moved/renamed endpoint to suggest alternatives; this is the default branch of the status switch, fired for any HTTP status other than 200/404/401/403. The raw resp.Status text becomes the error message.","triggerScenarios":"Running `terraform init` (or any provider resolution) when the registry responds with 500, 502, 503, 429, or any non-standard code to the moved-endpoint GET request.","commonSituations":"registry.terraform.io partial outage or maintenance; corporate HTTP proxy returning a block page (e.g. 407/451); rate limiting from many parallel CI pipelines; transient gateway errors.","solutions":["Retry `terraform init` after a short wait; transient 5xx/429 usually clear.","Check https://status.hashicorp.com for registry incidents.","Verify proxy/firewall egress to registry.terraform.io:443 and inspect any proxy interception.","Configure a local/filesystem provider mirror (cli config provider_installation) so init does not need the registry.","Reduce concurrent CI workers hitting the registry simultaneously to avoid 429s."],"exampleFix":"# use a local mirror to avoid registry dependency\n# ~/.terraformrc:\nprovider_installation {\n  filesystem_mirror {\n    path = \"/usr/local/share/terraform/plugins\"\n  }\n  direct { exclude = [\"registry.terraform.io/*/*\"] }\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"# wrap provider resolution in a retry loop from CI; the didyoumean call is transient\n# shell (CI):\n#   for i in 1 2 3; do terraform init && break || sleep $((i*15)); done","preventionTips":["Use a local filesystem mirror so the registry is not required at init time.","Pin provider versions and commit .terraform.lock.hcl to reduce registry calls.","Monitor status.hashicorp.com and gate deploys on registry health.","Cap concurrent CI jobs sharing one registry token to avoid 429s."],"tags":["network","registry","http","provider-installation"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}