## TL;DR
Manifest generation errors happen in the repo-server when it runs helm template or kustomize build: the failure is in your chart or overlay, and the fix is reproducible locally with the same tool versions. Render locally with the exact versions ArgoCD uses, fix the templating, and commit. Version skew between your laptop and ArgoCD is the classic "works for me" trap.

## The query
```text
ArgoCD "rpc error: Manifest generation error": kustomize and helm debugging
```

## Use this when
- Apps fail at manifest generation stage
- Repo-server logs show generation errors
- Local renders succeed but ArgoCD fails
- After helm or kustomize version changes

## Not for when
- Sync failures after successful generation
- Comparison errors (different stage)
- Git connectivity issues

## Steps

### Step 1: Reproduce with the same tool versions
Check which helm/kustomize versions ArgoCD runs, then render locally with those exact versions. Version differences in templating functions cause "works locally, fails in ArgoCD" constantly.
Expected output: the failure reproduced locally, or version skew identified.

### Step 2: For helm: template with the same values
Render with the same values files and parameters the Application specifies. Missing values files or wrong value overrides are the most common helm-side cause.
Expected output: the helm error reproduced with the real inputs.

### Step 3: For kustomize: build the exact overlay path
Run kustomize build on the exact path the Application points at, with the same kustomize version. Overlay composition errors (bad patches, missing bases) show up here clearly.
Expected output: the kustomize error isolated to a specific overlay or patch.

### Step 4: Read the repo-server logs for the full error
The UI truncates; the repo-server logs carry the complete generation error including the file and line. Get the full text before fixing; partial errors mislead.
Expected output: the complete error with file and line context.

### Step 5: Fix, commit, and verify generation
Fix the template, commit, and watch the app generate successfully. Add a CI step that renders with the pinned versions so generation errors fail PRs, not syncs.
Expected output: clean generation in ArgoCD; PR-time protection added.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_k_uVdPrLisYi3suLA3AAVw
