{"record":{"id":"bee2c5fdad8c541c","repo":"hashicorp/terraform","slug":"error-in-marshaling-output-changes-s","errorCode":null,"errorMessage":"error in marshaling output changes: %s","messagePattern":"error in marshaling output changes: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/jsonplan/plan.go","lineNumber":325,"sourceCode":"\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)\n\t\t}\n\t}\n\n\t// output.Config\n\toutput.Config, err = jsonconfig.Marshal(config, schemas)\n\tif err != nil {","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/jsonplan/plan.go#L307-L343","documentation":"Top-level propagation error from Marshal: MarshalOutputChanges failed while rendering the planned changes to output values. The wrapped error names the failing output.","triggerScenarios":"An output change cannot be decoded or marshaled — typically because the output value's type drifted, or it carries marks/unknowns the renderer cannot serialize.","commonSituations":"Output type changed in config after planning; cross-version plan rendering; outputs derived from resources whose schemas changed.","solutions":["Read the wrapped error for the specific output name.","Regenerate the plan with the current config so output types match.","Ensure consistent Terraform/provider versions between plan and render.","Check recently edited outputs in the configuration."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := MarshalOutputChanges(p.Changes); err != nil {\n    return fmt.Errorf(\"output changes render failed: %%w\", err)\n}","preventionTips":["Re-plan after changing output types or expressions.","Use consistent versions to avoid output type drift."],"tags":["go","terraform","plan","outputs","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"}