{"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/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/backend/remote-state/http/backend.go#L109-L145","documentation":"Thrown by the HTTP remote state backend's Configure when the address attribute (or TF_HTTP_ADDRESS env var) resolves to an empty string. The address is the URL of the remote HTTP state endpoint and is mandatory.","triggerScenarios":"Configure computes address via GetAttrEnvDefaultFallback with config attr 'address', env 'TF_HTTP_ADDRESS', default empty; if all three resolve to empty the check fires.","commonSituations":"Backend block omits address; the variable backing address is unset; TF_HTTP_ADDRESS was expected to be exported by CI but was not; a templating step stripped the line.","solutions":["Add address = \"https://...\" to the http backend block.","Export TF_HTTP_ADDRESS in the shell/CI environment.","Verify the variable or template that supplies address renders a non-empty value."],"exampleFix":"// before\nterraform {\n  backend \"http\" {\n  }\n}\n// after\nterraform {\n  backend \"http\" {\n    address = \"https://state.example.com/terraform\"\n  }\n}","handlingStrategy":"validation","validationCode":"address := strings.TrimSpace(/* config attr or env */ \"\")\nif address == \"\" {\n    address = os.Getenv(\"TF_HTTP_ADDRESS\")\n}\nif address == \"\" {\n    return fmt.Errorf(\"http backend requires 'address' or TF_HTTP_ADDRESS\")\n}","typeGuard":"func isNonEmptyAddress(a string) bool { return strings.TrimSpace(a) != \"\" }","tryCatchPattern":null,"preventionTips":["Always populate `address` in the backend block or export TF_HTTP_ADDRESS in CI.","Fail CI early if the address variable resolves to empty.","Templated backends should default to a known endpoint, not empty."],"tags":["http","backend","configuration","required-argument"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}