clan: classify mislabels any failure whose log mentions the disko flake as FailDisk — operator told to reformat #374

Closed
opened 2026-08-09 20:55:02 +00:00 by ben · 2 comments
Owner

Found by the #183 rehearsal ratchet's first Task-3 gate drive
(2026-08-09, run 20260809T204304Z on the driver laptop) — filed by hand;
the ratchet's reporter (#373) will file this class automatically once built.

classify (internal/clan/errors.go:167-176) routes a failed phase to
FailDisk — "the disk could not be laid out", remedy "reformat it, then
continue"
— whenever stderr+stdout contains the substring disko. But every
clan invocation that evaluates the community flake prints

unpacking 'github:nix-community/disko/ff8702b4de27f72b4c78573dfb89ec74e36abdf1?...' into the Git cache...

as a PROGRESS line — the flake input's own URL. So any failure whose log
excerpt happens to include the unpack line (in this drive: the install phase
died mid-copying path ... from cache.nixos.org, guest qemu exited and was
restarted by its unit at 15:51:29) is reported to the operator as a disk-
layout fault with a reformat remedy — a wrong, destructive-sounding
instruction for what was plausibly a transient substitution/connectivity
death. Fail-loud got fail-wrong.

The esp substring in the same case arm has the same shape of risk
(expand-response-params store paths contain esp? no — but any path or
message containing esp matches, e.g. expand-response-params does NOT, it
lacks the bare esp… verify with a test), so the fix should anchor all of
this arm's matches to real disko/mount failure shapes, not bare substrings.

Acceptance:

  • Given a failed phase whose log contains only the disko flake-unpack
    progress line (fixture from run 20260809T204304Z's fault text), when
    classify runs, then the result is NOT FailDisk
  • Given a genuine disko failure log (existing fixtures/tests), when
    classify runs, then FailDisk still fires
  • A table test pins both
Found by the #183 rehearsal ratchet's first Task-3 gate drive (2026-08-09, run `20260809T204304Z` on the driver laptop) — filed by hand; the ratchet's reporter (#373) will file this class automatically once built. `classify` (`internal/clan/errors.go:167-176`) routes a failed phase to `FailDisk` — "the disk could not be laid out", remedy **"reformat it, then continue"** — whenever stderr+stdout contains the substring `disko`. But every clan invocation that evaluates the community flake prints unpacking 'github:nix-community/disko/ff8702b4de27f72b4c78573dfb89ec74e36abdf1?...' into the Git cache... as a PROGRESS line — the flake input's own URL. So any failure whose log excerpt happens to include the unpack line (in this drive: the install phase died mid-`copying path ... from cache.nixos.org`, guest qemu exited and was restarted by its unit at 15:51:29) is reported to the operator as a disk- layout fault with a reformat remedy — a wrong, destructive-sounding instruction for what was plausibly a transient substitution/connectivity death. Fail-loud got fail-wrong. The `esp` substring in the same case arm has the same shape of risk (`expand-response-params` store paths contain `esp`? no — but any path or message containing `esp` matches, e.g. `expand-response-params` does NOT, it lacks the bare `esp`… verify with a test), so the fix should anchor all of this arm's matches to real disko/mount failure shapes, not bare substrings. Acceptance: - [ ] Given a failed phase whose log contains only the disko flake-unpack progress line (fixture from run `20260809T204304Z`'s fault text), when `classify` runs, then the result is NOT `FailDisk` - [ ] Given a genuine disko failure log (existing fixtures/tests), when `classify` runs, then `FailDisk` still fires - [ ] A table test pins both
Author
Owner

Root cause of the triggering red is now PROVEN, and it confirms this
mislabel exactly as feared — twice in one afternoon.

Drives 20260809T204304Z and 20260809T205457Z (driver laptop) both went
red at enroll-activate with the byte-identical "the disk could not be laid
out — reformat it" failure. The guest's console journal has the true cause:

qemu-system-x86_64: terminating on signal 15 from pid 961 (/usr/bin/earlyoom)

and earlyoom's own log at both moments:

mem avail: 1381 of 13844 MiB ( 9.98%), swap free: 0 of 4095 MiB ( 0.00%)
low memory! at or below SIGTERM limits: mem 10.00%, swap 10.00%
sending SIGTERM to process ... "qemu-system-x86": badness 918, VmRSS 3163 MiB

The HOST ran out of memory and earlyoom killed the guest; clan's output
stopped mid-copying path; classify then matched the disko flake-unpack
progress line and told the operator their disk could not be laid out and to
reformat it. A host-memory kill was reported as a target-disk fault with a
destructive-sounding remedy. The acceptance criteria in the body stand; this
comment is the live fixture material (both run dirs retained).

Root cause of the triggering red is now PROVEN, and it confirms this mislabel exactly as feared — twice in one afternoon. Drives `20260809T204304Z` and `20260809T205457Z` (driver laptop) both went red at `enroll-activate` with the byte-identical "the disk could not be laid out — reformat it" failure. The guest's console journal has the true cause: qemu-system-x86_64: terminating on signal 15 from pid 961 (/usr/bin/earlyoom) and earlyoom's own log at both moments: mem avail: 1381 of 13844 MiB ( 9.98%), swap free: 0 of 4095 MiB ( 0.00%) low memory! at or below SIGTERM limits: mem 10.00%, swap 10.00% sending SIGTERM to process ... "qemu-system-x86": badness 918, VmRSS 3163 MiB The HOST ran out of memory and earlyoom killed the guest; clan's output stopped mid-`copying path`; `classify` then matched the `disko` flake-unpack progress line and told the operator their disk could not be laid out and to reformat it. A host-memory kill was reported as a target-disk fault with a destructive-sounding remedy. The acceptance criteria in the body stand; this comment is the live fixture material (both run dirs retained).
Author
Owner

Fixed on origin/main (a7cab09).

The FailDisk case arm matched a bare disko/esp substring anywhere in message+log, so the disko flake INPUT's own progress line (unpacking 'github:nix-community/disko/<hash>...' into the Git cache...) and a ...expand-response-params... copy path (whose response carries a bare esp) both read as a disk fault — the earlyoom host-OOM kill of run 20260809T204304Z/205457Z was reported as "the disk could not be laid out — reformat it".

Replaced the arm with a line-scanning logSaysDisk helper (internal/clan/errors.go), same discipline as logSaysFailed: it fires only on a real mount/space failure line (could not mount/failed to mount/cannot mount/unable to mount/no space left) or a disko name alongside an error/failed/fatal marker on the SAME line — the flake input appears only on unpacking/copying progress lines that carry no such marker, so it can never trip a match.

Evidence: TestClassify_DiskFlakeUnpackIsNotDisk (internal/clan/clan_test.go) table-pins both — the run 20260809T204304Z fault text (flake-unpack + cache-copy + earlyoom SIGTERM) is NOT FailDisk, and genuine disko-mount / disko-error / no-space logs still fire FailDisk. Existing baddisk (adapter_test) and taxonomy fixtures keep passing; full go build/vet/test gate green (all packages).

Fixed on `origin/main` (a7cab09). The `FailDisk` case arm matched a bare `disko`/`esp` substring anywhere in message+log, so the disko flake INPUT's own progress line (`unpacking 'github:nix-community/disko/<hash>...' into the Git cache...`) and a `...expand-response-params...` copy path (whose `response` carries a bare `esp`) both read as a disk fault — the earlyoom host-OOM kill of run `20260809T204304Z`/`205457Z` was reported as "the disk could not be laid out — reformat it". Replaced the arm with a line-scanning `logSaysDisk` helper (`internal/clan/errors.go`), same discipline as `logSaysFailed`: it fires only on a real mount/space failure line (`could not mount`/`failed to mount`/`cannot mount`/`unable to mount`/`no space left`) or a `disko` name alongside an `error`/`failed`/`fatal` marker on the SAME line — the flake input appears only on unpacking/copying progress lines that carry no such marker, so it can never trip a match. Evidence: `TestClassify_DiskFlakeUnpackIsNotDisk` (`internal/clan/clan_test.go`) table-pins both — the run `20260809T204304Z` fault text (flake-unpack + cache-copy + earlyoom SIGTERM) is NOT `FailDisk`, and genuine disko-mount / disko-error / no-space logs still fire `FailDisk`. Existing `baddisk` (adapter_test) and taxonomy fixtures keep passing; full `go build`/`vet`/`test` gate green (all packages).
ben closed this issue 2026-08-09 21:59:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#374
No description provided.