{"record":{"id":"6eb029cbf580bd89","repo":"GoogleContainerTools/skaffold","slug":"package-chart-into-a-tgz-archive-v-w","errorCode":null,"errorMessage":"package chart into a .tgz archive: %v: %w","messagePattern":"package chart into a \\.tgz archive: (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/helm/helm.go","lineNumber":698,"sourceCode":"\t\tv, err := util.ExpandEnvTemplate(r.Packaged.Version, nil)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"packaged.version template: %w\", err)\n\t\t}\n\t\targs = append(args, \"--version\", v)\n\t}\n\n\tif r.Packaged.AppVersion != \"\" {\n\t\tav, err := util.ExpandEnvTemplate(r.Packaged.AppVersion, nil)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"packaged.appVersion template: %w\", err)\n\t\t}\n\t\targs = append(args, \"--app-version\", av)\n\t}\n\n\tbuf := &bytes.Buffer{}\n\n\tif err := helm.Exec(ctx, h, buf, false, nil, args...); err != nil {\n\t\treturn \"\", fmt.Errorf(\"package chart into a .tgz archive: %v: %w\", args, err)\n\t}\n\n\toutput := strings.TrimSpace(buf.String())\n\tidx := strings.Index(output, tmpDir)\n\n\tif idx == -1 {\n\t\treturn \"\", fmt.Errorf(\"unable to find %s in output: %s\", tmpDir, output)\n\t}\n\n\treturn output[idx:], nil\n}\n\nfunc (h *Deployer) warnAboutUnusedImages(builds []graph.Artifact, manifests manifest.ManifestList) {\n\tseen := map[string]bool{}\n\timages, _ := manifests.GetImages(manifest.NewResourceSelectorImages(h.transformableAllowlist, h.transformableDenylist))\n\tfor _, a := range images {\n\t\tseen[a.Tag] = true\n\t}","sourceCodeStart":680,"sourceCodeEnd":716,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/helm/helm.go#L680-L716","documentation":"Wraps failure of the `helm package <chart> --destination <tmpDir>` exec during packageChart. Any helm CLI failure (bad Chart.yaml, missing chart path, bad flags) is wrapped with the full args for diagnosis.","triggerScenarios":"Calling Deploy with a release requiring packaging when ChartPath does not exist, Chart.yaml is invalid (missing name/version), or the helm binary errors (version incompatibility, bad --version value).","commonSituations":"chartPath typo in skaffold.yaml; chart dir missing Chart.yaml; packaged.version producing an invalid semver rejected by helm; helm not on PATH or too old.","solutions":["Verify chartPath points to a directory containing a valid Chart.yaml","Run the wrapped command manually (`helm package <chartPath> --destination /tmp`) to see helm's real error","Check that packaged.version/appVersion expand to valid semver values","Confirm `helm version` works and matches skaffold's expected helmVersion"],"exampleFix":"// before\nreleases:\n  - name: app\n    chartPath: ./charts/app   # dir missing\n// after\nreleases:\n  - name: app\n    chartPath: ./helm/charts/app   # correct path with Chart.yaml","handlingStrategy":"validation","validationCode":"if fi, err := os.Stat(release.ChartPath); err != nil || !fi.IsDir() {\n  return fmt.Errorf(\"chartPath %q missing\", release.ChartPath)\n}\nif _, err := os.Stat(filepath.Join(release.ChartPath, \"Chart.yaml\")); err != nil {\n  return fmt.Errorf(\"Chart.yaml missing in %s\", release.ChartPath)\n}\nif exec.Command(\"helm\", \"version\").Run() != nil { return errors.New(\"helm not available\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify chartPath contains Chart.yaml before deploy","Ensure helm is installed and compatible","Validate packaged.version expands to valid semver","Run `helm lint <chartPath>` in CI"],"tags":["helm","packaging","exec"],"backgroundTag":"helm-package-command-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"}