{"record":{"id":"ad0b7c01b8497f67","repo":"hashicorp/terraform","slug":"address-argument-is-required","errorCode":null,"errorMessage":"address argument is required","messagePattern":"address argument is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/http/backend.go","lineNumber":127,"sourceCode":"\t\t\t},\n\t\t},\n\t}\n}\n\ntype Backend struct {\n\tbackendbase.Base\n\n\tclient *httpClient\n}\n\nfunc (b *Backend) Configure(configVal cty.Value) tfdiags.Diagnostics {\n\taddress := backendbase.GetAttrEnvDefaultFallback(\n\t\tconfigVal, \"address\",\n\t\t\"TF_HTTP_ADDRESS\", cty.StringVal(\"\"),\n\t).AsString()\n\tif address == \"\" {\n\t\treturn backendbase.ErrorAsDiagnostics(\n\t\t\tfmt.Errorf(\"address argument is required\"),\n\t\t)\n\t}\n\tupdateURL, err := url.Parse(address)\n\tif err != nil {\n\t\treturn backendbase.ErrorAsDiagnostics(\n\t\t\tfmt.Errorf(\"failed to parse address URL: %s\", err),\n\t\t)\n\t}\n\tif updateURL.Scheme != \"http\" && updateURL.Scheme != \"https\" {\n\t\treturn backendbase.ErrorAsDiagnostics(\n\t\t\tfmt.Errorf(\"address must be HTTP or HTTPS\"),\n\t\t)\n\t}\n\n\tupdateMethod := backendbase.GetAttrEnvDefaultFallback(\n\t\tconfigVal, \"update_method\",\n\t\t\"TF_HTTP_UPDATE_METHOD\", cty.StringVal(\"POST\"),\n\t).AsString()","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/http/backend.go#L109-L145","documentation":"The HTTP backend's Configure() requires an 'address' (the REST endpoint URL where state is GET/PUT). It's resolved from the config attribute or the TF_HTTP_ADDRESS env var with an empty-string default; if the result is empty, the backend cannot construct any URL and refuses to configure.","triggerScenarios":"'terraform init' with a backend \"http\" {} block that omits address and does not set TF_HTTP_ADDRESS; or sets it to an empty string explicitly.","commonSituations":"Migrated config where the address block was deleted; env var typo (TF_HTTP vs TF_HTTP_ADDRESS); templating rendered the attribute to empty in CI; copy-paste from a partial example.","solutions":["Add address = \"https://state.example.com/?type=axios\" (or your endpoint) to the http backend block.","Or export TF_HTTP_ADDRESS in the environment before 'terraform init'.","Confirm the value isn't an interpolation that resolves to empty; check with 'terraform init -backend=false' then inspect the rendered config."],"exampleFix":"// before\nterraform {\n  backend \"http\" {}\n}\n\n// after\nterraform {\n  backend \"http\" {\n    address = \"https://state.my-org.dev/?type=axios\"\n  }\n}","handlingStrategy":"validation","validationCode":"addr := os.Getenv(\"TF_HTTP_ADDRESS\")\nif addr == \"\" { log.Fatal(\"address argument is required: set backend.address or TF_HTTP_ADDRESS\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always populate address in the backend block.","Set TF_HTTP_ADDRESS as a fallback in CI.","Lint the backend block with terraform validate."],"tags":["http","backend","config-validation","url"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}