Skip to content
Latchkey

kustomize "accumulating resources ... no such file or directory" in CI

kustomize build walked your resources: list and one entry does not exist on disk. It reports the accumulation error with the path it tried, whether a manifest file or a base directory.

What this error means

kustomize build or kubectl apply -k fails with "Error: accumulating resources: ... : no such file or directory" naming the missing path.

kustomize
Error: accumulating resources: accumulation err='accumulating resources from
'deployment.yaml': open /repo/overlays/prod/deployment.yaml: no such file or directory'

Common causes

A resource path is wrong or the file is uncommitted

The resources: entry names a file or base that was renamed, moved, or never committed, so it is absent in CI.

The build runs from the wrong directory

Relative resource paths resolve from the kustomization directory; running the build elsewhere breaks them.

How to fix it

Correct the resource path

  1. Confirm the file or base directory exists at the referenced path.
  2. Fix the resources: entry to a path relative to kustomization.yaml.
  3. Commit any missing file so it is present in CI.
kustomization.yaml
resources:
  - ../../base
  - deployment.yaml
  - service.yaml

Build from the overlay directory

Point the build at the directory that holds the kustomization so relative paths resolve.

Terminal
kustomize build overlays/prod

How to prevent it

  • Keep resource paths relative to kustomization.yaml.
  • Run kustomize build on each overlay in CI to catch missing files.
  • Commit every referenced base and manifest.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →