The Failover Drill That Took My Site Down
I ran the drill on a Thursday morning. Three minutes later my site was returning 404 to every visitor. The failover had worked perfectly. That was the problem.
I had just finished building automatic failover: a watcher that polls my Cloudflare Pages origin and, when it stays down, repoints my domain at a read-only mirror running in my homelab.
Everything was tested. The mirror passed twenty checks — every page, every API payload, content types, a real blog post rendering server-side. The watcher's decision logic had thirteen tests, and I had mutation-tested those: broke the logic deliberately in four different ways and confirmed each one turned a test red.
So I ran the rehearsal. Pointed the watcher at a hostname that does not exist, waited for it to move the record, and loaded my site.
404. From Cloudflare, on every path.
The one header I never sent
The watcher had done its job exactly right. It moved the DNS record from Pages to my mirror.
Then Cloudflare forwarded the request to my tunnel with the original Host: mocipher.com — and nothing in the failover path answered to that name. My tunnel matches on the Host header and had a rule for failover.mocipher.com, not the apex. My Traefik Ingress claimed the same subdomain. Both fell straight through to a catch-all 404.
Every test I had run reached the mirror by its own hostname. The one header a real failover actually produces was the one header I had never sent.
It is obvious written down. It was invisible from every angle I had checked from, because a failover is not "can this origin serve the site". It is "can this origin serve the site under the name it will be asked for".
The worse part
I had a validation script for my Kubernetes manifests. One of its checks asserted that the Ingress must not claim my apex domain — my reasoning being that the watcher owns that record, and two things claiming one hostname would conflict.
That reasoning was wrong. The watcher owns DNS. The Ingress owns Host routing behind the tunnel. They operate at different layers and never contend.
But I had not merely made a mistake. I had encoded it as an automated check, so it would keep being enforced, and anyone fixing it correctly would have been told by my own tooling that they were wrong. Being wrong is normal. Automating a wrong belief promotes it from a mistake to a policy.
Ten minutes I am glad I spent
Total downtime was about ten minutes, on a Thursday morning, on a personal site, with me watching.
The alternative was finding out during a real Pages outage — when the mirror was the only thing left standing and would have served 404s to everyone, and I would have been debugging Host header routing under pressure instead of over coffee.
Both rules now claim the apex. The deploy script refuses to finish unless Traefik actually routes that hostname to the mirror, checked from inside the cluster.
That check has to run in-cluster, incidentally, and that caught me out too. My first attempt tested it from outside with a forged Host header. It passed. It was meaningless: Cloudflare routes on the Host header at its own edge, so the request never reached my tunnel at all — it just went wherever my domain currently pointed and asked Pages whether Pages was up. A check that passes while the thing it claims to test is completely broken is worse than no check.
Then I re-ran the drill. Three failed checks moved traffic to the mirror, the site served from my flat, writes correctly returned 503, and five successes later the watcher moved it back on its own without me touching anything.
The actual lesson
A failover you have never exercised is a hypothesis with good documentation.
Testing it costs a few minutes of downtime that you choose, at a time you choose, while you are watching. Not testing it costs downtime you do not choose, at the worst possible moment, stacked on top of whatever outage triggered it.
Run the drill. It is supposed to be uncomfortable — that is the entire value.