{"record":{"id":"11d2406784eaadef","repo":"helm/helm","slug":"cannot-load-chart-yaml-w-11d240","errorCode":null,"errorMessage":"cannot load Chart.yaml: %w","messagePattern":"cannot load Chart\\.yaml: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/chart/loader/load.go","lineNumber":92,"sourceCode":"\treturn LoadDir(string(l))\n}\n\nfunc LoadDir(dir string) (chart.Charter, error) {\n\ttopdir, err := filepath.Abs(dir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tname := filepath.Join(topdir, \"Chart.yaml\")\n\tdata, err := os.ReadFile(name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to detect chart at %s: %w\", name, err)\n\t}\n\n\tc := new(chartBase)\n\terr = yaml.Unmarshal(data, c)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot load Chart.yaml: %w\", err)\n\t}\n\n\tswitch c.APIVersion {\n\tcase c2.APIVersionV1, c2.APIVersionV2, \"\":\n\t\treturn c2load.Load(dir)\n\tcase c3.APIVersionV3:\n\t\treturn c3load.Load(dir)\n\tdefault:\n\t\treturn nil, errors.New(\"unsupported chart version\")\n\t}\n}\n\n// FileLoader loads a chart from a file\ntype FileLoader string\n\n// Load loads a chart\nfunc (l FileLoader) Load() (chart.Charter, error) {\n\treturn LoadFile(string(l))","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/chart/loader/load.go#L74-L110","documentation":"Thrown by LoadDir when Chart.yaml exists but cannot be unmarshalled: sigs.k8s.io/yaml (YAML→JSON→struct) rejects its content. Typical causes are YAML syntax errors (tabs for indentation, bad colons, unclosed quotes) or duplicate keys, but it also fires on structurally wrong content such as a YAML list at the top level. The wrapped error pinpoints the parse location.","triggerScenarios":"loader.Load/LoadDir on a chart whose Chart.yaml contains tab characters, duplicated keys (e.g. 'name:' twice), an unterminated string, or content that is not a mapping; also Chart.yaml with invalid types for known fields. Detected during the apiVersion sniffing step before the v2/v3 loader runs.","commonSituations":"Hand-editing Chart.yaml with editors inserting tabs; merge conflicts resolved badly leaving conflict markers; copy-paste from rendered docs mangling indentation; linters absent in the chart workflow.","solutions":["Run the wrapped error's line/column down and fix the YAML: check for tabs, duplicate keys, unquoted special characters","Validate syntax: yamllint Chart.yaml or helm lint ./chart","If a merge conflict left markers (<<<<<<<), resolve it fully and remove them","Quote strings containing colons or # (e.g. description: 'Key: value')"],"exampleFix":"# before: Chart.yaml with a tab and duplicate key\nname:\tmychart\nversion: 0.1.0\nname: other\n\n# after: clean Chart.yaml\nname: mychart\nversion: 0.1.0","handlingStrategy":"validation","validationCode":"// Parse Chart.yaml up front for a precise error before chart operations\nfunc chartYamlValid(dir string) error {\n    data, err := os.ReadFile(filepath.Join(dir, \"Chart.yaml\"))\n    if err != nil { return err }\n    var m map[string]any\n    if err := sigsyaml.Unmarshal(data, &m); err != nil {\n        return fmt.Errorf(\"Chart.yaml invalid: %w\", err)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"chrt, err := loader.Load(dir)\nif err != nil {\n    if strings.Contains(err.Error(), \"cannot load Chart.yaml\") {\n        // the wrapped error carries line/column; fix tabs, duplicate keys, quoting\n    }\n}","preventionTips":["Run yamllint or helm lint on every Chart.yaml change","Configure editors to use spaces (never tabs) for YAML","Resolve git merge conflicts fully before packaging charts","Quote values containing colons or hashes in Chart.yaml"],"tags":["yaml","chart-yaml","charts","loader"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}