Skip to content
Green is not the same as right: four silent failures and what they taught

Green is not the same as right: four silent failures and what they taught

· Bert Altena

The most expensive failures give no error message. Four real cases from a booking platform, and what now makes sure they cannot come back silently.

The failures that cost the most are not the ones that give a red screen. Someone sees a red screen straight away. The expensive failures are the silent ones: everything seems to work, the check is green, and only days later does someone miss something.

This summer and autumn I came across four of them on a booking platform that worked exactly like that. They resemble each other, and that is why they are instructive.

1. All scheduled jobs silent at once

On 1 August not a single scheduled job was running on the live system. All thirteen were down: no confirmation mail, no reminder, no request for the remaining payment.

The cause was a line at the top of a shared controller that loaded a library with a relative path. From the website that happened to work, because the working directory is then the web folder. A scheduled job starts from a different folder, so there it failed before the job itself even began. And because all jobs run through the same class, everything fell over at once.

Nobody saw it because of the last part of the crontab line: all output went nowhere. There was no trace.

What is in place now: every scheduled job runs through a wrapper that writes the outcome to a log, with the duration and the start of the response. If that line cannot be written, the wrapper says so out loud. A heavy dependency is only loaded where it is needed, so a missing library affects at most that one job. And the mail jobs look back seven days, so a missed day does not mean a mail is lost for good.

2. 136 texts empty at a single moment

On 29 August at 10:35, 136 content files of the website lost their text in one go. Blog articles in every language, plus a few pages. Nobody had saved anything.

In the admin it looked normal: title, intro, category and photo were still there. Only the text was gone. It was only noticed on the website, days later, and the texts were not in version control and not in the backups.

Several roads turned out to lead there. A batch job read a file at the very moment another request was rewriting it. A write in PHP first empties a file and then writes it, so the batch saw an empty text and simply wrote it back. On top of that, a save that did not send the text field could write the text as empty, and a cleaning function returned nothing instead of the text when it hit an odd character from pasted Word text.

What is in place now: every write to a content file goes through one function. It refuses to empty an existing text, writes next to the file first and then swaps it into place in one step, and keeps the previous three versions outside the web folder. A batch that gets back an empty field where something should be skips that item and reports it. Reading empty is a reason to stop, not to write.

3. A migration that said "ok"

A migration adjusts the database after a deploy: an extra column, new texts. The runner wrote "ok" as soon as no single statement gave an error.

That sounds reasonable, but it is not the same as "succeeded". A migration can stop halfway on a detail, after which the rest of the file never runs. And migrations only ran when someone opened the right screen after the deploy.

What is in place now: after each file, the runner checks again whether every column, table and text is really there. If anything is missing, the result is "failed", with the names. Migrations run straight after the deploy, without a browser. And a failed migration shows as a red bar at the top of the admin and goes into the nightly mail, once per problem.

4. A white page after logging in

On 2 October, owners and administrators got a white page after logging in to the calendar management. The first diagnosis was a missing database column. It turned out to be there.

The real cause sat in an in-house database function that splits a list of fields on commas and throws away empty pieces. In PHP, the text "0" counts as empty. A formula with a lone 0 between two commas therefore lost its 0, became invalid SQL, and on PHP 8.4 that is an immediate hard error.

The formula was rewritten with the same result. More importantly, the trap is now a rule in the working agreements, so it does not get built again in the next formula. And the first, wrong diagnosis also produced something: a guard that checks whether that column exists, because without it every new booking would fail.

What the four have in common

In all four cases the system worked as it was built. There was simply nothing that checked the outcome. That is the lesson: do not check whether there was an error message, check whether the result is there.

So since October there has been a fixed agreement. Every failure found becomes a check. Whoever fixes a failure adds, in the same change, a rule to the scanner that recognises the pattern from then on, and runs that rule on the old version to see that it would have caught it. If the pattern cannot become a rule, the delivery says why not.

On top of that came a weekly check of the bundled libraries against the known vulnerability lists. The first run found real ones: a high-severity vulnerability in the PDF library, two in components of the mail sending library, and 62 JavaScript files with old versions. Those are not faults in our own code, but they are in what runs.

A nightly check also reports by itself when something is red, and puts a proven bug in the code on the board as a task, but only if the file is still exactly the one that was scanned.

What I take from this

At the start of August I wrote about from building to securing: a week without new features to get the foundations in order. These four cases show that securing is not a week but a habit.

Three questions I have asked with every change since. What happens if this fails, and does anyone see it? Does something check the outcome, or only whether there was an error? And can this failure come back without a check seeing it?

More of the platform is in the portfolio. If you recognise this in your own system, I am happy to think along via the contact page.

Frequently Asked Questions

What is a silent failure?
A failure that raises no alarm. The screen looks normal, the job seems to have run, the check is green, but the result is wrong. You only notice when a customer or colleague misses something.
How do you stop a silent failure from coming back?
By turning every failure you find into a check that recognises the pattern from then on, and by checking outcomes instead of only checking whether there was an error message. A migration has only succeeded when what it creates is actually there.
Should you also check other people's libraries?
Yes. A bundled library can have a known vulnerability without your own code doing anything wrong. A weekly check against the known lists found real vulnerabilities in its very first run.
Chat met ons