What happened
A CNCF blog post describes a customer release pushed during an Argo CD deny sync window. When the window closed, five regional Applications rolled out the same commit. Three ran the database migration hook and two did not, so the new code ran against an old schema for 36 to 44 minutes. The author traced it to a race: depending on which kind of refresh arrives first after the window closes, Argo CD may treat the change as drift to heal. That produces a partial sync, which skips hooks.
Why it matters
The dangerous part is that everything looks fine. The affected Applications showed Synced and Healthy, and the last operation reported success. Teams without a platform team often rely on exactly that signal to sign off a release.
If you run automated sync with self-heal, use deny windows, and run migrations as Sync hook Jobs, you are in the pattern described. The author reproduced it in a lab five times out of six. Their reading of the code is that changing the hook to PreSync, shortening the window or enabling the newer partial-sync hook option would not change the outcome. They did not test those three, so verify for yourself.
The wider lesson is that a hook only runs when a certain kind of operation runs. If a release can reach the cluster another way, the hook is a hope, not a guarantee.
What to do this week
- List which of your Applications use automated sync with self-heal and also have a deny sync window on the project.
- Find any database migrations, or other critical steps, that run as Sync hooks.
- After any release that waited on a window, check the migration Job’s release label or output, not just the Application status.
- Consider the fix the author recommends: drop the hook annotations, put the Job in an earlier sync wave, and give it a name that changes each release, such as one including the image tag.
- Keep prune enabled so old migration Jobs are cleaned up, and test the change in a non-production Application first.
Need a hand?
Moving migrations out of hooks and into your delivery pipeline safely is the kind of CI/CD work we do regularly. We can review your Argo CD setup, sync windows and release flow with you. See our CI/CD service; the first call is free and is with an engineer.
Source: When a sync window closes: How Argo CD self-heal skipped the migration hook
Related service: CI/CD Pipelines