hashicorp/terraform · error

State store provider %q (%s) was not approved, so init canno

Error message

State store provider %q (%s) was not approved, so init cannot continue.

What it means

In Meta.promptStateStorageProviderApproval (meta_backend.go:3239), the approval prompt was answered but the response was not exactly 'yes'. Because state-storage providers hold your state, Terraform requires explicit confirmation; anything other than 'yes' aborts init. This is an intentional user-decline, not a system error.

Source

Thrown at internal/command/meta_backend.go:3239

Hashes:
%s
`,
			lock.Provider().Type,
			lock.Provider(),
			lock.Version(),
			getproviders.CurrentPlatform.String(),
			authentication,
			hashList.String(),
		),
		Description: fmt.Sprintf(`Check the details above for provider %q and confirm that you trust the provider.
	Only 'yes' will be accepted to confirm.`, lock.Provider().Type),
	})
	if err != nil {
		return diags.Append(fmt.Errorf("Failed to approve use of state storage provider: %s", err))
	}
	if v != "yes" {
		return diags.Append(
			fmt.Errorf("State store provider %q (%s) was not approved, so init cannot continue.",
				lock.Provider().Type,
				lock.Provider(),
			),
		)
	}
	return diags
}

//-------------------------------------------------------------------
// Output constants and initialization code
//-------------------------------------------------------------------

const inputCloudInitCreateWorkspace = `
There are no workspaces with the configured tags (%s)
in your HCP Terraform organization. To finish initializing, Terraform needs at
least one workspace available.

Terraform can create a properly tagged workspace for you now. Please enter a

View on GitHub (pinned to c9def3e214)

Solutions

  1. Re-run init and type exactly 'yes' if you intend to approve the provider after verifying its version/hashes.
  2. Verify the provider type, version, platform, authentication, and hashes shown in the prompt are what you expect before approving.
  3. If you do not trust this provider, change your state_store block to a trusted provider instead.
  4. Ensure any automation that feeds input sends the literal string 'yes' (case-sensitive) or pre-approve via the lock file.

Example fix

// before: prompt answered 'y'  -> 'State store provider ... was not approved, so init cannot continue.'
// after: re-run and answer exactly: yes
Defensive patterns

Strategy: validation

Validate before calling

// If automating, ensure the approval input is exactly 'yes' or pre-approve via lock file.
func approvalInputValid(v string) bool { return v == "yes" }

Prevention

When it happens

Trigger: The user typed anything other than 'yes' (including 'y', 'Y', 'yes ', blank, or a typo) at the 'Do you want to use provider ... for managing state?' prompt; pressing Enter/Escape; input being auto-fed a non-'yes' value in automation.

Common situations: A cautious operator declining an untrusted provider; automation accidentally sending 'y' or a newline; a misconfigured wrapper auto-answering prompts incorrectly.

Related errors


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