{"record":{"id":"62d64a89133bbd2b","repo":"GoogleContainerTools/skaffold","slug":"unable-to-parse-output-q","errorCode":null,"errorMessage":"unable to parse output: %q","messagePattern":"unable to parse output: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/helm/bin.go","lineNumber":93,"sourceCode":"\tKubeContext() string\n\tLabels() map[string]string\n\tGlobalFlags() []string\n\tManifestOverrides() map[string]string\n}\n\n// BinVer returns the version of the helm binary found in PATH.\nfunc BinVer(ctx context.Context) (semver.Version, error) {\n\t// Helm v2 needed the `--client` to avoid connecting to Kubernetes.\n\t// Support for Helm v2 was dropped here.\n\tcmd := exec.CommandContext(ctx, \"helm\", \"version\")\n\tb, err := util.RunCmdOut(ctx, cmd)\n\tif err != nil {\n\t\treturn semver.Version{}, fmt.Errorf(\"helm version command failed %q: %w\", string(b), err)\n\t}\n\traw := string(b)\n\tmatches := VersionRegex.FindStringSubmatch(raw)\n\tif len(matches) == 0 {\n\t\treturn semver.Version{}, fmt.Errorf(\"unable to parse output: %q\", raw)\n\t}\n\treturn semver.ParseTolerant(matches[1])\n}\n\n// PreparePostRenderer conditionally installs a post renderer plugin (starting from Helm v4) and returns\n// an optional cleanup function in that case, plus in any case the needed command line arguments\nfunc PreparePostRenderer(ctx context.Context, h Client, skaffoldBinary string, helmVersion semver.Version) (func(), []string, error) {\n\tif helmVersion.LT(Helm4PostRendererVersion) {\n\t\treturn nil, []string{\"--post-renderer\", skaffoldBinary}, nil\n\t}\n\n\t// Helm v4 logic\n\n\tskaffoldBinaryAsYaml, err := yaml.Marshal(skaffoldBinary)\n\tif err != nil {\n\t\treturn nil, nil, PluginErr(\"Failed to fill Skaffold executable into Helm plugin manifest\", err)\n\t}\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/helm/bin.go#L75-L111","documentation":"Skaffold runs `helm version` and parses the output with VersionRegex (expects something like v3.x.x). If the regex finds no match, the output could not be interpreted as a Helm version string, so this error is returned with the raw output for inspection.","triggerScenarios":"`helm version` succeeds but stdout does not match the expected `version.Version{...}` pattern: output wrapped by a shell wrapper, an alias or shim printing extra text, a very old/unusual helm build, or helm printing version only to a different stream.","commonSituations":"helm replaced by a wrapper script that banners extra lines; nightlies/custom builds with unexpected version strings; corporate shims (e.g. via asdf/mise) altering output; a non-helm binary named `helm` earlier on PATH.","solutions":["Inspect the printed raw output in the error to see what `helm version` returned","Run `helm version` manually and confirm output contains `vX.Y.Z`","Remove or rename wrapper/shim scripts shadowing the real helm binary (`type -a helm`)","Install a standard Helm 3 release from official binaries"],"exampleFix":"// before: custom wrapper\nhelm() { echo \"loading env\"; /usr/local/bin/helm \"$@\"; }\n// after: call real binary directly\nalias helm=/usr/local/bin/helm  # ensure only helm prints version output","handlingStrategy":"validation","validationCode":"out=$(helm version 2>&1); echo \"$out\" | grep -qE 'v[0-9]+\\.[0-9]+\\.[0-9]+' || { echo \"unexpected helm version output: $out\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid shell wrappers/aliases around helm that print extra output","Install official Helm releases instead of custom builds","Check `type -a helm` to ensure the real binary is first on PATH","Run `helm version` manually after any helm upgrade"],"tags":["helm","version-parse","cli","regex"],"backgroundTag":"cli-output-parse-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}