hashicorp/terraform · error

unsupported action %q

Error message

unsupported action %q

What it means

Returned by Provider.PlanAction at provider.go:339. The switch over req.ActionType contains only a default case, so ANY action type submitted for planning is rejected. The builtin provider has registered zero action types, so the PlanAction RPC is effectively unsupported.

Source

Thrown at internal/builtin/providers/terraform/provider.go:339

func (p *Provider) GetStates(req providers.GetStatesRequest) providers.GetStatesResponse {
	var resp providers.GetStatesResponse
	resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported state store type %q", req.TypeName))
	return resp
}

func (p *Provider) DeleteState(req providers.DeleteStateRequest) providers.DeleteStateResponse {
	var resp providers.DeleteStateResponse
	resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported state store type %q", req.TypeName))
	return resp
}

func (p *Provider) PlanAction(req providers.PlanActionRequest) providers.PlanActionResponse {
	var resp providers.PlanActionResponse

	switch req.ActionType {
	default:
		resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported action %q", req.ActionType))
	}

	return resp
}

func (p *Provider) InvokeAction(req providers.InvokeActionRequest) providers.InvokeActionResponse {
	var resp providers.InvokeActionResponse

	switch req.ActionType {
	default:
		resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported action %q", req.ActionType))
	}

	return resp
}

func (p *Provider) ValidateActionConfig(req providers.ValidateActionConfigRequest) providers.ValidateActionConfigResponse {
	var resp providers.ValidateActionConfigResponse

View on GitHub (pinned to c9def3e214)

Solutions

  1. Remove the action configuration block from your configuration; the builtin provider does not support actions.
  2. Upgrade or downgrade Terraform Core so the action RPC version matches a provider that actually implements actions.
  3. If writing a provider, implement PlanAction with real cases rather than relying on the builtin.

Example fix

// before
provider.PlanAction(req) // unsupported action "foo"

// after: only call PlanAction on a provider that registers actions
if _, ok := provider.(providers.ActionProvider); ok { provider.PlanAction(req) }
Defensive patterns

Strategy: validation

Validate before calling

// Only call PlanAction if the provider schema advertises action types.
func providerHasActions(p providers.Interface) bool {
    schema := p.GetProviderSchema()
    return len(schema.ActionTypes) > 0
}
if providerHasActions(provider) {
    provider.PlanAction(req)
} else {
    // skip action planning for this provider
}

Prevention

When it happens

Trigger: Core sends a PlanActionRequest with any ActionType to the builtin 'terraform' provider; the switch falls through to default and appends the error.

Common situations: A provider schema or Terraform Core build that expects the builtin provider to advertise ephemeral/action resources; a misconfigured action block referencing the terraform builtin; forward-compatibility code that runs against an older builtin provider.

Related errors


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