{"record":{"id":"22175a1586fda688","repo":"helm/helm","slug":"release-name-q-w","errorCode":null,"errorMessage":"release name %q: %w","messagePattern":"release name %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/action/install.go","lineNumber":612,"sourceCode":"\t\treturn rel, fmt.Errorf(\"release %s failed, and has been uninstalled due to rollback-on-failure being set: %w\", i.ReleaseName, err)\n\t}\n\ti.recordRelease(rel) // Ignore the error, since we have another error to deal with.\n\treturn rel, err\n}\n\n// availableName tests whether a name is available\n//\n// Roughly, this will return an error if name is\n//\n//   - empty\n//   - too long\n//   - already in use, and not deleted\n//   - used by a deleted release, and i.Replace is false\nfunc (i *Install) availableName() error {\n\tstart := i.ReleaseName\n\n\tif err := chartutil.ValidateReleaseName(start); err != nil {\n\t\treturn fmt.Errorf(\"release name %q: %w\", start, err)\n\t}\n\t// On dry run, bail here\n\tif isDryRun(i.DryRunStrategy) {\n\t\treturn nil\n\t}\n\n\th, err := i.cfg.Releases.History(start)\n\tif err != nil || len(h) < 1 {\n\t\treturn nil\n\t}\n\n\thl, err := releaseListToV1List(h)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treleaseutil.Reverse(hl, releaseutil.SortByRevision)\n\trel := hl[0]","sourceCodeStart":594,"sourceCodeEnd":630,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/action/install.go#L594-L630","documentation":"availableName() wraps chartutil.ValidateReleaseName failures, prefixing the offending name. ValidateReleaseName rejects empty names and names that are longer than 53 characters or do not fully match the DNS-1123-style pattern [a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*. Unlike the storage-history check, this error is purely syntactic, so it fires even in dry runs.","triggerScenarios":"i.ReleaseName (or generated name from --name-template) is empty, >53 chars, or contains uppercase letters, underscores, spaces, or other invalid characters when ValidateReleaseName runs.","commonSituations":"Programmatic installs leaving the name empty; CI pipelines composing names from branch names (My_Feature); --name-template producing long or uppercased output; Helmfile/values-driven pipelines passing product display names.","solutions":["Set a valid name: lowercase alphanumeric plus '-' and '.', no leading/trailing separators, max 53 characters","Sanitize generated names: lowercase and replace invalid chars (e.g. tr 'A-Z_' 'a-z-') before passing them","If templating names, keep the template output short and lowercased","Empty name in SDK usage: either set ReleaseName, GenerateName, or NameTemplate before Run"],"exampleFix":"# before\nhelm install \"MyFeature_Branch\" ./chart   # release name \"MyFeature_Branch\": ...\n\n# after\nhelm install \"myfeature-branch\" ./chart","handlingStrategy":"validation","validationCode":"import \"helm.sh/helm/v4/pkg/chart/v2/util\"\n\nfunc safeReleaseName(raw string) (string, error) {\n    name := strings.ToLower(raw)\n    name = strings.ReplaceAll(name, \"_\", \"-\")\n    name = strings.Trim(name, \"-.\")\n    if len(name) > 53 {\n        name = name[:53]\n    }\n    if err := util.ValidateReleaseName(name); err != nil {\n        return \"\", err\n    }\n    return name, nil\n}","typeGuard":null,"tryCatchPattern":"if _, err := inst.RunWithContext(ctx, chrt, vals); err != nil {\n    if strings.Contains(err.Error(), \"release name \\\"\") {\n        // sanitize the name per ValidateReleaseName rules and retry\n    }\n    return err\n}","preventionTips":["Always run generated names through chartutil.ValidateReleaseName before install","Cap name length at 53 chars at the source (pipeline templates), not at failure time"],"tags":["release-name","validation","naming","dns-1123"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}