{"record":{"id":"7fae7ba4cc4cbe8e","repo":"hashicorp/terraform","slug":"state-store-provider-q-s-has-unknown-supply-mo","errorCode":null,"errorMessage":"State store provider %q (%s) has unknown supply mode %q. This is a bug in Terraform and should be reported.","messagePattern":"State store provider %q \\((.+?)\\) has unknown supply mode %q\\. This is a bug in Terraform and should be reported\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/configs/state_store.go","lineNumber":173,"sourceCode":"\t\tpanic(\"This run has no dependency lock information provided at all. This is a bug in Terraform and should be reported.\")\n\t}\n\tif reqs == nil {\n\t\tpanic(\"This run has no required providers information provided at all. This is a bug in Terraform and should be reported.\")\n\t}\n\n\tif supplyMode.NotManagedByTerraform() {\n\t\t// If the provider is not managed by Terraform then it's not lockable.\n\t\t// If the working directory was initialized in the same way then the PSS provider will not be reflected in the lock file.\n\t\t// Skip them.\n\t\tswitch supplyMode {\n\t\tcase getproviders.BuiltIn:\n\t\t\tlog.Printf(\"[DEBUG] StateStore.VerifyDependencySelection: skipping %s because it's a built-in provider\", ss.ProviderAddr)\n\t\tcase getproviders.DevOverride:\n\t\t\tlog.Printf(\"[DEBUG] StateStore.VerifyDependencySelection: skipping %s because it's supplied via developer overrides\", ss.ProviderAddr)\n\t\tcase getproviders.Reattached:\n\t\t\tlog.Printf(\"[DEBUG] StateStore.VerifyDependencySelection: skipping %s because it's re-attached and not managed by Terraform\", ss.ProviderAddr)\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"State store provider %q (%s) has unknown supply mode %q. This is a bug in Terraform and should be reported.\", ss.ProviderAddr.Type, ss.ProviderAddr.ForDisplay(), supplyMode))\n\t\t}\n\t\treturn diags\n\t}\n\n\t// From this point on the provider currently in use is managed by Terraform\n\t//\n\t// When the PSS provider is managed, Terraform needs the state storage provider to be present in the lock file,\n\t// and the lock file should not be empty or missing.\n\tif depLocks.Empty() {\n\t\tdiags = diags.Append(tfdiags.Sourceless(\n\t\t\ttfdiags.Error,\n\t\t\t\"Inconsistent dependency lock file\",\n\t\t\tfmt.Sprintf(`The provider dependency used for state storage is missing from the lock file despite being present in the current configuration:\n  - provider %s: required by this configuration but no version is selected\n\nTo make the initial dependency selections that will initialize the dependency lock file, run:\n  terraform init`,\n\t\t\t\tss.ProviderAddr,","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/configs/state_store.go#L155-L191","documentation":"A panic in `StateStore.VerifyDependencySelection` (internal/configs/state_store.go:173) inside the `supplyMode.NotManagedByTerraform()` branch. After confirming the state-store provider is not managed by Terraform, it expects the supply mode to be one of BuiltIn, DevOverride, or Reattached; any other value reaches the default and panics with the provider address, display name, and offending supply mode, again flagged as a Terraform bug. The supply-mode enum is an internal concept representing how a provider binary is sourced.","triggerScenarios":"An internal code path that computes an invalid/zero `getproviders.ProviderSupplyMode` value for a state-store provider and passes it into verification. Not user-controllable through configuration; reachable only via a bug in provider discovery/supply-mode resolution.","commonSituations":"A regression in provider resolution logic (e.g. a new supply mode added to the enum without updating this switch); dev builds with incomplete provider-supply wiring; edge cases with built-in vs reattached providers.","solutions":["Report as a Terraform bug with the provider source, version, and how it was installed (init / dev-override / reattach).","Remove any `provider_installation` dev_overrides or reattach config to see if a clean `terraform init` avoids the bad mode.","Reproduce on the latest stable release to isolate the regression.","Downgrade to the last working Terraform version if blocking."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// Go (internal): resolve supply mode defensively before verifying\nif supplyMode == 0 {\n    return diags // or set a safe default after confirming provider install state\n}\nss.VerifyDependencySelection(depLocks, reqs, supplyMode)","typeGuard":"// Go: whitelist the expected supply modes\nfunc knownSupplyMode(m getproviders.ProviderSupplyMode) bool {\n\tswitch m {\n\tcase getproviders.BuiltIn, getproviders.DevOverride, getproviders.Reattached, getproviders.ManagedByTerraform:\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":"// Go: recover from the supply-mode panic\ndefer func() {\n\tif r := recover(); r != nil {\n\t\tdiags = diags.Append(fmt.Errorf(\"state-store provider supply mode %v is invalid: %v\", supplyMode, r))\n\t}\n}()\nss.VerifyDependencySelection(depLocks, reqs, supplyMode)","preventionTips":["Report as a Terraform bug with provider source and install method.","Remove dev_overrides/reattach to test whether a clean init avoids the bad mode.","Pin provider and Terraform versions together.","Reproduce on the latest stable release."],"tags":["terraform","state-store","provider-state-store","panic","supply-mode","internal-bug"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}