{"record":{"id":"da6556d47a4260c5","repo":"GoogleContainerTools/skaffold","slug":"parsing-skaffold-config-w","errorCode":null,"errorMessage":"parsing skaffold config: %w","messagePattern":"parsing skaffold config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/skaffold/app/cmd/runner.go","lineNumber":139,"sourceCode":"\t\t\tif config == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable to generate skaffold config file automatically - try running `skaffold init`: action cancelled by user\")\n\t\t\t}\n\n\t\t\tdefaults.Set(config)\n\n\t\t\treturn parser.SkaffoldConfigSet{\n\t\t\t\t&parser.SkaffoldConfigEntry{SkaffoldConfig: config, IsRootConfig: true},\n\t\t\t}, nil\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"skaffold config file %s not found - check your current working directory, or try running `skaffold init`\", opts.ConfigurationFile)\n\t}\n\n\t// If the error is NOT that the file doesn't exist, then we warn the user\n\t// that maybe they are using an outdated version of Skaffold that's unable to read\n\t// the configuration.\n\twarnIfUpdateIsAvailable()\n\treturn nil, fmt.Errorf(\"parsing skaffold config: %w\", err)\n}\n\nfunc warnIfUpdateIsAvailable() {\n\twarning, err := update.CheckVersionOnError(opts.GlobalConfig)\n\tif err != nil {\n\t\tlog.Entry(context.TODO()).Infof(\"update check failed: %s\", err)\n\t\treturn\n\t}\n\tif warning != \"\" {\n\t\tlog.Entry(context.TODO()).Warn(warning)\n\t}\n}\n\nfunc setDefaultRendererAndDeployer(configs parser.SkaffoldConfigSet) {\n\t// do not set a default deployer or renderer in a multi-config application.\n\tif len(configs) > 1 {\n\t\treturn\n\t}","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/cmd/runner.go#L121-L157","documentation":"The skaffold config file exists but could not be parsed into versioned Skaffold configs. The parser failed on YAML syntax, an unsupported/unknown apiVersion, or structural type errors, and the raw parser error is wrapped here.","triggerScenarios":"Any config-loading command where parser returns an error other than CONFIG_FILE_NOT_FOUND: malformed YAML, unsupported apiVersion/kind for this skaffold version, invalid field types (e.g. string where int expected), or unreadable file (permissions).","commonSituations":"Hand-edited skaffold.yaml with YAML indentation mistakes; config written for a newer skaffold version than the installed binary; tabs instead of spaces; merging/included config files with bad syntax.","solutions":["Read the wrapped cause after 'parsing skaffold config:' - it names the YAML/schema problem","Validate YAML syntax (yamllint) and fix indentation/tabs","Run `skaffold fix -f skaffold.yaml` to migrate unsupported apiVersions","Check the installed skaffold version vs the config's apiVersion compatibility"],"exampleFix":"// before (tabs cause YAML parse error)\nbuild:\n\tartifacts:\n// after (spaces)\nbuild:\n  artifacts:\n    - image: my-app","handlingStrategy":"validation","validationCode":"python3 -c \"import yaml,sys; yaml.safe_load(open('skaffold.yaml'))\" && echo 'yaml ok'\nskaffold diagnose >/dev/null 2>&1 || echo 'schema/parse problem'","typeGuard":null,"tryCatchPattern":"_, _, _, err := createNewRunner(ctx, out, opts)\nif err != nil && strings.Contains(err.Error(), \"parsing skaffold config:\") {\n\treturn fmt.Errorf(\"skaffold.yaml is malformed or uses an unsupported apiVersion: %w\", err)\n}","preventionTips":["Lint skaffold.yaml with a YAML linter and schema validation in CI","Run `skaffold fix` after any skaffold version upgrade","Use spaces, never tabs, in YAML configs","Test hand-edited configs with `skaffold diagnose` before running pipelines"],"tags":["skaffold","config","parse-error","yaml"],"backgroundTag":"skaffold-config-parse-error","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"}