hashicorp/terraform · critical

State store provider %q (%s) has unknown supply mode %q. Thi

Error message

State store provider %q (%s) has unknown supply mode %q. This is a bug in Terraform and should be reported.

What it means

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.

Source

Thrown at internal/configs/state_store.go:173

		panic("This run has no dependency lock information provided at all. This is a bug in Terraform and should be reported.")
	}
	if reqs == nil {
		panic("This run has no required providers information provided at all. This is a bug in Terraform and should be reported.")
	}

	if supplyMode.NotManagedByTerraform() {
		// If the provider is not managed by Terraform then it's not lockable.
		// If the working directory was initialized in the same way then the PSS provider will not be reflected in the lock file.
		// Skip them.
		switch supplyMode {
		case getproviders.BuiltIn:
			log.Printf("[DEBUG] StateStore.VerifyDependencySelection: skipping %s because it's a built-in provider", ss.ProviderAddr)
		case getproviders.DevOverride:
			log.Printf("[DEBUG] StateStore.VerifyDependencySelection: skipping %s because it's supplied via developer overrides", ss.ProviderAddr)
		case getproviders.Reattached:
			log.Printf("[DEBUG] StateStore.VerifyDependencySelection: skipping %s because it's re-attached and not managed by Terraform", ss.ProviderAddr)
		default:
			panic(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))
		}
		return diags
	}

	// From this point on the provider currently in use is managed by Terraform
	//
	// When the PSS provider is managed, Terraform needs the state storage provider to be present in the lock file,
	// and the lock file should not be empty or missing.
	if depLocks.Empty() {
		diags = diags.Append(tfdiags.Sourceless(
			tfdiags.Error,
			"Inconsistent dependency lock file",
			fmt.Sprintf(`The provider dependency used for state storage is missing from the lock file despite being present in the current configuration:
  - provider %s: required by this configuration but no version is selected

To make the initial dependency selections that will initialize the dependency lock file, run:
  terraform init`,
				ss.ProviderAddr,

View on GitHub (pinned to c9def3e214)

Solutions

  1. Report as a Terraform bug with the provider source, version, and how it was installed (init / dev-override / reattach).
  2. Remove any `provider_installation` dev_overrides or reattach config to see if a clean `terraform init` avoids the bad mode.
  3. Reproduce on the latest stable release to isolate the regression.
  4. Downgrade to the last working Terraform version if blocking.

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

// Go (internal): resolve supply mode defensively before verifying
if supplyMode == 0 {
    return diags // or set a safe default after confirming provider install state
}
ss.VerifyDependencySelection(depLocks, reqs, supplyMode)

Type guard

// Go: whitelist the expected supply modes
func knownSupplyMode(m getproviders.ProviderSupplyMode) bool {
	switch m {
	case getproviders.BuiltIn, getproviders.DevOverride, getproviders.Reattached, getproviders.ManagedByTerraform:
		return true
	}
	return false
}

Try / catch

// Go: recover from the supply-mode panic
defer func() {
	if r := recover(); r != nil {
		diags = diags.Append(fmt.Errorf("state-store provider supply mode %v is invalid: %v", supplyMode, r))
	}
}()
ss.VerifyDependencySelection(depLocks, reqs, supplyMode)

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hashicorp/terraform@c9def3e214 (2026-08-07). Data as JSON: /api/errors/7fae7ba4cc4cbe8e. Report an issue: GitHub.