{"record":{"id":"6bc1b1050582e64c","repo":"GoogleContainerTools/skaffold","slug":"kustomization-parse-error-in-v-w-6bc1b1","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/renderer/kustomize/kustomize.go","lineNumber":472,"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 := types.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":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/render/renderer/kustomize/kustomize.go#L454-L490","documentation":"DependenciesForKustomization fetches a kustomization file and unmarshals it into types.Kustomization. A YAML that is syntactically broken or not a valid Kustomization object yields this error, which wraps the yaml error. It occurs recursively while walking bases/resources/components.","triggerScenarios":"A kustomization.yaml in the dependency tree fails yaml.Unmarshal into types.Kustomization (bad indentation, duplicate keys, wrong field types such as resources: as a string instead of a list).","commonSituations":"Hand-edited kustomization.yaml with indentation mistakes; using kustomize v1 'bases' syntax with a typo; tab characters in YAML; pulling a base via URL whose content is not a Kustomization.","solutions":["Run kubectl kustomize <dir> or kustomize build <dir> to see the parse error locally","Fix the YAML syntax / field types in the named file","Ensure apiVersion/kind fields exist and resources/bases/components are lists","If the path resolved to a non-kustomization YAML, correct the path"],"exampleFix":"// before\nresources: base\n// after\nresources:\n  - base","handlingStrategy":"validation","validationCode":"var k types.Kustomization\nb, err := os.ReadFile(path)\nif err != nil { return err }\nif err := yaml.Unmarshal(b, &k); err != nil {\n    return fmt.Errorf(\"pre-validate %s: %v\", path, err)\n}","typeGuard":null,"tryCatchPattern":"if _, err := DependenciesForKustomization(path, &stringset.Set{}, nil); err != nil {\n    return fmt.Errorf(\"kustomize tree invalid, aborting render: %w\", err)\n}","preventionTips":["Run `kustomize build` / `kubectl kustomize` on every kustomization dir in CI lint","Use 2-space indentation, no tabs, in kustomization files","Validate remote bases' content is a Kustomization before referencing them"],"tags":["kustomize","yaml","parse","skaffold"],"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"}