{"record":{"id":"c799148e68955aa0","repo":"hashicorp/terraform","slug":"action-schema-not-found-for-action-q","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/c9def3e214014c1188faabfc4a5bde5095139765/internal/grpcwrap/provider6.go#L1165-L1201","documentation":"Returned by PlanAction (internal/grpcwrap/provider6.go:1183) when req.ActionType is not a key in p.schema.Actions (the action schemas advertised by the provider's GetProviderSchema). The handler needs actionSchema.ConfigSchema.ImpliedType() to decode the action config, so an unknown action type aborts planning immediately.","triggerScenarios":"Terraform core sends a PlanAction RPC for an action type the provider did not register in GetProviderSchema.Actions; the map lookup p.schema.Actions[req.ActionType] returns ok==false.","commonSituations":"Provider version mismatch (core references an action type the older/newer provider doesn't expose), typo in an action reference, experimental action removed between provider releases, or a test provider missing the action schema.","solutions":["Install/upgrade a provider version that declares the action type in GetProviderSchema.Actions.","Verify the action type spelling and that it matches the provider's documented actions.","Re-run terraform init to reconcile provider version with config.","If authoring the provider, ensure GetProviderSchema returns the action in the Actions map."],"exampleFix":"// before\n// provider's GetProviderSchema omits Actions[\"restart\"]\nreq.ActionType = \"restart\"  // -> action schema not found for action \"restart\"\n\n// after\nschema.Actions[\"restart\"] = &providers.ActionSchema{ConfigSchema: ...}","handlingStrategy":"validation","validationCode":"func actionAdvertised(s providers.GetProviderSchemaResponse, action string) bool {\n    _, ok := s.Actions[action]\n    return ok\n}","typeGuard":"func advertisedActions(s providers.GetProviderSchemaResponse) []string {\n    out := make([]string, 0, len(s.Actions))\n    for k := range s.Actions { out = append(out, k) }\n    return out\n}","tryCatchPattern":"if _, err := server.PlanAction(ctx, req); err != nil {\n    if strings.Contains(err.Error(), \"action schema not found\") {\n        // upgrade provider or remove the action reference\n    }\n}","preventionTips":["Declare action types in GetProviderSchema.Actions.","Match action type spelling exactly against the provider schema.","Re-run terraform init after provider version changes.","Validate action references against the advertised schema before plan."],"tags":["grpc","provider","action","schema","terraform-core"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T20:17:04.800Z"}