From 40d34c557634e239d61433ef3edf915654176009 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Mon, 5 Oct 2026 17:29:05 +0200 Subject: [PATCH] hub-db-backup: parse the snapshot time in a form BusyBox date reads (CI red since ab2b304: 9/15 on the Alpine runner) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- .../burndown-2026-10-05/ci-busybox-fix.txt | 17 +++++++++++++++++ scripts/CHANGELOG.md | 9 +++++++++ scripts/hub-db-backup/felhom-hub-db-backup | 5 +++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 documentation/audits/burndown-2026-10-05/ci-busybox-fix.txt diff --git a/documentation/audits/burndown-2026-10-05/ci-busybox-fix.txt b/documentation/audits/burndown-2026-10-05/ci-busybox-fix.txt new file mode 100644 index 00000000..635e1818 --- /dev/null +++ b/documentation/audits/burndown-2026-10-05/ci-busybox-fix.txt @@ -0,0 +1,17 @@ +### CI fix red-proof: the previous ISO date form, BusyBox-only PATH (the Alpine runner's tools) +AssertionError: 'integrity_check' not found in "date: invalid date '2026-10-05T15:18:27Z'\nfelhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:27Z\n" +felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:27Z +AssertionError: 'stopped snapshotting' not found in "date: invalid date '2026-10-04T12:28:28Z'\nfelhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-04T12:28:28Z\n" +AssertionError: "bytes, the pod's file is" not found in "date: invalid date '2026-10-05T15:18:28Z'\nfelhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z\n" +felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z +felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z +felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z +felhom-hub-db-backup: FAILED: cannot parse snapshot time 2026-10-05T15:18:28Z +Ran 15 tests in 0.781s +FAILED (failures=9) +### the fix, BusyBox-only PATH +Ran 15 tests in 3.328s +OK +### the fix, normal GNU PATH +Ran 15 tests in 2.555s +OK diff --git a/scripts/CHANGELOG.md b/scripts/CHANGELOG.md index 850b9da3..ccdbe135 100644 --- a/scripts/CHANGELOG.md +++ b/scripts/CHANGELOG.md @@ -1,3 +1,12 @@ +## hub-db-backup — the snapshot time is read the BusyBox way too (2026-10-05, CI fix) + +The new `script-tests` gate ran `test_hub_db_backup.py` on the CI runner (Alpine, BusyBox `date`) for the first time, +and 9 of 15 failed: BusyBox `date -d` rejects `2026-10-05T12:30:37Z`. The push script now parses +`YYYY-MM-DD hh:mm:ss` with `-u`, which GNU and BusyBox both read. Red-proof with a BusyBox-only PATH: the old form → the +same 9 failures; the fix → 15/15 (and 15/15 on GNU) — `documentation/audits/burndown-2026-10-05/ci-busybox-fix.txt`. +The copy installed on DooPlex (`/usr/local/sbin/felhom-hub-db-backup`) is the previous revision; on DooPlex's GNU +`date` both behave the same, so it was not reinstalled (DooPlex: no change this session). + ## build + gates — no `:latest`; the gate list pinned; duplicate closed ids refused (2026-10-05, burn-down) - **R-345:** `build-hub.sh` no longer tags or pushes `felhom-hub:latest` (`--push`, `--multiarch`, local); nothing diff --git a/scripts/hub-db-backup/felhom-hub-db-backup b/scripts/hub-db-backup/felhom-hub-db-backup index 3a9ee52a..db051eaf 100755 --- a/scripts/hub-db-backup/felhom-hub-db-backup +++ b/scripts/hub-db-backup/felhom-hub-db-backup @@ -29,8 +29,9 @@ SNAP=$(kubectl -n felhom-system exec deploy/hub -- sh -c 'ls -1 /data/snapshots/ NAME=${SNAP##*/} STAMP=${NAME#hub-}; STAMP=${STAMP%.db} # 20261005T020000Z case "$STAMP" in [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]T[0-9][0-9][0-9][0-9][0-9][0-9]Z) ;; *) die "unexpected snapshot name $NAME" ;; esac -ISO=$(echo "$STAMP" | sed -E 's/^(....)(..)(..)T(..)(..)(..)Z$/\1-\2-\3T\4:\5:\6Z/') -SNAP_EPOCH=$(date -u -d "$ISO" +%s) || die "cannot parse snapshot time $ISO" +# "YYYY-MM-DD hh:mm:ss" with -u: the one form both GNU date and BusyBox date (the CI runner, Alpine) read. +WHEN=$(echo "$STAMP" | sed -E 's/^(....)(..)(..)T(..)(..)(..)Z$/\1-\2-\3 \4:\5:\6/') +SNAP_EPOCH=$(date -u -d "$WHEN" +%s) || die "cannot parse snapshot time $WHEN (UTC)" AGE=$((NOW - SNAP_EPOCH)) [ "$AGE" -le $((MAX_AGE_H * 3600)) ] || die "newest snapshot $NAME is $((AGE / 3600)) h old (limit ${MAX_AGE_H} h) — the hub stopped snapshotting" log "snapshot $NAME, $((AGE / 60)) min old"