{"record":{"id":"650cb5dd3604e983","repo":"GoogleContainerTools/skaffold","slug":"unable-to-parse-config-w","errorCode":null,"errorMessage":"unable to parse config: %w","messagePattern":"unable to parse config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/versions.go","lineNumber":329,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out.Bytes(), nil\n}\n\nfunc parseConfig(buf []byte, factories []func() util.VersionedConfig) ([]util.VersionedConfig, error) {\n\tb := bytes.NewReader(buf)\n\tdecoder := yaml.NewDecoder(b)\n\tdecoder.KnownFields(true)\n\tvar cfgs []util.VersionedConfig\n\tfor index := 0; index < len(factories); index++ {\n\t\tcfg := factories[index]()\n\t\terr := decoder.Decode(cfg)\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse config: %w\", err)\n\t\t}\n\t\tcfgs = append(cfgs, cfg)\n\t}\n\treturn cfgs, nil\n}\n\n// getLatestFromCompatibilityCheck makes sure the schema versions in SchemaVersionsV1 and SchemaVersionsV2 are not used\n// together and returns the latest version where this VersionedConfig slice belongs to.\nfunc getLatestFromCompatibilityCheck(cfgs []util.VersionedConfig) (string, error) {\n\tvar v1Track, v2Track []string\n\tfor _, cfg := range cfgs {\n\t\tcurVersion := cfg.GetVersion()\n\t\tif matched := V1Pattern.MatchString(curVersion); matched {\n\t\t\tv1Track = append(v1Track, curVersion)\n\t\t} else if matched := V2Pattern.MatchString(curVersion); matched {\n\t\t\tv2Track = append(v2Track, curVersion)\n\t\t} else {\n\t\t\treturn \"\", fmt.Errorf(\"unknown apiVersion %v\", curVersion)","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/versions.go#L311-L347","documentation":"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.","triggerScenarios":"Thrown at pkg/skaffold/schema/versions.go:329 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}