NETWORK INCIDENTS

One Config File Doubled and Every Server Failed: Replaying Cloudflare's November 2025 Outage

Network+ 5.1 Troubleshooting methodologyNetwork+ 3.1 Change management and configuration management

On the 18th of November 2025, Cloudflare's network began failing to deliver core traffic. Its post-mortem traces it to a database permissions change that doubled the size of a generated file, past a limit in the software that reads it. This lab isn't Cloudflare's system. It rebuilds that failure pattern, so we can watch it happen and fix it.

Three edge proxies sit in front of one origin web server. Every 20 seconds a generator builds a feature file from one of two database replicas and pushes it to all three edges, which have room for 200 features.

Incident replay: a lab model of the failure pattern in Cloudflare's post-mortem of 18 November 2025 (https://blog.cloudflare.com/18-november-2025-outage/), not Cloudflare's systems.

The symptom. From the client, all three edges (10.0.20.11-13) answer 500. Before that they failed and recovered in turn.

The lab

A visitor on the left reaches three edge proxies through a router. The edges pass requests on to one origin server. Each edge also loads a feature file, and has room for at most 200 features. The generator builds that file from one of two database replicas, and pushes it to all three edges at once. Here it does that every 20 seconds; Cloudflare's post says its file was generated every five minutes. Its limit was also 200, with about 60 features in use. This lab uses 120 features, so that doubling the file is enough to cross the limit.

The symptom

on client
for e in 11 12 13; do curl -s -o /dev/null -w "10.0.20.$e %{http_code}\n" http://10.0.20.$e; done
10.0.20.11 500
10.0.20.12 500
10.0.20.13 500
What this shows

From the visitor's side, this loop asks each of the three edges for the site, and prints only the HTTP status code. All three answer 500, an internal server error. Not one edge, every edge at once.

Narrowing it down

on edge1
curl -s http://10.0.20.80
<!doctype html>
<title>shop.homelab.test</title>
<h1>It works</h1>
<p>Served by the origin, 10.0.20.80.</p>
What this shows

So is the site itself down? From edge1, curl asks the origin directly. The page comes back: It works. The origin is fine. The failure is in the edges.

on edge1
cat /var/log/proxy.log
16:05:06 loaded feature file v1: 120 features
16:05:26 loaded feature file v2: 120 features
16:05:46 loaded feature file v3: 120 features
16:06:06 PANIC feature file v4: 240 features exceeds limit 200
16:06:26 loaded feature file v5: 120 features
16:06:46 PANIC feature file v6: 240 features exceeds limit 200
16:07:06 PANIC feature file v7: 240 features exceeds limit 200
16:07:26 PANIC feature file v8: 240 features exceeds limit 200
16:07:46 PANIC feature file v9: 240 features exceeds limit 200
What this shows

edge1's log shows every feature file it has loaded. A new one arrives every 20 seconds. v1 to v3 load, with 120 features each. Then v4 has 240 features, over the limit of 200, and the proxy panics. v5 loads fine again. v6 panics. From v7 on, every file panics. So the edges were failing and recovering in turn before they stayed down. Cloudflare saw the same rhythm, and its post says that at first, it made them suspect an attack.

on edge1
grep -vc '^#' /etc/proxy/features.txt
240
What this shows

Here's the file edge1 has now. grep counts the lines that aren't comments, one per feature: 240.

on edge1
grep -v '^#' /etc/proxy/features.txt | sort | uniq -d | wc -l
120
What this shows

This counts the lines that appear more than once: 120. So it's the same 120 features as before, each one in the file twice.

Finding the cause

on gen
cat /var/log/featuregen.log
16:05:06 v1 replica-a: 120 features, pushed to edge1 edge2 edge3
16:05:26 v2 replica-b: 120 features, pushed to edge1 edge2 edge3
16:05:46 v3 replica-a: 120 features, pushed to edge1 edge2 edge3
16:06:06 v4 replica-b: 240 features, pushed to edge1 edge2 edge3
16:06:26 v5 replica-a: 120 features, pushed to edge1 edge2 edge3
16:06:46 v6 replica-b: 240 features, pushed to edge1 edge2 edge3
16:07:06 v7 replica-a: 240 features, pushed to edge1 edge2 edge3
16:07:26 v8 replica-b: 240 features, pushed to edge1 edge2 edge3
16:07:46 v9 replica-a: 240 features, pushed to edge1 edge2 edge3
16:08:06 v10 replica-b: 240 features, pushed to edge1 edge2 edge3
What this shows

On the generator, its log shows where each file came from. Odd versions are built from replica-a, even ones from replica-b. replica-b went to 240 features first, at v4, while replica-a still gave 120 at v5. Then from v7, replica-a gives 240 too. That's the flapping: good or bad depended on which replica the file was built from, until both had changed. Each bad file went to all three edges.

on gen
cat /opt/featuregen/query.sql
SELECT name, type
FROM system_columns
WHERE tbl = 'http_requests_features'
ORDER BY name;
What this shows

This is the query the generator runs. It asks for every column of the http_requests_features table. Notice what it doesn't ask: which database that table is in.

on gen
dbq replica-a "SELECT database, count(*) FROM system_columns GROUP BY database"
database  count(*)
default   120
r0        120
What this shows

dbq runs a query on one replica. Grouped by database, the same table now shows up twice: 120 columns in default, and 120 more in r0.

on gen
dbq replica-a "SELECT * FROM grants"
user        database
featuregen  default
featuregen  r0
What this shows

And this is why. The generator's user now has a grant on r0 as well as on default, so it can see both. That's the permissions change. The query didn't change, but its answer doubled. Cloudflare's post describes the same thing: a query that didn't filter by database name, which started returning duplicates after a change to make access explicit.

The fix

on gen
pkill -f 'featuregen run'
(no output)
What this shows

The fix comes in two parts. First, stop the generator, so no new bad file goes out. Cloudflare's first step was the same: it stopped creating and propagating new feature files.

on gen
featuregen push /var/lib/featuregen/v5.txt
edge1: loaded feature file v5: 120 features
edge2: loaded feature file v5: 120 features
edge3: loaded feature file v5: 120 features
What this shows

Then push a file that's known to work. The edge log showed v5 as the last one that loaded. All three edges load it: 120 features. Cloudflare inserted a known good file by hand and then restarted its proxy. Our lab proxy recovers when a good file arrives, so it doesn't need a restart.

on client
for e in 11 12 13; do curl -s -o /dev/null -w "10.0.20.$e %{http_code}\n" http://10.0.20.$e; done
10.0.20.11 200
10.0.20.12 200
10.0.20.13 200
What this shows

From the visitor again: all three edges answer 200. The site is back.

Keeping it from happening again

on gen
featuregen start --max-features 200 --canary edge1
featuregen started (pid 6951): a new file every 20 s
  max features: 200
  canary:       edge1
What this shows

But the database still gives 240 features, and the generator has to run again. This time it starts with two checks, and it prints them as it starts. Max features 200: a file bigger than the edges can load isn't pushed at all. Canary edge1: a file goes to edge1 first, and only reaches the other two if edge1 still serves the site.

on gen
tail -n 1 /var/log/featuregen.log
16:08:53 v12 replica-b: 240 features, over limit 200, not pushed
What this shows

The first file it built, v12, has 240 features: over the limit, not pushed. The edges keep v5 and keep serving. The bad data is still there, but it no longer reaches the edges.

on gen
sed -i "s/^WHERE /WHERE database = 'default' AND /" /opt/featuregen/query.sql
(no output)
What this shows

Now the cause. sed adds the missing condition to the query: the default database only.

on gen
cat /opt/featuregen/query.sql
SELECT name, type
FROM system_columns
WHERE database = 'default' AND tbl = 'http_requests_features'
ORDER BY name;
What this shows

The query now says which database it wants.

on gen
tail -n 2 /var/log/featuregen.log
16:08:53 v12 replica-b: 240 features, over limit 200, not pushed
16:09:13 v13 replica-a: 120 features, canary edge1 ok, pushed to edge2 edge3
What this shows

The next file, v13, has 120 features. It went to edge1 first, edge1 still served, and then it went to edge2 and edge3.

Why it broke

So why did every edge fail at once? Nothing in the edges changed. A file the system built for itself grew past a limit, and it was sent to every edge together. The fix that lasts treats that generated file like any other input: check it before it ships. Cloudflare lists this first among its fixes. And send a change to one machine before all of them, so a bad file takes down one edge, not every edge.

Generated config is still input

When servers fail together, look at what reaches them all at once. And when a failure comes and goes on a steady rhythm, look for what runs on that rhythm.

Try it yourself

The whole lab runs on your own computer with Docker and containerlab: get it on GitHub, then ./lab.sh up and ./lab.sh break. Setup steps are on Run the labs.