Skip to content
Latchkey

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.

argocd
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

  1. Run kustomize build <path> at the same overlay Argo CD uses.
  2. Fix the missing path or the patch target it names.
  3. Push and hard-refresh so the cached error clears.
Terminal
kustomize build overlays/prod

Pin the kustomize version if behavior differs

If the repo-server kustomize version behaves differently, align your CI kustomize to it so builds match.

.github/workflows/deploy.yml
- run: kustomize version
- run: kustomize build overlays/prod > /dev/null

How to prevent it

  • Run kustomize build for 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.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →