{"record":{"id":"0a80e05e36b747b4","repo":"hashicorp/terraform","slug":"error-marshaling-action-invocations-s","errorCode":null,"errorMessage":"error marshaling action invocations: %s","messagePattern":"error marshaling action invocations: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/jsonplan/plan.go","lineNumber":350,"sourceCode":"\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 {\n\t\treturn nil, fmt.Errorf(\"error marshaling config: %s\", err)\n\t}\n\n\t// output.Changes.ActionInvocations\n\tif p.Changes.ActionInvocations != nil {\n\t\tif output.ActionInvocations, err = MarshalActionInvocations(p.Changes.ActionInvocations, schemas); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error marshaling action invocations: %s\", err)\n\t\t}\n\t}\n\n\treturn json.Marshal(output)\n}\n\nfunc (p *plan) marshalPlanVariables(vars map[string]plans.DynamicValue, decls map[string]*configs.Variable) error {\n\tp.Variables = make(variables, len(vars))\n\n\tfor k, v := range vars {\n\t\tval, err := v.Decode(cty.DynamicPseudoType)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvalJSON, err := ctyjson.Marshal(val, val.Type())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/jsonplan/plan.go#L332-L368","documentation":"Top-level wrapper: MarshalActionInvocations(p.Changes.ActionInvocations, schemas) failed. Each invocation is marshaled individually, so the inner error is one of 600-603 (decode failure, unsupported trigger type, ephemeral config, or unsupported marks).","triggerScenarios":"p.Changes.ActionInvocations != nil and at least one invocation fails to marshal. Reached on every full Marshal call that includes planned actions.","commonSituations":"An action config containing ephemeral values (602); action schema mismatch between plan and render (600); version skew introducing new marks (603) or trigger types (601).","solutions":["Inspect the inner error (600-603) to find the failing action address.","Fix the action config (remove ephemeral/unsupported references).","Regenerate the plan with matching Terraform and provider versions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"invocations, err := jsonplan.MarshalActionInvocations(plan.Changes.ActionInvocations, schemas)\nif err != nil {\n    // inner error (600-603) names the failing action; surface it\n    return fmt.Errorf(\"marshal action invocations: %w\", err)\n}","preventionTips":["Keep ephemeral values out of action config blocks.","Match provider versions so action schemas are stable between plan and render.","Regenerate plans after provider/Terraform upgrades."],"tags":["actions","marshal"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}