Argo CD "SyncFailed" from a Sync or PostSync hook Job in CI
Sync and PostSync hooks run alongside or after the main apply. A failed hook Job marks the operation SyncFailed even when the main resources applied, because the hook is part of the sync contract.
What this error means
The operation reports "SyncFailed" with a hook Job named as the failing task, for example a PostSync smoke-test or notification Job that exited non-zero.
Operation has completed with phase: Failed
Message: one or more synchronization tasks completed unsuccessfully,
reason: Sync hook Job argocd/smoke-test failedCommon causes
The hook command failed
A smoke test, notification, or cleanup step in the hook Job returned nonzero, so the hook is failed.
The hook depends on resources not ready yet
A PostSync hook that probes the app can fail if it runs before the workload is actually healthy.
How to fix it
Inspect the hook Job and its timing
- Read the hook Job logs to see the exact failure.
- If it is a probe, ensure it waits for the workload to be Ready.
- Fix the hook, then re-sync.
kubectl -n argocd logs job/smoke-test --tail=100Pick the right hook phase
Use PostSync for checks that need the app up, and set a delete policy so retries start clean.
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
argocd.argoproj.io/hook-delete-policy: HookSucceededHow to prevent it
- Use PostSync for checks that require a healthy workload.
- Make hook Jobs idempotent and set a hook-delete-policy.
- Give probe hooks a retry or wait so they do not race the rollout.