GoogleContainerTools/skaffold · error

unknown apiVersion %v

Error message

unknown apiVersion %v

What it means

Fires in getLatestFromCompatibilityCheck when a parsed config's apiVersion matches neither the skaffold.v1... (V1) nor skaffold/v2... (V2) pattern — e.g. a typo like skaffold/v3beta1 or v4alpha1. The config cannot be assigned to a schema track.

Source

Thrown at pkg/skaffold/schema/versions.go:347

			return nil, fmt.Errorf("unable to parse config: %w", err)
		}
		cfgs = append(cfgs, cfg)
	}
	return cfgs, nil
}

// getLatestFromCompatibilityCheck makes sure the schema versions in SchemaVersionsV1 and SchemaVersionsV2 are not used
// together and returns the latest version where this VersionedConfig slice belongs to.
func getLatestFromCompatibilityCheck(cfgs []util.VersionedConfig) (string, error) {
	var v1Track, v2Track []string
	for _, cfg := range cfgs {
		curVersion := cfg.GetVersion()
		if matched := V1Pattern.MatchString(curVersion); matched {
			v1Track = append(v1Track, curVersion)
		} else if matched := V2Pattern.MatchString(curVersion); matched {
			v2Track = append(v2Track, curVersion)
		} else {
			return "", fmt.Errorf("unknown apiVersion %v", curVersion)
		}
	}

	if len(v1Track) > 0 && len(v2Track) > 0 {
		return "", fmt.Errorf("detected incompatible versions:%v are incompatible with %v", v1Track, v2Track)
	}
	if len(v1Track) > 0 {
		return latestV1.Version, nil
	}
	if len(v2Track) > 0 {
		return latest.Version, nil
	}
	return "", fmt.Errorf("unable to find a valid API Schema version")
}

// IsCompatibleWith checks if the cfgs versions can be upgraded to toVersion.
func IsCompatibleWith(cfgs []util.VersionedConfig, toVersion string) (bool, error) {
	var pattern *regexp.Regexp

View on GitHub (pinned to a1189de023)

Solutions

  1. Correct the apiVersion in skaffold.yaml to a valid one, e.g. skaffold/v4beta11 or a supported v2 version
  2. Run `skaffold fix` to migrate the config to the latest apiVersion
  3. Check the skaffold docs for apiVersions supported by your binary version
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/skaffold/schema/versions.go:347 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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