Skip to content
Latchkey

Flux Kustomization "path not found" in CI

kustomize-controller resolved the source artifact and then looked for spec.path inside it, but that directory is not present. The path is misspelled, points at the wrong repo layout, or the directory was moved or deleted.

What this error means

A Kustomization reports "False" with "path not found" or "no such file or directory" for the configured spec.path.

kustomize-controller
kustomization path not found: stat /tmp/kustomization-123/clusters/prod: no such file or directory

Common causes

spec.path is misspelled or moved

The directory named in spec.path does not exist at the source revision because it was renamed, moved, or never existed.

The source points at the wrong repo or ref

The GitRepository resolves to a revision whose layout does not contain that path, so kustomize-controller cannot find it.

How to fix it

Set spec.path to a directory that exists

  1. List the directories at the source revision to find the real path.
  2. Update spec.path to match, using a path relative to the repo root.
  3. Reconcile the Kustomization with its source.
kustomization.yaml
spec:
  path: ./clusters/prod
  sourceRef:
    kind: GitRepository
    name: infra

Confirm the source revision layout

Check the resolved source revision to be sure the path exists at that commit.

Terminal
flux get sources git infra
kubectl -n flux-system describe kustomization apps

How to prevent it

  • Keep spec.path in sync with the repository directory layout.
  • Use paths relative to the repo root, matching the source ref.
  • Review Kustomization paths when you restructure the repo.

Frequently asked questions

What causes ""path ... not found""?
The directory named in spec.path does not exist at the source revision because it was renamed, moved, or never existed.
How do I fix "path ... not found"?
Set spec.path to a directory that exists

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card