GoogleContainerTools/skaffold · error
unable to parse config: %w
Error message
unable to parse config: %w
What it means
Fires in parseConfig when strict YAML decoding (KnownFields enabled) of the skaffold.yaml config fails — the file contains unknown fields, wrong types, or malformed YAML relative to the schema version being tried. Wraps the underlying decoder error.
Source
Thrown at pkg/skaffold/schema/versions.go:329
if err != nil {
return nil, err
}
return out.Bytes(), nil
}
func parseConfig(buf []byte, factories []func() util.VersionedConfig) ([]util.VersionedConfig, error) {
b := bytes.NewReader(buf)
decoder := yaml.NewDecoder(b)
decoder.KnownFields(true)
var cfgs []util.VersionedConfig
for index := 0; index < len(factories); index++ {
cfg := factories[index]()
err := decoder.Decode(cfg)
if err == io.EOF {
break
}
if err != nil {
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)View on GitHub (pinned to a1189de023)
Solutions
- Fix the reported YAML/type errors in skaffold.yaml (decoder messages identify the field and line)
- Remove or rename fields not present in your config's apiVersion schema
- Upgrade the config's apiVersion (skaffold fix) or upgrade skaffold if the field requires a newer schema
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at pkg/skaffold/schema/versions.go:329 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/650cb5dd3604e983.
Report an issue: GitHub.