{"record":{"id":"9786bc0b7f5d9efa","repo":"helm/helm","slug":"error-merging-s-w","errorCode":null,"errorMessage":"error merging %s: %w","messagePattern":"error merging (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/action/action.go","lineNumber":411,"sourceCode":"\t\t\tfor _, group := range groups {\n\t\t\t\tif len(group.files) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif !group.postRender {\n\t\t\t\t\tfor k, v := range group.files {\n\t\t\t\t\t\tif existing, ok := files[k]; ok {\n\t\t\t\t\t\t\tfiles[k] = existing + \"\\n---\\n\" + v\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfiles[k] = v\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tmerged, err := annotateAndMerge(group.files)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn hs, b, notes, fmt.Errorf(\"error merging %s: %w\", group.name, err)\n\t\t\t\t}\n\n\t\t\t\tpostRendered, err := pr.Run(bytes.NewBufferString(merged))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn hs, b, notes, fmt.Errorf(\"error while running post render on %s: %w\", group.name, err)\n\t\t\t\t}\n\n\t\t\t\trendered, err := splitAndDeannotate(postRendered.String(), group.name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn hs, b, notes, fmt.Errorf(\"error while parsing post rendered output for %s: %w\", group.name, err)\n\t\t\t\t}\n\n\t\t\t\tfor k, v := range rendered {\n\t\t\t\t\tif existing, ok := files[k]; ok {\n\t\t\t\t\t\tfiles[k] = existing + \"\\n---\\n\" + v\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfiles[k] = v\n\t\t\t\t\t}","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/action/action.go#L393-L429","documentation":"With PostRenderStrategySeparate, Helm runs the post-renderer once per group of rendered files (per chart/subchart group) instead of one combined stream. For each group it first calls annotateAndMerge on that group's files; this error wraps that merge failure for the named group. The underlying cause is one of the merge-stage failures (parse, annotate, or write) inside a single group's files.","triggerScenarios":"An install/upgrade/template with postRenderStrategy = PostRenderStrategySeparate where a rendered file inside the named group produces invalid YAML or a non-annotatable document: malformed templates, bad indentation, or scalar documents in the group.","commonSituations":"Switching from the combined strategy to separate to give each subchart its own post-render pass, which then surfaces an invalid template in one subchart; subchart dependencies (including third-party ones) rendering YAML that strict parsing rejects.","solutions":["Render the named group's chart alone to isolate the bad file: helm template ./charts/<group>","Validate each rendered document with a strict YAML parser or yamllint and fix the failing template","Rename non-manifest helper files in templates/ with a _ prefix so they are skipped","Temporarily switch to the combined strategy to confirm the failure is file content, not strategy wiring"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// pre-validate each chart/subchart that will be post-rendered separately\nfor _, sub := range append([]*chart.Chart{root}, root.Dependencies()...) {\n\tout, err := renderSubchart(sub)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := kio.ParseAll(out); err != nil {\n\t\treturn fmt.Errorf(\"subchart %s output fails strict parse: %w\", sub.Name(), err)\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"error merging\") {\n\t// the named group identifies which chart/subchart failed; render it alone to isolate the file\n}","preventionTips":["Run helm template per subchart in CI when using the separate strategy","Apply the same strict YAML linting to dependencies as to the parent chart","Fix or pin third-party subcharts that emit invalid YAML"],"tags":["yaml","post-render","strategy","subcharts"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}