{"record":{"id":"c799148e68955aa0","repo":"hashicorp/terraform","slug":"action-schema-not-found-for-action-q-c79914","errorCode":null,"errorMessage":"action schema not found for action %q","messagePattern":"action schema not found for action %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/grpcwrap/provider6.go","lineNumber":1183,"sourceCode":"func (p *provider6) DeleteState(ctx context.Context, req *tfplugin6.DeleteState_Request) (*tfplugin6.DeleteState_Response, error) {\n\tdeleteStatesResp := p.provider.DeleteState(providers.DeleteStateRequest{\n\t\tTypeName: req.TypeName,\n\t\tStateId:  req.StateId,\n\t})\n\n\tresp := &tfplugin6.DeleteState_Response{\n\t\tDiagnostics: convert.AppendProtoDiag([]*tfplugin6.Diagnostic{}, deleteStatesResp.Diagnostics),\n\t}\n\n\treturn resp, nil\n}\n\nfunc (p *provider6) PlanAction(_ context.Context, req *tfplugin6.PlanAction_Request) (*tfplugin6.PlanAction_Response, error) {\n\tresp := &tfplugin6.PlanAction_Response{}\n\n\tactionSchema, ok := p.schema.Actions[req.ActionType]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"action schema not found for action %q\", req.ActionType)\n\t}\n\n\tty := actionSchema.ConfigSchema.ImpliedType()\n\tconfigVal, err := decodeDynamicValue6(req.Config, ty)\n\tif err != nil {\n\t\tresp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err)\n\t\treturn resp, nil\n\t}\n\n\tplanResp := p.provider.PlanAction(providers.PlanActionRequest{\n\t\tActionType:         req.ActionType,\n\t\tProposedActionData: configVal,\n\t\tClientCapabilities: providers.ClientCapabilities{\n\t\t\tDeferralAllowed:            true,\n\t\t\tWriteOnlyAttributesAllowed: true,\n\t\t\tComputedBlocksAllowed:      true,\n\t\t},\n\t})","sourceCodeStart":1165,"sourceCodeEnd":1201,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/grpcwrap/provider6.go#L1165-L1201","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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).","Upgrade the provider to a version that implements the requested action (terraform init -upgrade).","If writing a provider, ensure GetProviderSchema returns the action under the exact same ActionType key used in PlanAction requests.","Clear the plugin/protocol schema cache (terraform providers schema -json) and re-init to rule out a stale schema."],"exampleFix":"// before: config references an action the provider does not expose\nmove action \"myprovider_foo\" \"bar\" { ... }\n\n// after: align with an action the provider actually declares (or upgrade provider)\nmove action \"myprovider_known\" \"bar\" { ... }","handlingStrategy":"validation","validationCode":"// Before calling PlanAction, ensure the action type is declared.\nschemas := provider.GetProviderSchema()\nif _, ok := schemas.Actions[req.ActionType]; !ok {\n    return fmt.Errorf(\"provider does not implement action %q\", req.ActionType)\n}\nresp, err := provider.PlanAction(providers.PlanActionRequest{ActionType: req.ActionType, ...})","typeGuard":"// Narrow to a known action set.\nfunc isKnownAction(s *schemas, t string) bool {\n    _, ok := s.Actions[t]\n    return ok\n}","tryCatchPattern":"resp, err := p.provider.PlanAction(req)\nif err != nil && strings.Contains(err.Error(), \"action schema not found\") {\n    // log and surface a friendlier message to the end user\n}\n","preventionTips":["Always cross-reference the action type with GetProviderSchema().Actions before issuing PlanAction.","Pin provider versions whose action set you have validated.","In provider code, keep the schema map and the dispatcher keyed by the same constants."],"tags":["terraform","provider-plugin","grpc","action-schema","schema-mismatch"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}