Argo CD "SyncError: one or more objects failed to apply" in CI
Argo CD applied your manifests to the cluster and at least one object was rejected. The SyncError condition names each object and the API server error, which is the actual reason the apply failed.
What this error means
argocd app sync exits non-zero with "SyncError: one or more objects failed to apply" and a per-resource message such as a validation error, a webhook denial, or "the server could not find the requested resource".
FATA[0011] rpc error: code = FailedPrecondition desc = one or more objects failed to apply,
reason: Deployment.apps "api" is invalid: spec.template.spec.containers[0].image:
Required valueCommon causes
A resource is invalid or violates a policy
The API server or an admission webhook rejected the object. The reason string names the field or policy that failed.
A dependency was applied out of order
A resource references a namespace, CRD, or secret that did not exist yet, so the apply of the dependent object failed.
How to fix it
Read each per-object reason
- Run
argocd app sync <app>and read every "reason:" line, not just the summary. - Fix the named field, policy violation, or missing dependency.
- Re-sync and confirm all resources report Synced.
argocd app sync my-app
argocd app get my-app --output wideOrder dependencies with sync waves
Annotate prerequisites (namespaces, CRDs) with a lower wave so they apply before the resources that need them.
metadata:
annotations:
argocd.argoproj.io/sync-wave: "-1"How to prevent it
- Validate manifests (kubeconform / kubectl apply --dry-run=server) before sync.
- Use sync waves so namespaces and CRDs apply before dependents.
- Read every per-object reason, since one summary can hide several failures.