GoogleContainerTools/skaffold · error

package chart into a .tgz archive: %v: %w

Error message

package chart into a .tgz archive: %v: %w

What it means

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.

Source

Thrown at pkg/skaffold/deploy/helm/helm.go:698

		v, err := util.ExpandEnvTemplate(r.Packaged.Version, nil)
		if err != nil {
			return "", fmt.Errorf("packaged.version template: %w", err)
		}
		args = append(args, "--version", v)
	}

	if r.Packaged.AppVersion != "" {
		av, err := util.ExpandEnvTemplate(r.Packaged.AppVersion, nil)
		if err != nil {
			return "", fmt.Errorf("packaged.appVersion template: %w", err)
		}
		args = append(args, "--app-version", av)
	}

	buf := &bytes.Buffer{}

	if err := helm.Exec(ctx, h, buf, false, nil, args...); err != nil {
		return "", fmt.Errorf("package chart into a .tgz archive: %v: %w", args, err)
	}

	output := strings.TrimSpace(buf.String())
	idx := strings.Index(output, tmpDir)

	if idx == -1 {
		return "", fmt.Errorf("unable to find %s in output: %s", tmpDir, output)
	}

	return output[idx:], nil
}

func (h *Deployer) warnAboutUnusedImages(builds []graph.Artifact, manifests manifest.ManifestList) {
	seen := map[string]bool{}
	images, _ := manifests.GetImages(manifest.NewResourceSelectorImages(h.transformableAllowlist, h.transformableDenylist))
	for _, a := range images {
		seen[a.Tag] = true
	}

View on GitHub (pinned to a1189de023)

Solutions

  1. Verify chartPath points to a directory containing a valid Chart.yaml
  2. Run the wrapped command manually (`helm package <chartPath> --destination /tmp`) to see helm's real error
  3. Check that packaged.version/appVersion expand to valid semver values
  4. Confirm `helm version` works and matches skaffold's expected helmVersion

Example fix

// before
releases:
  - name: app
    chartPath: ./charts/app   # dir missing
// after
releases:
  - name: app
    chartPath: ./helm/charts/app   # correct path with Chart.yaml
Defensive patterns

Strategy: validation

Validate before calling

if fi, err := os.Stat(release.ChartPath); err != nil || !fi.IsDir() {
  return fmt.Errorf("chartPath %q missing", release.ChartPath)
}
if _, err := os.Stat(filepath.Join(release.ChartPath, "Chart.yaml")); err != nil {
  return fmt.Errorf("Chart.yaml missing in %s", release.ChartPath)
}
if exec.Command("helm", "version").Run() != nil { return errors.New("helm not available") }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/6eb029cbf580bd89. Report an issue: GitHub.