GoogleContainerTools/skaffold · error

error converting helm artifactOverrides during version upgra

Error message

error converting helm artifactOverrides during version upgrade: %w

What it means

During the v2beta29 upgrade, helm 'artifactOverrides' JSON patches stored on the old pipeline are converted to the new schema's patch representation via upgradeArtifactOverridesPatches. If that conversion fails (malformed patch, missing key in oldsMap/newsMap mapping), the error is wrapped with this message so users know the failure is specific to helm artifactOverrides migration.

Source

Thrown at pkg/skaffold/schema/v2beta29/upgrade.go:202

					svts[k] = fmt.Sprintf("{{.IMAGE_FULLY_QUALIFIED_%s}}", validV)
				}
			}
			newPL.Render.Helm.Releases[i].SetValues = svs
			newPL.Render.Helm.Releases[i].SetValueTemplates = svts
		}

		// Duplicate helm definitions between render and deployer.
		// This is required for backwards compatibility because skaffold v1 used helm namespace definitions for both
		// render (to populate {{.Release.Namespace}} templates) and deploy (as `--namespace` flag)
		newPL.Deploy.LegacyHelmDeploy = &next.LegacyHelmDeploy{}
		newPL.Deploy.LegacyHelmDeploy.LifecycleHooks = newHelm.LifecycleHooks
		newPL.Deploy.LegacyHelmDeploy.Releases = newHelm.Releases
		newPL.Deploy.LegacyHelmDeploy.Flags = newHelm.Flags
	}

	err := upgradeArtifactOverridesPatches(opu.oldPatchesMap, opu.newPatchesMap, oldPL)
	if err != nil {
		return fmt.Errorf("error converting helm artifactOverrides during version upgrade: %w", err)
	}

	return nil
}

func upgradeArtifactOverridesPatches(oldsMap map[string][]JSONPatch, newsMap map[string][]next.JSONPatch, oldPL *Pipeline) error {
	for k := range oldsMap {
		for i, old := range oldsMap[k] {
			if artifactOverridesRegexp.Match([]byte(old.Path)) {
				idx, err := strconv.Atoi(strings.Split(old.Path, "/")[4])
				if err != nil {
					return err
				}
				newPathModified := strings.ReplaceAll(strings.ReplaceAll(old.Path, "/deploy/helm", "/manifests/helm"),
					"artifactOverrides", "setValueTemplates")
				if oldPL.Deploy.HelmDeploy != nil {
					validV := pkgutil.SanitizeHelmTemplateValue(old.Value.Node.Value().(string))
					n := &util.YamlpatchNode{}

View on GitHub (pinned to a1189de023)

Solutions

  1. Inspect the wrapped cause and locate the helm release/patch with artifactOverrides in skaffold.yaml
  2. Rewrite the artifactOverrides as the new schema's setValues/overrides form for that release
  3. Simplify the patch to reference fields that exist in the target schema version

Example fix

# before
releases:
  - name: myrel
    artifactOverrides: {image: myimg}
# after
releases:
  - name: myrel
    setValues:
      image: myimg
Defensive patterns

Strategy: validation

Validate before calling

for _, r := range cfg.Deploy.Helm.Releases {
	if r.ArtifactOverrides != nil {
		if !patchSchemaSupported(r.ArtifactOverrides) {
			return fmt.Errorf("release %s has unsupported artifactOverrides", r.Name)
		}
	}
}

Try / catch

if err := cfg.Upgrade(); err != nil {
	if strings.Contains(err.Error(), "helm artifactOverrides") {
		// migrate the release to setValues/overrides
	}
}

Prevention

When it happens

Trigger: Calling the v2beta29 Upgrade() on a config where a deploy.helm (LegacyHelmDeploy) release or kustomize/helm JSON patch references artifactOverrides that cannot be converted — e.g. a patch path that no longer exists in the new schema.

Common situations: Configs using `deploy.helm.releases[].artifactOverrides` with hand-written JSON patches targeting nested helm values; upgrading across versions where the helm deploy struct fields were renamed.

Related errors


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