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

  1. Use a plain, slash-free name: `name: mychart`
  2. If namespacing is needed, encode it differently (prefix with a dash: acme-mychart) since OCI refs carry the path part at push time
  3. 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

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


AI-assisted analysis of helm/helm@2a29f1770b (2026-08-15). Data as JSON: /api/errors/311b95dd3129cb8e. Report an issue: GitHub.