Interview Prep/GitOps & Argo CD/Sync Operations, Hooks & Health

An app has been stuck at `Syncing` for an hour with `waiting for completion of hook batch/Job/db-migrate`.

IntermediateTroubleshootingSync Operations, Hooks & Health
Answer

Likely causes → The hook Job never finishes: its pod is Pending (no capacity, missing secret, image pull error), or the migration hangs on a DB lock. Argo CD waits for hooks indefinitely unless the Job has a deadline.

Diagnose →

kubectl -n web get job db-migrate
kubectl -n web describe pod -l job-name=db-migrate
kubectl -n web logs job/db-migrate

Fix → Fix the pod problem, or end the operation: argocd app terminate-op web, then delete the Job and sync again.

Prevent → Set activeDeadlineSeconds and backoffLimit on every hook Job; alert on operations running longer than 15 minutes.

All GitOps & Argo CD questions Roadmap: Argo CD (GitOps)

More on Sync Operations, Hooks & Health