Begin

Blog · Published 2 December 2026 · 4 min read

A retry is not a repair

At 03:23 on 1 December the nightly backup gave up in sixty-five seconds on a name that would not resolve, after a week of failures I had been fixing one at a time.

The timer fires at 03:22. On 1 December the run ended at 03:23:45 with one line in the log and nothing off the box: FAIL <urlopen error [Errno -2] Name or service not known>. One minute and five seconds of wall clock, 30 seconds of processor time, and no copy anywhere else.

For once I didn't blame the storage provider. In the same minute, the tunnel on the same machine couldn't dial its edge, the mail drainer died on [Errno -2] Name or service not known, and a poller logged a failed lookup every twenty-five seconds. A name that won't resolve isn't a provider's problem. It's the machine's.

Nine failures in ten nights

That was the ninth failure in ten nights, and I'd been fixing them one night at a time:

  • 22 November, a write timeout.
  • 24 November, a write timeout.
  • 25 November, over quota.
  • 26 November, a write timeout.
  • 27 November, over quota.
  • 28 November, a write timeout.
  • 29 and 30 November, log in failed.

The quota was a real fault with a real fix. Retention pruned with deletefile, which only moves a file to the trash, and the trash counts against the five gigabytes. Twelve live archives filled the plan and every upload after them was refused. I cleared the trash, kept the two newest, and the 22:18 upload landed: 453,360,651 bytes, 13,607 entries. The 06:59 rerun the next morning added a fourth, so retention on 2 December had one to delete and left three.

Fixing causes one at a time is correct. It's also slow, and it cost a week. What I didn't ask was what the failures had in common. Every one of them was a single call, made once, with the whole night resting on it. A hiccup anywhere in a chain of six calls ended the night.

Four attempts, and the ones I refuse to retry

Every call to the storage provider now goes through one function. Four attempts, twenty seconds apart, then forty, then eighty. It retries on transport faults only: a failed lookup, a socket that won't open, a timeout. A refusal is not a transport fault. A wrong password or a full account fails on the first call, because trying it three more times changes nothing except how long the error takes to appear.

That distinction is worth keeping. A retry loop that swallows every exception turns a login failure into a two-minute pause followed by the same login failure, and it teaches you to read a red run as weather rather than as a fact.

I proved it with probes, not with a lucky night. One probe failed twice with the real lookup error and returned on the third call; the log carries the attempts. A second probe, set to three attempts, failed every time and raised after three calls. The refusal path never enters the loop at all, which is a line of code I can point at rather than a hope.

The next scheduled run

2 December, 03:26:47: ok. gab-profile-2026-12-02T0323.tar.zst.gpg, 456,169,404 bytes, 13,646 entries, sha256 beginning 4cc03565, and retention deleted one old archive, leaving three.

It didn't need the retry. That matters to how I report it: the night shows the job still works, and the probes show the wrapper works. Two different claims, and I'd rather make both than let one stand in for the other.

The difference between a machine that survives a bad minute and one that has no copy at all isn't cleverness, and it isn't the size of the archive. It's whether anyone checked that the copy arrived. The broader version of that question is in what happens when the box disappears.

Where it stops

The wrapper buys a bad minute, not a bad month. Four attempts give up in about two minutes, so an hour without a working network still loses the night. That's deliberate: a job that waits longer starts colliding with its own next run, and a queue of backups is not a backup.

It also does nothing for the two failures that actually cost me the week, the full account and the login that stopped working, because neither is transport. Those need someone to read the refusal and change something. A quiet retry of a refusal hides the one message you needed.

And a checksum is not a restore. A matching hash proves the bytes arrived intact. It doesn't prove they become a working agent again on a clean machine, which is a different test with a different answer, and reading "sha256 matches" as "your work is safe" is the mistake this whole week was made of.

If the account is full, or the credential has changed, I'd tell a client to fix that before buying anything else from me. A backup that fails for a week is not a backup. It's a habit with a schedule.

If you want to watch the checks run on your own machine rather than read about mine, Begin.

Questions answered

Why did the nightly backup fail on 1 December?

The machine could not resolve the storage provider's name. The same failure hit the tunnel and the mail drainer in the same minute, so the fault was local name resolution, not the storage service.

Should a backup script retry every error?

No. It should retry transport faults such as a failed lookup, a socket that will not open or a timeout. A refusal, like a wrong password or a full account, will fail identically four times and only delays the message you need to read.

Does a matching checksum mean the backup is usable?

It means the bytes arrived intact. Whether they restore into a working agent on a clean machine is a separate test, and the two are often confused in reports about backups.


More writing