Six characters in the wrong place

The line was short enough to miss and heavy enough to eat an entire deployment day:

labels: - traefik.enable=false 

Six characters, misplaced. Three hours of debugging. By the end of that day, the blog answered in 0.289 seconds and my notebook was full.

The plan: a full publishing stack on a small VPS

I am building a magazine about startup workflows: Ghost as the publishing core, newsletter manager, and Stripe-based paid tiers in one. The stack had to run on a small VPS for a few euros a month, entirely in Docker. After some testing, the list looked like this:

  • Ghost as the publishing core, newsletter manager, and Stripe integration
  • Traefik v3 as the reverse proxy with automatic TLS from Let's Encrypt
  • MySQL 8 and Postgres for Ghost and the analytics instance
  • CrowdSec as the WAF: detection engine plus AppSec component, docked onto Traefik as a plugin
  • Umami for privacy-friendly web analytics on the same box

WordPress plus Listmonk fell to the maintenance overhead of two systems and their RAM hunger. Astro or Hugo would have been the leanest option, but they would have cost me the admin panel and the editorial workflow that a research-heavy format depends on.

One detail matters for this story: the CrowdSec wiring came from the official example of the Traefik bouncer plugin. As it turned out, the answer to my most expensive problem was sitting right there, in writing, while I spent three hours searching in the wrong place.

The day everything tipped over

Deployment day. The infrastructure came up, and then it fell apart. Not once, but on eight levels. Six layers were owed to the realities of an individual server setup (and one wrong trail while fixing things); two were owed to the AI assistant that helped write the config.

The environment layers

The firewall tangle. The host firewall ran policy drop on the forward chain. Unremarkable for a classic single server, but with Docker, traffic between bridge networks passes through exactly that chain. The daemon pulled images happily while container-to-container communication died. The interplay is documented, but its full force only becomes visible when your ACME challenges start failing.

The packet size that was (probably) innocent. Two fixes went live the same evening: a rule for the forward chain, and MTU 1400 on all Docker networks. Everything worked. And when two changes ship together, success gets credited to whichever theory fits: containers were calling TLS endpoints, there were timeouts, so smaller frames, done. One day later, the control experiment: a fresh test network with no MTU intervention at all, default 1500, downloading the exact URL that had hung before. It went through cleanly. The firewall had long been fixed; the packet size had never been the problem. The honest lesson: we never tested the MTU in isolation, and the host firewall was the real culprit. The 1400 stays anyway, as free insurance, not as proof.

The bind-mount trap. When a container starts, Docker creates missing host files as empty directories. That produced a stubborn crash loop that even a regular container restart could not escape.

The egress failures. The CrowdSec container intermittently reached only some of its target services, while inbound requests were processed without complaint. The cause only emerged after cleanly separating the network layer from the container layer, a classic symptom of hidden packet filter rules.

The one line

The seventh layer was the expensive one. The bouncer was supposed to sit between Traefik and the origin servers as a middleware, checking every incoming request against the CrowdSec database.

The first AI draft placed the middleware declaration on the Traefik service itself, together with traefik.enable=false, so that Traefik would not expose itself. The problem: the Docker provider ignores containers carrying that label, completely. No middleware gets created. There is not even an error message, as long as no router references it.

The moment routers did reference it: middleware "crowdsec@docker" does not exist. The hunt then went in the wrong direction: the file provider, rewriting references from @docker to @file, until every request died after exactly 30 seconds, Traefik's forward timeout, while the log stayed silent.

The lesson in one sentence: A configuration on a container that Traefik ignores is not misconfigured. For Traefik, it simply does not exist.

The final fix was almost embarrassing. In the plugin's official example setup, the middleware declaration sits on an active backend service, while traefik.enable=false belongs on the CrowdSec container that must not be reachable from outside.

Lessons learned

  1. Read the upstream docs first, then improvise. The most expensive error was not missing Traefik knowledge but the blind adoption of an altered pattern. The official example config shows exactly where the middleware labels belong.
  2. One change per test, or nobody knows what helped. Two fixes in one commit produce a causal attribution that feels right and can be wrong. The next-day retest flipped our MTU theory in favor of the firewall we had repaired in parallel.
  3. Think Docker traffic and firewall rules together. If you run policy drop and containers, you need explicit rules for the Docker bridges.
  4. Create config files before the first start. A quick touch before docker compose up -d keeps Docker from mounting directories instead of files.
  5. Categorize errors after every session: environment, operator, or tool. Each category demands a different response.
  6. Review AI output like a contractor's draft. The same assistant that delivered useful research also invented a middleware placement that exists nowhere in the docs. Verifying against the official standard is not distrust; it is editorial diligence, for infrastructure code just as much as for market data.

Conclusion

The morning after, the site answered in 0.289 seconds. The stack runs stable: TLS from Let's Encrypt, every request passes the CrowdSec check, mail via SES is ready, backups are in place.

What stays is the real insight of that day: not the eight failures themselves, but how to work with AI as a tool without letting its confident guesses pass. Those three hours taught exactly the working method that every future analysis on this blog profits from.

A deployment can fail. Editorial diligence must not.

This is the English edition of a piece that originally ran on my blog (in German). Transparency note: the blog is a live prototype for an automated content pipeline; posts are AI-assisted and then human-reviewed, edited, and approved.