Agent fleet field notes / Field essay HM3

Backups do not fail loudly; they quietly stop finishing.

A string of incidents where a backup, sync service or daemon stopped succeeding without clearly telling me. The rule I took from them: alert on the age of the last proven success, not on errors.

Published

BACKUPS, HEALTH CHECKS AND ALERTING
FIELD ESSAY HM3 / AGENT FLEET FIELD NOTES

Backups do not fail loudly; they quietly stop finishing

How do you find out that a backup has stopped working? In my experience, not from an error. A backup that crashes loudly is the easy case. The ones that hurt me kept starting on schedule, kept writing logs, and stopped reaching the end. So the rule I work from now is: alert on the age of the last proven success, not on errors.

I run a fleet of AI agents across my own workstation, a shared Linux dev box and a few other machines. Their session logs are the record of what they did, so the logs are backed up to a cloud storage remote. Between late October and late November I collected a string of incidents with the same shape. Not all of them are backups, but in every one a scheduled or long-running process stopped succeeding and nothing clear told me.

Runs that never reach the end

On my workstation, the success marker for the agent log backup had been missing since 2026-11-13. The backup did a full checksum copy over about 7100 session folders. A read-only measurement showed that the remote lists one folder per request: 87 requests in 45 s. The fast-list flag did not help: 597 requests in 300 s. Listing alone took an hour against a 780 s limit, so no run could finish.

The fix, in agent-harness, keeps a ledger of files known to be on the remote and sends only what the ledger lacks. A content-hash reconcile has to prove the seed before the marker is written. That is the part I care about most: the marker should mean every source is proven on the remote, not that a command ran.

A systemd oneshot unit set to run every 15 minutes stops re-arming if one run never ends. That stopped backups on a build host from 2026-11-05 to 2026-11-07 with no alert. The fix was TimeoutStartSec=20min, because RuntimeMaxSec does nothing for oneshot units. Then on Nov 19, on the dev box, the runs were exiting 1 after about 12 minutes each, with rclone's request limiter running out of time under the host's share of the request budget. 1012 of the 1060 pending items were WAL files. The takeaway: a shared write limit needs per-host limits, or one noisy log directory starves everything else.

Runs that fail the same way every time

The second group did produce errors, over and over. Nothing turned them into a signal.

  • The cloud storage remote refuses .DS_Store and four other file names, and rclone treats each refusal as a hard error. The bulk copy on my workstation failed for two days. The pass in flight had been listed before the exclude edit, and the retry loop never relisted. The fix excludes the five names and counts a copy that exits 1 or 6 with only name refusals as copied. Any other error still fails the run.
  • A user-level sync service was reported failing "since Oct 26". The run ledger said Oct 20: 2359 consecutive failures, about 8 days. Its config was a symlink into a dated worktree that had been removed. The fleet-ops agent repointed the symlink to the copy in the deployed release, kept a backup and wrote a one-line rollback. Related: nothing that runs should live where cleanup can reach it.
  • A daemon in agent-fabric exited every minute, because it ran inside a helper whose context ends after 60 seconds. A request-scoped timeout reused for a long-lived service is a hidden crash timer.
  • A Linux dev box rebooted at 2026-11-12T03:14Z. The Postgres container had no restart policy, and the service unit gave up after StartLimitBurst=5. It was down for 15.5 hours. The only signal was a generic "failed user unit" alert among 72.

The reboot fix renders the units with no start limit and Restart=always, and adds a health timer every 2 minutes with a critical alert after 2 consecutive failed checks. The follow-up found that the alert forwarder ran a different copy of the watch script than the one the installer probed, so the passing probe had proved nothing.

A directory that looks like a backup

A release added a mandatory archive-policy declaration to one product's backup script, and three required env settings were never set. Since Oct 25 no backup completed. The refusal came after pg_dump, so the Oct 26 and Oct 27 directories held partial dumps with no SHA256SUMS file. A check that only asks whether last night's directory exists would pass on those. The Opus decision was that the fix is configuration only: no code change, and no deletion of the partial directories.

The alert that teaches you to ignore it

The opposite failure: a nightly backup at 03:00 UTC stops a service for about 12 seconds, and the health check sent two failing/recovered email pairs every night, since at least Oct 23.

I asked for the check to ignore the backup restart. The fleet-ops agent prepared a diff and did not apply it live, because the repo manages the unit and the next release would overwrite a live edit. The diff adds a quiet window of 03:00-03:12 UTC that suppresses opening a new incident, but a site still down at 03:12 alerts normally. It was checked by replaying that night's real reverse proxy log: the existing code produced 4 emails and the patched code produced 0. Tests went from 19/19 to 22/22. The change landed through a ticket.

Alert on the age of the last success

An error alert needs the failing run to start, reach the error, and report it somewhere a person reads. A freshness alert needs none of that. It asks one question from outside: when did this last provably succeed?

This is an illustration, not my production check:

# Illustration only: alert when the success marker is too old.
marker=/var/lib/backup/last-ok
max_age=7200   # seconds; set it from the schedule
now=$(date +%s)
last=$(stat -c %Y "$marker" 2>/dev/null || echo 0)
if [ $((now - last)) -gt "$max_age" ]; then
  echo "backup-stale: no proven success within ${max_age}s"
  exit 1
fi

It only works if the marker is honest, which is why the marker is written last, after the proof. Related: write the status from the ledger, not from memory.

Checklist

  1. Write the success marker only after the copy is proven on the remote.
  2. Alert when the marker is older than the schedule allows, under a specific alert name.
  3. Bound every scheduled run with a timeout, so a hung run cannot stop the timer.
  4. Put refusals before the slow step, and verify the checksum file, not the directory.
  5. Tolerate only a named benign error class, and count it so it stays visible.
  6. Give planned maintenance a quiet window that still alerts if the outage outlasts it.
  7. Prove a noise fix by replaying a real log, and probe the copy of the checker that actually runs.
CONNECTED READINGForward and back
Keep reading

The answer deserves
another experiment.

Back to the journal