blitz.cloudPricingSign inPut your app onlineStart

We read 1,452 failed builds by hand. About 85% were our fault

One week of failed builds on our hosting platform, read one by one. Most of them were caused by our own registry, our retries and our error messages, not by the code people pushed.

·

My goal for builds is simple. Every build either goes green, or it fails because of something in your project, and then it tells you what to change. A build that fails because of us should not happen at all.

In late September I wasn't sure we were anywhere near that. The dashboards showed a lot of red, and every time I opened a failed build log it looked like the customer's fault. A missing dependency, a broken Dockerfile, something like that. So on 25 September we stopped guessing and read every single failed build from the previous seven days.

The numbers

2,304 builds in seven days, across 150 apps. 1,452 of them failed.

We went through them app by app: the log, the Dockerfile, the error summary we had shown the owner. For each failure we asked one question. Whose fault is this?

About 85% were ours.

That number hurt. I run blitz.cloud, and I had been telling myself that builds fail because people push broken code. People do push broken code. But most of the red came from our side.

What actually broke

The biggest causes, largest first.

The registry disk was full

From 21 to 24 September the disk under our container registry was full. 646 builds across 70 apps failed at the push step. On 22 and 23 September only 21 of 680 builds succeeded. We grew the disk by hand twice in that window and it filled up again each time.

The registry or its token endpoint didn't answer

About 350 more builds failed with 503s, 500s, EOFs, blob upload unknown and TLS timeouts. Most of those came in the overnight wave at 04:00, when we rebuild a lot of apps at once. This ended only when we moved the registry onto the platform's own servers on the afternoon of 25 September.

Our AI spending cap turned itself on by mistake

Builds for projects without a Dockerfile get one written by a model. We had a monthly spending cap on those calls. The cap counted calls on a flat subscription at list price, even though they cost us nothing extra, so it decided we were over budget and switched AI off for everyone from 20 September in the evening until 25 September. 123 builds across 37 apps failed because nobody wrote their recipe.

GitHub refused us at 04:00

We read public repositories anonymously. In the overnight wave GitHub started refusing those reads and clones, and our code turned the refusal into "no Dockerfile" or "could not read this project's files". 44 builds. The owners were told their project was broken when GitHub had simply said "slow down".

Our retry was useless

We did have one automatic retry. It started 0.05 seconds after the failure, right into the same outage. 268 of 324 retries failed the same way as the first try.

The fix couldn't deploy

We had a fix for the registry ready, and it waited 34 hours to go live. Our CI pipeline has a job for an unrelated service that pushes its image to our own registry, and the deploy job depended on it. The registry was broken, so that push failed, so the deploy never ran. We had made our own repair path depend on the thing that needed repairing.

The error message that lied

This one is my favourite, in a bad way.

245 builds had told their owners "Installing this project's dependencies failed". About 220 of those had no dependency error at all.

The classifier looked for patterns like pip install anywhere in the log. BuildKit prints a header line for every step, and that line contains the command:

#11 [6/8] RUN pip install --no-cache-dir -r requirements.txt && pip check

So any Python build that died for any reason after that step, a registry 503 during the push for example, got matched as a dependency failure. Here is the shape of the bug, simplified:

// before: any line mentioning pip counts as a dependency failure
if (log.contains("pip install")) return DEPENDENCIES_FAILED;

The fix was to never read project patterns against BuildKit's own step headers, and to check for failures on our side first, before any project pattern gets a chance.

One owner deleted a working Dockerfile because of this message. They did exactly what we told them to do. That's the cost of a confident wrong error message, and I think it's worse than a vague one.

What we changed

Most of it shipped the same evening.

  • Failures on our side are recognised before any project pattern, and the message says it's us.
  • Our failures are retried three times with real gaps in between, so the retry doesn't run straight into the same outage:
static final List<Duration> RERUN_DELAYS = List.of(
        Duration.ofMinutes(2), Duration.ofMinutes(10), Duration.ofMinutes(30));
  • A failed push is retried inside the build pod, and a build keeps one push token across its retries.
  • GitHub refusals are retried and never read as a missing file. Public projects are read from raw.githubusercontent.com, and cloned with the owner's token when there is one.
  • The overnight rebuild is spread over 90 minutes instead of starting everything at 04:00, and it no longer rebuilds a commit that failed for the project's own reason.
  • Bursts of pushes settle into one build.
  • The AI cap counts only calls that cost money, the admin overview says when it refuses, and builds that waited for AI are built again once it answers.
  • The deploy no longer waits for that unrelated CI job.

We also found four empty link files inside the registry storage. An empty link file makes the registry answer 500 for that layer, forever. One app had failed 27 times on a single one. We repaired those by hand.

Later the registry moved to object storage, so a full disk under it is not a thing anymore.

Did it work?

Partly. When we measured again on 18 October, 29% of final build failures were ours. That's a different cut than the September number, because it counts builds that stayed failed after the retries, so don't read it as "85 down to 29". But it's the number I watch now, and it's still not zero.

The difference is that I know what that 29% is made of, because the cause is now stored on the build row instead of being guessed from the log every time someone looks.

What I'd do differently

Store the cause from day one. We had a classifier, but its answer only lived in a message shown to the user. Nobody could count how often it was wrong. Once the class is a column, the question "how many failures were ours this week" is a query instead of a day of reading logs.

Build canaries. A small set of known-good public projects, one per stack, built every night and after every deploy. If a canary fails, that's our problem by definition, and we see it before a customer does.

Never let your repair path depend on the broken thing. The 34 hours still annoy me more than the full disk.

And read the failures yourself every now and then. Not a dashboard, the actual logs. I would never have found the pip header bug from a chart. It looked like a perfectly plausible error until you read the log right above it.

If you deploy from GitHub with us, the deploy from GitHub docs explain what a failed build tells you and what to do about it.

Put your first app online today.

Start on the free plan, no credit card. Move to Pro when an app has to stay online.

Put your app online