{"record":{"id":"c1e82edcee1f010f","repo":"GoogleContainerTools/skaffold","slug":"kustomization-parse-error-in-v-w","errorCode":null,"errorMessage":"kustomization parse error in %v: %w","messagePattern":"kustomization parse error in (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/render/generate/util.go","lineNumber":103,"sourceCode":"// provided working dir, and collects them into a list of files to be passed\n// to the file watcher.\nfunc DependenciesForKustomization(dir string) ([]string, error) {\n\tvar deps []string\n\n\tpath, err := FindKustomizationConfig(dir)\n\tif err != nil {\n\t\t// No kustomization config found so assume it's remote and stop traversing\n\t\treturn deps, nil\n\t}\n\n\tbuf, err := os.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontent := kustomization{}\n\tif err := yaml.Unmarshal(buf, &content); err != nil {\n\t\treturn nil, fmt.Errorf(\"kustomization parse error in %v: %w\", path, err)\n\t}\n\n\tdeps = append(deps, path)\n\n\tcandidates := append(content.Bases, content.Resources...)\n\tcandidates = append(candidates, content.Components...)\n\n\tfor _, candidate := range candidates {\n\t\t// If the file doesn't exist locally, we can assume it's a remote file and\n\t\t// skip it, since we can't monitor remote files. Kustomize itself will\n\t\t// handle invalid/missing files.\n\t\tlocal, mode := pathExistsLocally(candidate, dir)\n\t\tif !local {\n\t\t\tcontinue\n\t\t}\n\n\t\tif mode.IsDir() {\n\t\t\tcandidateDeps, err := DependenciesForKustomization(filepath.Join(dir, candidate))","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/render/generate/util.go#L85-L121","documentation":"DependenciesForKustomization reads a kustomization.yaml (or kustomize.yml/kustomization.yml/Kustomization) and unmarshals it into the kustomization struct. If YAML parsing fails, it reports 'kustomization parse error in <path>'. Recursion continues into bases/resources/components after a successful parse.","triggerScenarios":"A kustomization file under a path listed in kustomizeDependencies is malformed YAML or contains fields of the wrong type, so yaml.Unmarshal fails during dependency discovery (also recursed through nested bases).","commonSituations":"Hand-edited kustomization.yaml with bad indentation or tabs; wrong type for a list field (resources given as a string); kustomization written for a much newer kustomize schema with unsupported keys; truncated file from a failed merge.","solutions":["Validate the file: kustomize build <dir> (or kubectl kustomize <dir>) to see the YAML error","Fix indentation/tabs and ensure list fields (resources, bases, components) are YAML lists","Remove or correct fields unsupported by Skaffold's bundled yaml schema version","Restore the file if it was truncated or auto-merged incorrectly"],"exampleFix":"// before (invalid)\nresources: base\n// after\nresources:\n  - base","handlingStrategy":"validation","validationCode":"kustomize build ./deploy/overlays/dev > /dev/null || echo 'kustomization invalid'","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"kustomization parse error\") {\n    // parse the path from the message and run kustomize build there for the YAML detail\n}","preventionTips":["Run kustomize build in CI as a lint step for every kustomization","Keep list fields (resources, bases, components) as YAML lists","Avoid fields unsupported by your Skaffold/kustomize version"],"tags":["yaml","kustomize","parse-error","configuration"],"backgroundTag":"kustomization-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"}