Dispatch is now Wireletter
One blank policy row took down Cloudflare for 2 hours and 28 minutes

The Build Log

One blank policy row took down Cloudflare for 2 hours and 28 minutes

How it broke, how they fixed it. On June 12, 2025, Cloudflare went down around the world. The cause was not an attack. It was a blank field in a policy row, written into a database, and a code path with no check for it.

D

Devon Marsh

Nov 23, 2026 · 8 min read

ShareEmail

How it broke, how they fixed it.

On June 12, 2025, Cloudflare went down around the world. The cause was not an attack. It was a blank field in a policy row, written into a database, and a code path with no check for it.

The system

Workers KV is Cloudflare's key-value store. Many Cloudflare products keep their own config, identity data, and routing data in it. KV is built to run in every location with no single point of failure. But it still relies on one central store as its source of truth. That central store is where the cold reads and writes go.

Part of that central store sat on a third-party cloud provider. Cloudflare had removed one of its two storage providers while it re-architected the KV backend. That left a coverage gap. The gap is what the incident exposed.

The timeline

  • 17:45 UTC, June 12, 2025. A policy change with blank fields is written into Google Cloud's Spanner database. It replicates to every region at once.
  • 17:51 UTC. Google Cloud's Service Control binaries start to crash. Service Control checks every API call for permission and quota. The new quota code, added May 29, 2025, has no error handling and no feature flag. The blank field hits a null pointer. Every binary crashes in a loop.
  • 17:52 UTC. Cloudflare's WARP team sees new device registrations fail. This is the start of the Cloudflare incident.
  • 18:05 UTC. Cloudflare's Access team is paged. Error rates spike.
  • 18:06 UTC. Cloudflare declares a P1 incident.
  • 18:21 UTC. Cloudflare escalates to P0.
  • 18:43 UTC. Cloudflare starts to decouple Access from Workers KV.
  • 19:09 UTC. Gateway starts graceful degradation.
  • 19:32 UTC. Load shedding begins.
  • 20:23 UTC. The storage vendor comes back online. Recovery starts.
  • 20:25 UTC. Access and Device Posture return to normal.
  • 20:28 UTC. Service levels return to pre-incident levels. The impact ends.
  • 22:00 UTC. Cloudflare publishes its postmortem, four hours after the impact ends.

Google's own report says its team found the root cause in 10 minutes. Its red button kill switch was ready in about 25 minutes and fully rolled out in 40 minutes.

The numbers

  • 2 hours and 28 minutes. That is the length Cloudflare reports for its outage.
  • 90.22 percent. That is the share of Workers KV requests that failed when the value was not in cache and had to come from origin storage. Cached requests kept working.
  • 100 percent. That is the share of Cloudflare Access identity-based logins that failed. Access failed closed. It could not read policy or identity, so it locked everyone out rather than let anyone in.
  • Over 90 percent. That is the Stream error rate. Stream Live hit a 100 percent error rate.
  • Zero. That is the amount of data lost. Cloudflare reports no data loss.
  • Not affected. DNS, cache, proxy, WAF, Magic Transit, and Magic WAN kept working through the whole incident.

The diagram

Picture four boxes in a row.

Box one is the policy row. It holds a quota rule with blank fields. It is written once, and it copies to every region.

Box two is Service Control. It reads the row for every API call. It has no null check. It crashes, restarts, and crashes again.

Box three is the third-party storage under Workers KV. It depends on Service Control. When Service Control dies, the store stops answering.

Box four is Workers KV, and everything built on it. Access cannot read identity. WARP cannot register devices. Workers AI cannot route inference. The failure runs down the chain, one box at a time.

The fix ran up the chain in reverse. Kill the bad policy path first. Then decouple Access from KV. Then shed load. Then let the store come back, and refill the caches slowly so they do not overload the store again.

The lesson

The bug was one missing null check. The outage was the architecture around it. One blank row reached every region because the policy store replicates globally. One store held the source of truth for a dozen products. One provider sat under that store after the second provider was removed.

Cloudflare said it plainly in its postmortem. The third party failed, but the choice of dependency and the architecture around it were Cloudflare's own. Google said the same about its code. The change had no error handling and no feature flag. Both companies blamed themselves.

The fix that matters most is the boring one. Cloudflare is moving KV's central store to its own R2 service, so no single outside provider can take it down. Google's fix is a kill switch and a rule that new policy code ships behind a flag.

Premium: The diagram pack and runbook. The full failure chain diagram, a runbook checklist with thresholds, and the template library for your own system. $15 a month or $150 a year. Upgrade here: https://dispatch.nshipyard.com/build-log. Free readers stop here. Paying readers get the section below.

Premium: The diagram pack and runbook

The failure chain, step by step

  1. A policy change is written with blank fields. Source: Google Cloud incident report, June 13, 2025. The row lands in regional Spanner tables at about 17:45 UTC.
  2. Spanner replicates the row to every region. No region is spared, because the replication is global by design.
  3. Service Control reads the row for each API call. The quota code added May 29, 2025 has no null check and no feature flag. The blank field causes a null pointer. The binary crashes.
  4. The binary restarts and reads the same row. It crashes again. This is a crash loop, not a one-off error.
  5. External APIs return 503. Google's core API errors run for 3 hours.
  6. The third-party storage under Cloudflare Workers KV depends on Google Cloud. It stops answering.
  7. Workers KV cold reads and writes fail. The failure rate is 90.22 percent for uncached origin reads.
  8. Access cannot read identity data. It fails closed. 100 percent of identity-based logins fail.
  9. WARP cannot register new devices. Gateway, Stream, Workers AI, Turnstile, Images, and the Dashboard degrade or fail.
  10. DNS, cache, proxy, WAF, Magic Transit, and Magic WAN keep working. They do not depend on KV.

The numbers that prove the fix

  • 10 minutes. Google's time from first alert to root cause identified.
  • 40 minutes. Time for the red button kill switch to reach every region.
  • 20:23 UTC. Storage vendor back online. Recovery starts.
  • 20:25 UTC. Access and Device Posture back to normal. That is 2 minutes after recovery starts.
  • 20:28 UTC. Service levels back to pre-incident levels. That is 5 minutes after recovery starts.
  • 90.22 percent to normal. KV failure rate falls to within its normal error budget.
  • 100 percent to normal. Access logins work again.
  • Zero data lost. The postmortem states this directly. No customer data was lost in the incident.

The runbook checklist

Use this checklist the next time a shared dependency fails. Copy it, then adapt it to your system.

  1. Name the dependency. Write down the one service your system cannot run without. If you cannot name it, you have not mapped it.
  2. Check the blast radius. List every product that reads from that dependency. Cloudflare's list had 11 products. Your list is your first page in the incident.
  3. Check the failure mode. Does each product fail open or fail closed? Access failed closed and locked users out. Decide in advance which mode each product must use.
  4. Find the kill switch. There must be one switch that turns off the bad path without a deploy. Google's red button took 40 minutes to roll out. Yours must be tested, not assumed.
  5. Decouple the critical path. Access was decoupled from KV at 18:43 UTC, 51 minutes after the incident started. Write the decoupling steps before the incident, not during it.
  6. Shed load early. Gateway degraded at 19:09 UTC. Load shedding started at 19:32 UTC. Shed load before the system sheds it for you.
  7. Refill caches slowly. After storage returned at 20:23 UTC, cache refills caused rate limits until 20:28 UTC. Add a ramp to every cache refill. Never let recovery cause a second outage.
  8. Flag every new policy path. The May 29 code had no feature flag. No policy code ships without a flag and a rollback plan.
  9. Guard every nullable field. The blank field caused a null pointer. Add a null check and a default for every field a policy row can carry.
  10. Test the second provider. Cloudflare removed a storage provider and left a coverage gap. If you run two providers, test failover to the second one every quarter. A provider you never test is a provider you do not have.
  11. Publish the postmortem fast. Cloudflare published in 4 hours. Speed builds trust. Delay builds rumours.
  12. Own the dependency choice. Cloudflare wrote that it is responsible for its chosen dependencies and how it architects around them. Put that line in your own postmortem template.

Template library

  • Incident timeline template: time, event, who acted, what changed. One row per action. No adjectives.
  • Blast radius template: dependency, products that read it, failure mode per product, owner per product.
  • Kill switch template: switch name, what it turns off, who can flip it, last test date.
  • Postmortem template: what happened, the timeline, the numbers, the root cause, the fix, the follow-up work with owners and dates.

Sources

This letter serves software engineers and engineering managers. You run systems that break in the night. You want the failure and the fix, in plain order. Every story starts from a public postmortem. We draw the diagram from the real system. We show the numbers that proved the fix worked. Free readers get one real build story a week. Each free issue holds the diagram, the failure, and the fix. You can follow each step in order. A new issue arrives once a week. It follows one incident from first alarm to last check. The steps stay in the order they happened. Paying readers get the diagram pack and runbook. It holds the full failure chain diagram, a runbook checklist with thresholds, and the template library for your own system. The price is $15 a month or $150 a year. Dispatch has no paid billing yet, so nothing charges today.

Never miss an issue of The Build Log

One email at a time. Unsubscribe anytime.

Free forever. Unsubscribe anytime.

Powered by Wireletter

← Back to The Build Log