hashicorp/terraform · error

action schema not found for action %q

Error message

action schema not found for action %q

What it means

Thrown by the gRPC plugin wrapper (protocol v6) when Terraform Core sends a PlanAction RPC whose req.ActionType is not present in the provider's advertised action schema map (p.schema.Actions). It means the provider does not declare an action of the type the plan referenced. This is a contract mismatch between what the config/plan requested and what the provider binary actually exposes.

Source

Thrown at internal/grpcwrap/provider6.go:1183

func (p *provider6) DeleteState(ctx context.Context, req *tfplugin6.DeleteState_Request) (*tfplugin6.DeleteState_Response, error) {
	deleteStatesResp := p.provider.DeleteState(providers.DeleteStateRequest{
		TypeName: req.TypeName,
		StateId:  req.StateId,
	})

	resp := &tfplugin6.DeleteState_Response{
		Diagnostics: convert.AppendProtoDiag([]*tfplugin6.Diagnostic{}, deleteStatesResp.Diagnostics),
	}

	return resp, nil
}

func (p *provider6) PlanAction(_ context.Context, req *tfplugin6.PlanAction_Request) (*tfplugin6.PlanAction_Response, error) {
	resp := &tfplugin6.PlanAction_Response{}

	actionSchema, ok := p.schema.Actions[req.ActionType]
	if !ok {
		return nil, fmt.Errorf("action schema not found for action %q", req.ActionType)
	}

	ty := actionSchema.ConfigSchema.ImpliedType()
	configVal, err := decodeDynamicValue6(req.Config, ty)
	if err != nil {
		resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err)
		return resp, nil
	}

	planResp := p.provider.PlanAction(providers.PlanActionRequest{
		ActionType:         req.ActionType,
		ProposedActionData: configVal,
		ClientCapabilities: providers.ClientCapabilities{
			DeferralAllowed:            true,
			WriteOnlyAttributesAllowed: true,
			ComputedBlocksAllowed:      true,
		},
	})

View on GitHub (pinned to d32a084675)

Solutions

  1. Verify the action type string in the configuration matches an action declared by the provider (check the provider's docs and CHANGELOG for the action name).
  2. Upgrade the provider to a version that implements the requested action (terraform init -upgrade).
  3. If writing a provider, ensure GetProviderSchema returns the action under the exact same ActionType key used in PlanAction requests.
  4. Clear the plugin/protocol schema cache (terraform providers schema -json) and re-init to rule out a stale schema.

Example fix

// before: config references an action the provider does not expose
move action "myprovider_foo" "bar" { ... }

// after: align with an action the provider actually declares (or upgrade provider)
move action "myprovider_known" "bar" { ... }
Defensive patterns

Strategy: validation

Validate before calling

// Before calling PlanAction, ensure the action type is declared.
schemas := provider.GetProviderSchema()
if _, ok := schemas.Actions[req.ActionType]; !ok {
    return fmt.Errorf("provider does not implement action %q", req.ActionType)
}
resp, err := provider.PlanAction(providers.PlanActionRequest{ActionType: req.ActionType, ...})

Type guard

// Narrow to a known action set.
func isKnownAction(s *schemas, t string) bool {
    _, ok := s.Actions[t]
    return ok
}

Try / catch

resp, err := p.provider.PlanAction(req)
if err != nil && strings.Contains(err.Error(), "action schema not found") {
    // log and surface a friendlier message to the end user
}

Prevention

When it happens

Trigger: Calling providers.PlanAction through the v6 plugin with an ActionType string that has no matching key in p.schema.Actions; e.g. an action referenced in config that the installed provider version does not implement, or a typo'd action type name.

Common situations: Provider version downgrade (action added in a newer version), pinned provider missing a recently-added action, hand-written/monkey-patched action types in custom providers, or stale schema cache after a provider upgrade where the action was renamed.

Related errors


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