{"record":{"id":"d4f5e7c6b3c5743c","repo":"hashicorp/terraform","slug":"error-in-marshalplannedvalues-s","errorCode":null,"errorMessage":"error in marshalPlannedValues: %s","messagePattern":"error in marshalPlannedValues: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/jsonplan/plan.go","lineNumber":272,"sourceCode":"\tsf *statefile.File,\n\tschemas *terraform.Schemas,\n) ([]byte, error) {\n\toutput := newPlan()\n\toutput.TerraformVersion = version.String()\n\toutput.Timestamp = p.Timestamp.Format(time.RFC3339)\n\toutput.Applyable = p.Applyable\n\toutput.Complete = p.Complete\n\toutput.Errored = p.Errored\n\n\terr := output.marshalPlanVariables(p.VariableValues, config.Module.Variables)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error in marshalPlanVariables: %s\", err)\n\t}\n\n\t// output.PlannedValues\n\terr = output.marshalPlannedValues(p.Changes, schemas)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error in marshalPlannedValues: %s\", err)\n\t}\n\n\t// output.ResourceDrift\n\tif len(p.DriftedResources) > 0 {\n\t\t// In refresh-only mode, we render all resources marked as drifted,\n\t\t// including those which have moved without other changes. In other plan\n\t\t// modes, move-only changes will be included in the planned changes, so\n\t\t// we skip them here.\n\t\tvar driftedResources []*plans.ResourceInstanceChangeSrc\n\t\tif p.UIMode == plans.RefreshOnlyMode {\n\t\t\tdriftedResources = p.DriftedResources\n\t\t} else {\n\t\t\tfor _, dr := range p.DriftedResources {\n\t\t\t\tif dr.Action != plans.NoOp {\n\t\t\t\t\tdriftedResources = append(driftedResources, dr)\n\t\t\t\t}\n\t\t\t}\n\t\t}","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/jsonplan/plan.go#L254-L290","documentation":"Top-level propagation error from Marshal: marshalPlannedValues failed while rendering the planned resource and output values. The wrapped error names the sub-component (resource schema, decode, or value marshal) that failed.","triggerScenarios":"A planned resource cannot be decoded against the current provider schema (missing/stale schema), or a value cannot be marshaled to JSON due to type/marks issues.","commonSituations":"Provider schema changed after planning; cross-version rendering; resources referencing types no longer present in the provider.","solutions":["Read the wrapped error to locate the failing resource or output.","Re-run `terraform init` and `terraform plan` so planned values align with current schemas.","Verify provider versions are consistent between plan creation and rendering.","Check for missing resource type schemas (see error 619)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := output.marshalPlannedValues(p.Changes, schemas); err != nil {\n    return nil, fmt.Errorf(\"planned values render failed (likely schema/decode): %%w\", err)\n}","preventionTips":["Initialize all providers before rendering.","Use matching Terraform/provider versions for plan creation and rendering.","Regenerate plans after provider schema changes."],"tags":["go","terraform","plan","planned-values","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"}