{"record":{"id":"72565528fee45747","repo":"hashicorp/terraform","slug":"error-in-marshaling-deferred-action-invocations","errorCode":null,"errorMessage":"error in marshaling deferred action invocations: %s","messagePattern":"error in marshaling deferred action invocations: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/jsonplan/plan.go","lineNumber":319,"sourceCode":"\t// output.ResourceChanges\n\tif p.Changes != nil {\n\t\toutput.ResourceChanges, err = MarshalResourceChanges(p.Changes.Resources, schemas)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error in marshaling resource changes: %s\", err)\n\t\t}\n\t}\n\n\tif p.DeferredResources != nil {\n\t\toutput.DeferredChanges, err = MarshalDeferredResourceChanges(p.DeferredResources, schemas)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error in marshaling deferred resource changes: %s\", err)\n\t\t}\n\t}\n\n\tif p.DeferredActionInvocations != nil {\n\t\toutput.DeferredActionInvocations, err = MarshalDeferredActionInvocations(p.DeferredActionInvocations, schemas)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error in marshaling deferred action invocations: %s\", err)\n\t\t}\n\t}\n\n\t// output.OutputChanges\n\tif output.OutputChanges, err = MarshalOutputChanges(p.Changes); err != nil {\n\t\treturn nil, fmt.Errorf(\"error in marshaling output changes: %s\", err)\n\t}\n\n\t// output.Checks\n\tif p.Checks != nil && p.Checks.ConfigResults.Len() > 0 {\n\t\toutput.Checks = jsonchecks.MarshalCheckStates(p.Checks)\n\t}\n\n\t// output.PriorState\n\tif sf != nil && !sf.State.Empty() {\n\t\toutput.PriorState, err = jsonstate.Marshal(sf, schemas)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error marshaling prior state: %s\", err)","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/jsonplan/plan.go#L301-L337","documentation":"Top-level propagation error from Marshal: MarshalDeferredActionInvocations failed on p.DeferredActionInvocations. This delegates to the same per-action marshaling logic as non-deferred invocations (errors 602–607).","triggerScenarios":"A deferred action invocation triggers any of the per-action failures: missing schema, decode failure, unsupported trigger type, ephemeral or unsupported marks.","commonSituations":"Deferred actions referencing action types/providers not initialized; version skew between plan and renderer.","solutions":["Read the wrapped error — it is typically one of 602–607 applied to a deferred invocation.","Re-init providers and regenerate the plan.","Align Terraform and provider versions.","Remove deferred action blocks whose providers no longer support them."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := MarshalDeferredActionInvocations(p.DeferredActionInvocations, schemas); err != nil {\n    return err // wrapped error is one of 602–607 for the deferred action\n}","preventionTips":["Initialize all action-type providers before rendering.","Keep ephemeral values out of deferred action config (see 606)."],"tags":["go","terraform","plan","deferred","actions","error-wrapping","jsonplan"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}