{"record":{"id":"d5203a46111b3165","repo":"hashicorp/terraform","slug":"resource-s-has-an-unsupported-action-reason-s","errorCode":null,"errorMessage":"resource %s has an unsupported action reason %s","messagePattern":"resource (.+?) has an unsupported action reason (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/jsonplan/plan.go","lineNumber":648,"sourceCode":"\t\tr.ActionReason = ResourceInstanceDeleteBecauseNoResourceConfig\n\tcase plans.ResourceInstanceDeleteBecauseWrongRepetition:\n\t\tr.ActionReason = ResourceInstanceDeleteBecauseWrongRepetition\n\tcase plans.ResourceInstanceDeleteBecauseCountIndex:\n\t\tr.ActionReason = ResourceInstanceDeleteBecauseCountIndex\n\tcase plans.ResourceInstanceDeleteBecauseEachKey:\n\t\tr.ActionReason = ResourceInstanceDeleteBecauseEachKey\n\tcase plans.ResourceInstanceDeleteBecauseNoModule:\n\t\tr.ActionReason = ResourceInstanceDeleteBecauseNoModule\n\tcase plans.ResourceInstanceDeleteBecauseNoMoveTarget:\n\t\tr.ActionReason = ResourceInstanceDeleteBecauseNoMoveTarget\n\tcase plans.ResourceInstanceReadBecauseConfigUnknown:\n\t\tr.ActionReason = ResourceInstanceReadBecauseConfigUnknown\n\tcase plans.ResourceInstanceReadBecauseDependencyPending:\n\t\tr.ActionReason = ResourceInstanceReadBecauseDependencyPending\n\tcase plans.ResourceInstanceReadBecauseCheckNested:\n\t\tr.ActionReason = ResourceInstanceReadBecauseCheckNested\n\tdefault:\n\t\treturn r, fmt.Errorf(\"resource %s has an unsupported action reason %s\", r.Address, rc.ActionReason)\n\t}\n\n\treturn r, nil\n}\n\n// MarshalDeferredResourceChanges converts the provided internal representation\n// of DeferredResourceInstanceChangeSrc objects into the public structured JSON\n// changes.\n// This is public to make testing easier.\nfunc MarshalDeferredResourceChanges(resources []*plans.DeferredResourceInstanceChangeSrc, schemas *terraform.Schemas) ([]DeferredResourceChange, error) {\n\tvar ret []DeferredResourceChange\n\n\tvar sortedResources []*plans.DeferredResourceInstanceChangeSrc\n\tsortedResources = append(sortedResources, resources...)\n\tsort.Slice(sortedResources, func(i, j int) bool {\n\t\tif !sortedResources[i].ChangeSrc.Addr.Equal(sortedResources[j].ChangeSrc.Addr) {\n\t\t\treturn sortedResources[i].ChangeSrc.Addr.Less(sortedResources[j].ChangeSrc.Addr)\n\t\t}","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/jsonplan/plan.go#L630-L666","documentation":"marshalResourceChange switches on rc.ActionReason, enumerating the known ResourceInstanceChangeReason values (replace/delete/read reasons). A reason value outside that set hits the default. This happens when the plan carries an action reason the renderer's switch does not cover.","triggerScenarios":"The plan was produced by a newer plans package that introduced a new ResourceInstanceChangeReason value not present in this binary's switch at plan.go:618. Reached during resource-change marshaling.","commonSituations":"Rendering a plan created by a newer Terraform version with an older binary that does not know the new reason; a fork adding a reason without updating jsonplan.","solutions":["Use a Terraform binary whose version matches or exceeds the one that created the plan.","Report the unhandled action reason value (printed via %s) as a bug.","Regenerate the plan with the rendering binary so the reason set matches."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Reject unrecognized action reasons before marshaling so the failure is\n// attributed to version skew up front.\nknownReasons := map[plans.ResourceInstanceChangeReason]bool{\n    plans.ResourceInstanceChangeNoReason: true,\n    plans.ResourceInstanceReplaceBecauseCannotUpdate: true,\n    plans.ResourceInstanceReplaceBecauseTainted: true,\n    plans.ResourceInstanceReplaceByRequest: true,\n    plans.ResourceInstanceReplaceByTriggers: true,\n    plans.ResourceInstanceDeleteBecauseNoResourceConfig: true,\n    plans.ResourceInstanceDeleteBecauseWrongRepetition: true,\n    plans.ResourceInstanceDeleteBecauseCountIndex: true,\n    plans.ResourceInstanceDeleteBecauseEachKey: true,\n    plans.ResourceInstanceDeleteBecauseNoModule: true,\n    plans.ResourceInstanceDeleteBecauseNoMoveTarget: true,\n    plans.ResourceInstanceReadBecauseConfigUnknown: true,\n    plans.ResourceInstanceReadBecauseDependencyPending: true,\n    plans.ResourceInstanceReadBecauseCheckNested: true,\n}\nfor _, rc := range plan.Changes.Resources {\n    if !knownReasons[rc.ActionReason] {\n        return fmt.Errorf(\"unsupported action reason %v for %s; version skew?\", rc.ActionReason, rc.Addr)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Render plans with a Terraform version equal to or newer than the one that created them.","Regenerate plans after a Terraform upgrade instead of reusing old artifacts.","Report any unhandled action reason value as a bug."],"tags":["action-reason","internal","version"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}