Skip to content
Latchkey

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.

argocd
Operation has completed with phase: Failed
Message: one or more synchronization tasks completed unsuccessfully,
reason: Sync hook Job argocd/smoke-test failed

Common 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

  1. Read the hook Job logs to see the exact failure.
  2. If it is a probe, ensure it waits for the workload to be Ready.
  3. Fix the hook, then re-sync.
Terminal
kubectl -n argocd logs job/smoke-test --tail=100

Pick the right hook phase

Use PostSync for checks that need the app up, and set a delete policy so retries start clean.

hook-job.yaml
metadata:
  annotations:
    argocd.argoproj.io/hook: PostSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded

How 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.

Frequently asked questions

What causes ""SyncFailed ... hook" Job error"?
A smoke test, notification, or cleanup step in the hook Job returned nonzero, so the hook is failed.
How do I fix "SyncFailed ... hook" Job error?
Inspect the hook Job and its timing

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card