backup: refuse an empty archive-prefix list before the off-site prune #608
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#608
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What
The daily backup prunes old archives on each off-site destination with
rclone delete "<dest>:<bucket>/" --min-age 14dplus one--includepair per entry ofbackup_archive_prefixes(ansible/roles/backup/templates/bitborg-backup.sh.j2:223-228). The rclone delete walks the whole bucket. The Glesys bucket also holds the restic repositories (RESTIC_REPOSITORYinbackup.env.j2uses the same bucket variable).Why
The
--includelist is the only guard. With an empty list the loop renders no--includeand the delete has no filter.Failing case
backup_archive_prefixesis[bitborg, gitborg]today, andvars.ymlcarries a comment about dropping an entry after 2026-10-31. Someone empties the list. The next daily run deletes every object older than 14 days in the bucket, including restic packs. The localfindprune also renders an empty\( \)group.Fix
Add
--max-depth 1to therclone delete, so the restic prefix is never walked. Addansible.builtin.assert: backup_archive_prefixes | length > 0inroles/backup/tasks/main.yml.Done when
rclone deleteruns with--max-depth 1.backup_archive_prefixesfails the play before any template is written.