{"record":{"id":"f84fe63ee5b504d2","repo":"hashicorp/terraform","slug":"unsupported-action-q","errorCode":null,"errorMessage":"unsupported action %q","messagePattern":"unsupported action %q","errorType":"exception","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/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/builtin/providers/terraform/provider.go#L321-L357","documentation":"The built-in 'terraform' provider's PlanAction method returns this error for every action type because the provider declares an empty Actions map (provider.go:80). The switch statement at provider.go:337-340 has only a default case, meaning no ActionType is ever handled. The provider does not support any actions and this is a deliberate stub.","triggerScenarios":"Calling Provider.PlanAction (provider.go:334-343) with any req.ActionType value. The switch falls through to default immediately. This is reached when Terraform Core attempts to plan an action resource that has been routed to the built-in terraform provider.","commonSituations":"A Terraform configuration references an action type managed by the built-in 'terraform' provider. Using a custom or experimental Terraform build that invokes PlanAction on this provider. Attempting to use an action feature that has not been implemented for the built-in provider.","solutions":["Remove any action references targeting the built-in terraform provider from your configuration.","If developing a Terraform extension, register action types in the Actions map of GetProviderSchema and add cases to the PlanAction switch.","Verify the ActionType string in the request matches a provider that actually supports actions."],"exampleFix":"// Extending the provider:\n// before\nswitch req.ActionType {\ndefault:\n    resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf(\"unsupported action %q\", req.ActionType))\n}\n\n// after\nswitch req.ActionType {\ncase \"my_action\":\n    return planMyAction(req)\ndefault:\n    resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf(\"unsupported action %q\", req.ActionType))\n}","handlingStrategy":"validation","validationCode":"// Before calling PlanAction, check the provider declares this action type\nschema := provider.GetProviderSchema()\nif _, ok := schema.Actions[req.ActionType]; !ok {\n    // This provider does not support the requested action\n    return providers.PlanActionResponse{}\n}","typeGuard":"func isActionSupported(schema providers.GetProviderSchemaResponse, actionType string) bool {\n    _, ok := schema.Actions[actionType]\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Check GetProviderSchema().Actions is non-empty and contains the action type before calling PlanAction.","Do not route action planning to providers that declare an empty Actions map.","In Terraform Core routing, validate action type against the provider schema before dispatching."],"tags":["terraform","actions","builtin-provider","provider-interface","go"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}