{"record":{"id":"bb470a2cb59fec2a","repo":"helm/helm","slug":"cannot-load-chart-yaml-w","errorCode":null,"errorMessage":"cannot load Chart.yaml: %w","messagePattern":"cannot load Chart\\.yaml: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/chart/v3/loader/load.go","lineNumber":86,"sourceCode":"\treturn l.Load()\n}\n\n// LoadFiles loads from in-memory files.\nfunc LoadFiles(files []*archive.BufferedFile) (*chart.Chart, error) {\n\tc := new(chart.Chart)\n\tsubcharts := make(map[string][]*archive.BufferedFile)\n\tvar subChartsKeys []string\n\n\t// do not rely on assumed ordering of files in the chart and crash\n\t// if Chart.yaml was not coming early enough to initialize metadata\n\tfor _, f := range files {\n\t\tc.Raw = append(c.Raw, &common.File{Name: f.Name, ModTime: f.ModTime, Data: f.Data})\n\t\tif f.Name == \"Chart.yaml\" {\n\t\t\tif c.Metadata == nil {\n\t\t\t\tc.Metadata = new(chart.Metadata)\n\t\t\t}\n\t\t\tif err := yaml.Unmarshal(f.Data, c.Metadata); err != nil {\n\t\t\t\treturn c, fmt.Errorf(\"cannot load Chart.yaml: %w\", err)\n\t\t\t}\n\t\t\t// While the documentation says the APIVersion is required, in practice there\n\t\t\t// are cases where that's not enforced. Since this package set is for v3 charts,\n\t\t\t// when this function is used v3 is automatically added when not present.\n\t\t\tif c.Metadata.APIVersion == \"\" {\n\t\t\t\tc.Metadata.APIVersion = chart.APIVersionV3\n\t\t\t}\n\t\t\tc.ModTime = f.ModTime\n\t\t}\n\t}\n\tfor _, f := range files {\n\t\tswitch {\n\t\tcase f.Name == \"Chart.yaml\":\n\t\t\t// already processed\n\t\t\tcontinue\n\t\tcase f.Name == \"Chart.lock\":\n\t\t\tc.Lock = new(chart.Lock)\n\t\t\tif err := yaml.Unmarshal(f.Data, &c.Lock); err != nil {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/internal/chart/v3/loader/load.go#L68-L104","documentation":"Thrown by LoadFiles (internal/chart/v3/loader/load.go) when yaml.Unmarshal of the Chart.yaml bytes into chart.Metadata fails. It means the file was found and read, but its content is not parseable as the v3 metadata schema: bad YAML syntax or wrong field types (sigs.k8s.io/yaml round-trips through JSON, so strict typing applies). The chart is returned partially populated (c.Raw already set) alongside the error.","triggerScenarios":"Any load path that funnels into LoadFiles — loader.LoadDir, loader.LoadArchive, loader.LoadFile on a .tgz — where Chart.yaml has a YAML syntax error, a duplicated key, or a type mismatch such as 'version:' or 'appVersion:' given as a map/list/bool instead of a string (e.g. version: 1.0 without quotes parses as a float, which sigs.k8s.io/yaml rejects for the string field... in practice unquoted multi-part versions and nested values under known scalar fields are the usual culprits).","commonSituations":"Hand-edited Chart.yaml with tabs, missing colons, or unquoted values that YAML misinterprets (on/off/yes/no as booleans, dates as timestamps); charts generated by scripts that emit broken YAML; merge conflicts left in Chart.yaml.","solutions":["Validate the syntax directly: helm lint <chart> or yamllint Chart.yaml; also helm show chart <chart> exercises the same parse.","Fix the reported construct: quote version-like strings (version: \"1.0\"), remove tabs (use spaces), resolve merge-conflict markers, deduplicate keys.","If the file was machine-generated, fix the generator template rather than the output so the error does not recur.","Compare against a known-good scaffold (helm create tmp && cat tmp/Chart.yaml) to spot structural mistakes."],"exampleFix":"# before (Chart.yaml)\napiVersion: v2\nname: mychart\nversion: 1.0        # parses as float, schema wants string\nmaintainers:\n  - name: alice\n\n# after\napiVersion: v2\nname: mychart\nversion: \"1.0\"\nmaintainers:\n  - name: alice","handlingStrategy":"validation","validationCode":"// Pre-validate Chart.yaml the same way the loader does.\nfunc chartYamlOK(dir string) error {\n    b, err := os.ReadFile(filepath.Join(dir, \"Chart.yaml\"))\n    if err != nil {\n        return err\n    }\n    md := new(chart.Metadata)\n    return yaml.Unmarshal(b, md)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run 'helm lint' or 'helm show chart' as a CI gate before install/upgrade.","Quote version-like strings in Chart.yaml (version: \"1.0\").","Use spaces, never tabs, and resolve merge conflicts before loading."],"tags":["helm","chart","yaml","chart-yaml","loader","validation"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}