helm/helm · warning
chart name %q is invalid
Error message
chart name %q is invalid
What it means
validateChartName (internal/chart/v3/lint/rules/chartfile.go:121) rejects a chart name that is not equal to its own filepath.Base — i.e. the name contains path separators ('foo/bar') or other characters that make Base(name) differ from name. Empty names are caught earlier by the separate 'name is required' error.
Source
Thrown at internal/chart/v3/lint/rules/chartfile.go:121
return fmt.Errorf("unable to parse YAML\n\t%w", chartFileError)
}
return nil
}
func validateChartYamlStrictFormat(chartFileError error) error {
if chartFileError != nil {
return fmt.Errorf("failed to strictly parse chart metadata file\n\t%w", chartFileError)
}
return nil
}
func validateChartName(cf *chart.Metadata) error {
if cf.Name == "" {
return errors.New("name is required")
}
name := filepath.Base(cf.Name)
if name != cf.Name {
return fmt.Errorf("chart name %q is invalid", cf.Name)
}
return nil
}
func validateChartAPIVersion(cf *chart.Metadata) error {
if cf.APIVersion == "" {
return errors.New("apiVersion is required. The value must be \"v3\"")
}
if cf.APIVersion != chart.APIVersionV3 {
return fmt.Errorf("apiVersion '%s' is not valid. The value must be \"v3\"", cf.APIVersion)
}
return nil
}
func validateChartVersion(cf *chart.Metadata) error {
if cf.Version == "" {View on GitHub (pinned to 2a29f1770b)
Solutions
- Use a plain, slash-free name: `name: mychart`
- If namespacing is needed, encode it differently (prefix with a dash: acme-mychart) since OCI refs carry the path part at push time
- Validate with `helm lint` before publishing
Example fix
# before name: acme/mychart # after name: acme-mychart
Defensive patterns
Strategy: validation
Validate before calling
if md.Name != filepath.Base(md.Name) || strings.ContainsAny(md.Name, "/\\") {
return fmt.Errorf("chart name %q must not contain path separators", md.Name)
} Type guard
func isValidChartName(name string) bool {
return name != "" && name == filepath.Base(name)
} Try / catch
// Lint-time message: on 'chart name ... is invalid', rename the chart in // Chart.yaml to a slash-free name and bump dependent aliases/references.
Prevention
- Never namespace chart names with slashes; the registry path carries namespacing
- Validate names with filepath.Base equality in chart scaffolding tools
- Check dependent charts' aliases when renaming, since references break
When it happens
Trigger: `name: acme/mychart` in Chart.yaml; names containing slashes, or NUL/trailing-slash-like sequences that change the base name; names built by joining an org prefix with the chart name.
Common situations: Trying to namespace a chart like a Go module or docker image (acme/mychart); converting from formats where slashed names are conventional; script-generated names concatenating directory paths.
Related errors
- chart name must be between 1 and %d characters
- chart name must match the regular expression %q
- %d chart(s) linted, %d chart(s) failed
- %s should be of type string but it's of type %s
- unable to parse YAML %w
AI-assisted analysis of helm/helm@2a29f1770b (2026-08-15).
Data as JSON: /api/errors/311b95dd3129cb8e.
Report an issue: GitHub.