{"record":{"id":"f2b37493cb70f82c","repo":"hashicorp/terraform","slug":"attempted-to-initialize-pluggable-state-with-an-em","errorCode":null,"errorMessage":"Attempted to initialize pluggable state with an empty string identifier for the state store. This is a bug in Terraform and should be reported","messagePattern":"Attempted to initialize pluggable state with an empty string identifier for the state store\\. This is a bug in Terraform and should be reported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/backend/pluggable/pluggable.go","lineNumber":41,"sourceCode":"// a state store implemented in the provider that's within the Pluggable.\n//\n// These are the assumptions about that\n// provider:\n// * The provider implements at least one state store.\n// * The provider has already been fully configured before using NewPluggable.\n//\n// The state store could also be configured prior to using NewPluggable,\n// but preferably it will be configured via the Pluggable,\n// using the relevant backend.Backend methods.\n//\n// By wrapping a configured provider in a Pluggable we allow calling code\n// to use the provider's gRPC methods when interacting with state.\nfunc NewPluggable(p providers.Interface, typeName string) (*Pluggable, error) {\n\tif p == nil {\n\t\treturn nil, errors.New(\"Attempted to initialize pluggable state with a nil provider interface. This is a bug in Terraform and should be reported\")\n\t}\n\tif typeName == \"\" {\n\t\treturn nil, errors.New(\"Attempted to initialize pluggable state with an empty string identifier for the state store. This is a bug in Terraform and should be reported\")\n\t}\n\n\treturn &Pluggable{\n\t\tprovider: p,\n\t\ttypeName: typeName,\n\t}, nil\n}\n\nvar _ backend.Backend = &Pluggable{}\n\ntype Pluggable struct {\n\tprovider providers.Interface\n\ttypeName string\n}\n\n// ConfigSchema returns the schema for the state store implementation\n// name provided when the Pluggable was constructed.\n//","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/pluggable/pluggable.go#L23-L59","documentation":"Returned by NewPluggable (internal/backend/pluggable/pluggable.go:41) when typeName (the state store identifier) is the empty string. The Pluggable needs a non-empty typeName to select which state store implementation to invoke on the provider (ConfigSchema, Configure, etc. all key off p.typeName). An empty identifier is an internal invariant violation, not user input.","triggerScenarios":"Terraform core calling NewPluggable(p, \"\") because the state store type name failed to parse/resolve from the backend configuration block before construction. This indicates the caller did not validate the parsed 'backend \"<type>\"' address into a concrete state store name.","commonSituations":"A malformed or unrecognized pluggable backend address in the terraform configuration that core fails to map to a state store type; a regression in the backend address parsing; experimental/new state store providers that misreport their type list.","solutions":["Report the bug to Terraform maintainers as the message instructs (this is a core invariant, not config).","Verify the backend block in your configuration is well-formed and the provider actually advertises state stores (GetProviderSchema returns non-empty StateStores).","Try a different Terraform version to rule out a regression in pluggable-state wiring."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if typeName == \"\" {\n    return nil, fmt.Errorf(\"cannot build pluggable backend: state store type name is empty (check backend address parsing)\")\n}\nreturn pluggable.NewPluggable(p, typeName)","typeGuard":null,"tryCatchPattern":"pb, err := pluggable.NewPluggable(p, typeName)\nif err != nil {\n    return fmt.Errorf(\"internal terraform error: %w\", err)\n}","preventionTips":["Validate the parsed backend address resolves to a concrete state store type before construction.","Ensure the provider advertises its state stores via GetProviderSchema.","Report empty-type-name cases as bugs rather than masking them."],"tags":["backend","pluggable","provider","validation","internal-bug"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}