GoogleContainerTools/skaffold · error
unable to parse path %q: %w
Error message
unable to parse path %q: %w
What it means
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.
Source
Thrown at pkg/skaffold/render/generate/generate.go:240
}
// kustomize deps
if g.config.Kustomize != nil {
kDeps, err := kustomizeDependencies(g.workingDir, g.config.Kustomize.Paths)
if err != nil {
return nil, err
}
deps = append(deps, kDeps...)
}
return deps, nil
}
func kustomizeDependencies(workdir string, paths []string) ([]string, error) {
deps := stringset.New()
for _, kustomizePath := range paths {
expandedKustomizePath, err := util.ExpandEnvTemplate(kustomizePath, nil)
if err != nil {
return nil, fmt.Errorf("unable to parse path %q: %w", kustomizePath, err)
}
if !filepath.IsAbs(expandedKustomizePath) {
expandedKustomizePath = filepath.Join(workdir, expandedKustomizePath)
}
depsForKustomization, err := DependenciesForKustomization(expandedKustomizePath)
if err != nil {
return nil, sErrors.NewError(err,
&proto.ActionableErr{
Message: err.Error(),
ErrCode: proto.StatusCode_DEPLOY_KUSTOMIZE_USER_ERR,
})
}
deps.Insert(depsForKustomization...)
}
return deps.ToList(), nil
}
View on GitHub (pinned to a1189de023)
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
Example fix
// before
paths:
- {{DEPLOY_DIR}}/kustomize
// after
paths:
- "{{.DEPLOY_DIR}}/kustomize" # with DEPLOY_DIR exported Defensive patterns
Strategy: validation
Validate before calling
test -n "${DEPLOY_DIR:?DEPLOY_DIR must be set}" # every var used in a {{.VAR}} path must be exported Try / catch
deps, err := ManifestDeps(ctx)
if err != nil && strings.Contains(err.Error(), "unable to parse path") {
// log the quoted path, fix template syntax or export the missing env var
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- unable to parse path %q: %w
- can't merge defaultNamespace property from kustomize into ku
- can't merge disableValidation property from kustomize into k
- executing template: %w
- rendering manifests: %w
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/cdf86e7aad14012a.
Report an issue: GitHub.