Argo CD "kustomize build failed" manifest generation in CI
Argo CD renders kustomize overlays with kustomize build in the repo-server. A build failure surfaces as a ComparisonError that wraps the kustomize error, so no manifests are produced for the sync.
What this error means
The Application shows "Manifest generation error" with a "kustomize build ... failed" message naming a missing file, a patch that does not match, or a remote base it could not fetch.
rpc error: code = Unknown desc = Manifest generation error (cached):
kustomize build <path> failed exit status 1: Error: accumulating resources:
accumulation err='accumulating resources from 'deployment.yaml':
open .../deployment.yaml: no such file or directory'Common causes
A referenced resource path is wrong
The kustomization lists a file or directory that does not exist at that path, so accumulation fails.
A patch target does not match
A strategic-merge or JSON patch targets a resource by name or kind that is not in the base, so the build errors.
How to fix it
Build the overlay locally
- Run
kustomize build <path>at the same overlay Argo CD uses. - Fix the missing path or the patch target it names.
- Push and hard-refresh so the cached error clears.
kustomize build overlays/prodPin the kustomize version if behavior differs
If the repo-server kustomize version behaves differently, align your CI kustomize to it so builds match.
- run: kustomize version
- run: kustomize build overlays/prod > /dev/nullHow to prevent it
- Run
kustomize buildfor every overlay in CI before Argo CD renders. - Keep resource paths and patch targets in sync with the base.
- Align the kustomize version in CI with the repo-server.