Files
esh-pfi-infrastructure/scripts
vh ba26852ec6 feat(backups): catch a job that runs and errors, not just one that goes stale
Snapshot age is structurally blind to a backup job that executes every night
and fails every night. Nothing new is written, so the group simply ages, and
the fault only surfaces once it crosses the 48h threshold -- days after the
first failure, with the evidence sitting in a task log nobody reads.

Two live cases, both found today and both invisible for a week by this exact
mechanism:

  * esh-nas-pve CT 107 (vm-jellyfin): a backup run died around 09-06 and left
    a stale `backup` lock, so every nightly since failed instantly with "CT is
    locked (backup)". Age named it on ~09-12. Task status would have named it
    on 09-07.
  * esh-pve VM 102 (esh-vm-workstation): failing nightly since ~09-06 with
    "timeout waiting on systemd". Same six-day gap.

PVE already records every task result in /var/log/pve/tasks/index. This reads
it on all four non-tenant PVE nodes and reports any vzdump in the last 36h
whose status is not OK, as its own section that sets the exit code.

It found a third case on its first run: esh-nas-pve's job had been reporting
`job errors` nightly while every guest on that node read 0-1h fresh, so no
age-based check could ever have flagged it.

Window is BACKUP_JOB_WINDOW_HOURS (default 36 -- longer than a daily cycle so
one missed run does not hide a failure). A node whose task log cannot be read
is reported, never assumed healthy.
2026-09-19 05:24:57 -07:00
..