{"record":{"id":"f84fe63ee5b504d2","repo":"hashicorp/terraform","slug":"unsupported-action-q","errorCode":null,"errorMessage":"unsupported action %q","messagePattern":"unsupported action %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/builtin/providers/terraform/provider.go","lineNumber":339,"sourceCode":"\nfunc (p *Provider) GetStates(req providers.GetStatesRequest) providers.GetStatesResponse {\n\tvar resp providers.GetStatesResponse\n\tresp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf(\"unsupported state store type %q\", req.TypeName))\n\treturn resp\n}\n\nfunc (p *Provider) DeleteState(req providers.DeleteStateRequest) providers.DeleteStateResponse {\n\tvar resp providers.DeleteStateResponse\n\tresp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf(\"unsupported state store type %q\", req.TypeName))\n\treturn resp\n}\n\nfunc (p *Provider) PlanAction(req providers.PlanActionRequest) providers.PlanActionResponse {\n\tvar resp providers.PlanActionResponse\n\n\tswitch req.ActionType {\n\tdefault:\n\t\tresp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf(\"unsupported action %q\", req.ActionType))\n\t}\n\n\treturn resp\n}\n\nfunc (p *Provider) InvokeAction(req providers.InvokeActionRequest) providers.InvokeActionResponse {\n\tvar resp providers.InvokeActionResponse\n\n\tswitch req.ActionType {\n\tdefault:\n\t\tresp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf(\"unsupported action %q\", req.ActionType))\n\t}\n\n\treturn resp\n}\n\nfunc (p *Provider) ValidateActionConfig(req providers.ValidateActionConfigRequest) providers.ValidateActionConfigResponse {\n\tvar resp providers.ValidateActionConfigResponse","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/builtin/providers/terraform/provider.go#L321-L357","documentation":"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.","triggerScenarios":"Core sends a PlanActionRequest with any ActionType to the builtin 'terraform' provider; the switch falls through to default and appends the error.","commonSituations":"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.","solutions":["Remove the action configuration block from your configuration; the builtin provider does not support actions.","Upgrade or downgrade Terraform Core so the action RPC version matches a provider that actually implements actions.","If writing a provider, implement PlanAction with real cases rather than relying on the builtin."],"exampleFix":"// before\nprovider.PlanAction(req) // unsupported action \"foo\"\n\n// after: only call PlanAction on a provider that registers actions\nif _, ok := provider.(providers.ActionProvider); ok { provider.PlanAction(req) }","handlingStrategy":"validation","validationCode":"// Only call PlanAction if the provider schema advertises action types.\nfunc providerHasActions(p providers.Interface) bool {\n    schema := p.GetProviderSchema()\n    return len(schema.ActionTypes) > 0\n}\nif providerHasActions(provider) {\n    provider.PlanAction(req)\n} else {\n    // skip action planning for this provider\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate action RPCs on GetProviderSchema().ActionTypes being non-empty.","Do not declare action blocks against the terraform builtin provider."],"tags":["terraform","builtin-provider","actions","plan"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T20:17:04.800Z"}