{"record":{"id":"6d5ffd8a7ac9e6db","repo":"hashicorp/terraform","slug":"can-not-get-s-from-terraform-backend-configuratio","errorCode":null,"errorMessage":"can not get %s from Terraform backend configuration","messagePattern":"can not get (.+?) from Terraform backend configuration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/oci/auth.go","lineNumber":95,"sourceCode":"\t\tp.privateKeyPassword = privateKeyPasswordVal.AsString()\n\t}\n\n\treturn p\n}\nfunc (p ociAuthConfigProvider) AuthType() (common.AuthConfig, error) {\n\treturn common.AuthConfig{\n\t\t\tAuthType:         common.UnknownAuthenticationType,\n\t\t\tIsFromConfigFile: false,\n\t\t\tOboToken:         nil,\n\t\t},\n\t\tfmt.Errorf(\"unsupported, keep the interface\")\n}\n\nfunc (p ociAuthConfigProvider) TenancyOCID() (string, error) {\n\tif p.tenancyOcid != \"\" {\n\t\treturn p.tenancyOcid, nil\n\t}\n\treturn \"\", fmt.Errorf(\"can not get %s from Terraform backend configuration\", TenancyOcidAttrName)\n}\n\nfunc (p ociAuthConfigProvider) UserOCID() (string, error) {\n\tif p.userOcid != \"\" {\n\t\treturn p.userOcid, nil\n\t}\n\treturn \"\", fmt.Errorf(\"can not get %s from Terraform backend configuration\", UserOcidAttrName)\n}\n\nfunc (p ociAuthConfigProvider) KeyFingerprint() (string, error) {\n\tif p.fingerprint != \"\" {\n\t\treturn p.fingerprint, nil\n\t}\n\treturn \"\", fmt.Errorf(\"can not get %s from Terraform backend configuration\", FingerprintAttrName)\n}\n\nfunc (p ociAuthConfigProvider) Region() (string, error) {\n\tif p.region != \"\" {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/oci/auth.go#L77-L113","documentation":"The OCI backend's API-key configuration provider needs the tenancy OCID to sign requests. TenancyOCID() returns the configured value if present, otherwise this error naming the missing attribute `tenancy_ocid`. It surfaces when the SDK's request signer (KeyID) asks for the tenancy and neither the backend config nor a downstream provider supplied it.","triggerScenarios":"Using the OCI backend with auth=APIKey (the default) where the tenancy_ocid attribute is unset, and the SDK CompositeConfigurationProvider falls through all providers to this raw one returning the error from TenancyOCID() at auth.go:91-96.","commonSituations":"Backend config block missing tenancy_ocid entirely; relying on a config_file_profile that itself lacks tenancy; typos in the attribute name; copy-paste from a provider block that used a different key.","solutions":["Add `tenancy_ocid` to the backend block with the full tenancy OCID (e.g. ocid1.tenancy.oc1.....).","If using config_file_profile, ensure the referenced profile contains tenancy in ~/.oci/config.","Validate the OCID format and that it matches the tenancy of the user/fingerprint/key."],"exampleFix":"# before - tenancy_ocid missing\nterraform {\n  backend \"oci\" {\n    namespace   = \"my-namespace\"\n    bucket      = \"tfstate\"\n    region      = \"us-phoenix-1\"\n    user_ocid   = \"ocid1.user.oc1..aaa\"\n    fingerprint = \"12:34:...\"\n  }\n}\n\n# after - include tenancy_ocid\nterraform {\n  backend \"oci\" {\n    namespace    = \"my-namespace\"\n    bucket       = \"tfstate\"\n    region       = \"us-phoenix-1\"\n    tenancy_ocid = \"ocid1.tenancy.oc1..aaa\"\n    user_ocid    = \"ocid1.user.oc1..aaa\"\n    fingerprint  = \"12:34:...\"\n  }\n}","handlingStrategy":"validation","validationCode":"// Ensure required OCI API-key attributes are set before configuring\nrequired := []string{\"tenancy_ocid\", \"user_ocid\", \"fingerprint\", \"region\"}\nfor _, k := range required {\n    if v, ok := getBackendAttr(cfg, k); !ok || v.AsString() == \"\" {\n        return fmt.Errorf(\"missing required OCI backend attribute: %s\", k)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set tenancy_ocid in the backend block (or a complete config_file_profile).","Validate that OCIDs match the tenancy/user of the supplied key.","Use a config_file_profile for local dev to centralize credentials."],"tags":["oci","remote-state","auth","config","terraform-backend"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}