{"record":{"id":"cdf86e7aad14012a","repo":"GoogleContainerTools/skaffold","slug":"unable-to-parse-path-q-w","errorCode":null,"errorMessage":"unable to parse path %q: %w","messagePattern":"unable to parse path %q: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/render/generate/generate.go","lineNumber":240,"sourceCode":"\t}\n\t// kustomize deps\n\tif g.config.Kustomize != nil {\n\t\tkDeps, err := kustomizeDependencies(g.workingDir, g.config.Kustomize.Paths)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdeps = append(deps, kDeps...)\n\t}\n\n\treturn deps, nil\n}\n\nfunc kustomizeDependencies(workdir string, paths []string) ([]string, error) {\n\tdeps := stringset.New()\n\tfor _, kustomizePath := range paths {\n\t\texpandedKustomizePath, err := util.ExpandEnvTemplate(kustomizePath, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse path %q: %w\", kustomizePath, err)\n\t\t}\n\n\t\tif !filepath.IsAbs(expandedKustomizePath) {\n\t\t\texpandedKustomizePath = filepath.Join(workdir, expandedKustomizePath)\n\t\t}\n\t\tdepsForKustomization, err := DependenciesForKustomization(expandedKustomizePath)\n\t\tif err != nil {\n\t\t\treturn nil, sErrors.NewError(err,\n\t\t\t\t&proto.ActionableErr{\n\t\t\t\t\tMessage: err.Error(),\n\t\t\t\t\tErrCode: proto.StatusCode_DEPLOY_KUSTOMIZE_USER_ERR,\n\t\t\t\t})\n\t\t}\n\t\tdeps.Insert(depsForKustomization...)\n\t}\n\treturn deps.ToList(), nil\n}\n","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/render/generate/generate.go#L222-L258","documentation":"kustomizeDependencies expands each kustomize path as an env-template via util.ExpandEnvTemplate before resolving it. If template expansion fails (bad env var syntax, unset required variable), the path is reported with 'unable to parse path %q'. It guards against paths that are not valid after template processing.","triggerScenarios":"A kustomize path in render generate (e.g. kustomize paths or .manifests.generate kustomize entries) contains env-template syntax like {{.MY_VAR}} with invalid syntax or a failing expansion, called from ManifestDeps via kustomizeDependencies.","commonSituations":"Referencing an environment variable that isn't set in the current shell/CI; malformed Go-template syntax ({{VAR}} missing the dot, unbalanced braces); special characters in paths confusing the template parser.","solutions":["Fix the template syntax in the path (valid form: {{.VAR_NAME}})","Export the referenced environment variable before running skaffold","Remove template syntax if no substitution is needed — use a plain path","Test expansion: echo the intended path with the same env vars set"],"exampleFix":"// before\npaths:\n  - {{DEPLOY_DIR}}/kustomize\n// after\npaths:\n  - \"{{.DEPLOY_DIR}}/kustomize\"  # with DEPLOY_DIR exported","handlingStrategy":"validation","validationCode":"test -n \"${DEPLOY_DIR:?DEPLOY_DIR must be set}\"  # every var used in a {{.VAR}} path must be exported","typeGuard":null,"tryCatchPattern":"deps, err := ManifestDeps(ctx)\nif err != nil && strings.Contains(err.Error(), \"unable to parse path\") {\n    // log the quoted path, fix template syntax or export the missing env var\n}","preventionTips":["Use valid Go-template syntax {{.VAR}} (with the dot) in paths","Export every variable referenced in templated paths in CI","Prefer plain paths when no substitution is needed"],"tags":["template","env-var","kustomize","path-parsing"],"backgroundTag":"env-template-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"}