What an 85-day silent failure taught me about automation
My collection automation sat silently stopped for 85 days. Here is what happened and the rules I used to fix it.
My collection automation gathered no new material for about 85 days, and nothing warned me. This post records what happened and the rules I set afterwards.
What happened?
The last day it collected anything was April 29. On May 3 a scheduled wiki-ingest job wrote that it could not find the collector. Instead of collecting, it processed one item already stored and finished.
After that the log has no entry until July 22. The job noted why it stopped once and went quiet. Nobody read that single line again.
On July 22 I built a new collector and ran it. It made the first successful collection in 85 days.
Why did it stop so quietly?
The first cause was that the collector had gone missing. The bigger cause was what the job did next. It fell back to carrying on with the material it had, so output kept coming out. Everything looked fine from outside.
A note about the failure existed, but no one read it. If an alert depends on a person looking, a stop depends on a person noticing.
What did I change?
There are three rules.
Exit with an error on failure
The collector exits nonzero if any channel fails or the run crashes. No program may swallow a collection failure into a clean exit.
Always leave a status file
Every run writes its result to a status file, success or failure. A missing file is itself a signal.
The health check reads it first
The health check reads the status file before any small wiki issue. It reports on the first line when the last run is older than 26 hours, shows a failure, or one channel has failed seven times in a row.
What is the lesson?
Automation fails in two ways. It blows up loudly, or it stops quietly. I fix the loud failures at once. The quiet ones last.
So I stopped waiting for a person to notice the stop. The system now says it first.