backup-drill: restore drill selects the restic/ dir instead of the latest archive #213

Sammanfogat
supernaut sammanfogade 1 incheckning från fix/drill-fetch-skips-restic-dir in i main 2026-07-23 17:43:54 +00:00
Ägare

Problem

The restore drill failed on its first run after the storage decoupling. fetch_latest_archive()
lists the off-site bucket with rclone lsf … --include "bitborg-*.tar.age" and takes max() of the
names to pick the newest archive. But the restic storage repo now lives under a restic/ prefix in
the same Glesys bucket, and lsf also lists that directory. restic/ sorts lexicographically
after bitborg-*, so max() selected restic/ — the drill then copied the whole ~9 GB restic
tree into its workdir and age -d failed ("is a directory"). Left unfixed, the weekly drill would
fail the same way (→ BackupDrillFailed) and leave a multi-GB orphan on the backup volume each run.

Fix

Add --files-only to the rclone lsf call so directory prefixes aren't listed, and defensively
keep only .tar.age names before max(). Follow-up to #211/#212.

Impact

  • No data risk — the storage snapshots and daily archives are intact; this only fixes which object
    the drill selects to restore.
  • The ~7.7 GB orphaned drill copy from the failed run has already been removed from the backup volume.
## Problem The restore drill failed on its first run after the storage decoupling. `fetch_latest_archive()` lists the off-site bucket with `rclone lsf … --include "bitborg-*.tar.age"` and takes `max()` of the names to pick the newest archive. But the restic storage repo now lives under a `restic/` prefix in the **same** Glesys bucket, and `lsf` also lists that directory. `restic/` sorts lexicographically **after** `bitborg-*`, so `max()` selected `restic/` — the drill then copied the whole ~9 GB restic tree into its workdir and `age -d` failed (*"is a directory"*). Left unfixed, the weekly drill would fail the same way (→ `BackupDrillFailed`) and leave a multi-GB orphan on the backup volume each run. ## Fix Add `--files-only` to the `rclone lsf` call so directory prefixes aren't listed, and defensively keep only `.tar.age` names before `max()`. Follow-up to #211/#212. ## Impact - No data risk — the storage snapshots and daily archives are intact; this only fixes which object the drill selects to restore. - The ~7.7 GB orphaned drill copy from the failed run has already been removed from the backup volume.
supernaut lade till 1 incheckning 2026-07-23 15:27:21 +00:00
backup-drill: fetch must skip the restic/ dir in the shared bucket (--files-only)
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m19s
73b51561c0
supernaut sammanfogade incheckning bf489eb90f till main 2026-07-23 17:43:54 +00:00
supernaut tog bort grenen fix/drill-fetch-skips-restic-dir 2026-07-23 17:43:54 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra!213
Ingen beskrivning angiven.