Skip to content

KVM fault phase: Fault D's wizard-serves check times out only inside a phases:[all] run (job 654), passes standalone (job 655) #2453

Closed as not planned

Description

@pithead-developer

What's the problem

Observed on bench-ci job 654 (tier4-kvm, phases: ["all"], commit 6ef6394c11514228d58069bc14b8513f6a8b8692, pithead#2381's branch). Fault D (added by #2067/#2210: a power cut mid first-boot image load) recovers correctly — D: survived a power cut mid image load — booted — but the very next assertion times out:

D: the wizard never served after recovering from the image-load cut — the box is not usable

_wait_setup_page 180 (tests/os/phases/fault.sh) never sees the wizard's gate page inside its 180s budget. Host memory was not the constraint (MemAvailable=46957 MiB before the guest boots, bar 20480 MiB).

The same leg, same commit, run in isolation (job 655, phases: ["fault"]) passes this exact check in ~15s: D: install-from-stick still works afterwards — the wizard serves again. The only difference between the two jobs is battery position: job 654's Fault D runs after boot/update/install/provision/rig/rigmedia/media have already cycled several guests and built several images on the same host, roughly 7.5 hours into the run; job 655 hits it within minutes of boot.

This looks like a real timing/resource-contention gap in a leg that has never before run inside a phases: [all] battery (Fault D is new), not a flake in the harness's own polling logic — _wait_setup_page's 180s budget may simply be too tight once other phases have loaded the host, or the wizard-serve path itself is slower to recover late in a long-running battery. Needs someone to read the guest journal from job 654's Fault D window (guest boot uuid around 2026-09-20T00:01-00:04Z) to see what the wizard container / pithead-firstboot was doing during those 3 minutes.

Not something pithead#2381's branch caused: that branch only changed the DHCP-lease refresh and BRICKED-vs-probe-failure classification around the virsh destroy/virsh start power cycles in this phase (visible in the same job's D: survived... line, which is the row that branch's fix enabled to pass at all under a stale DHCP lease); the wizard-serving timeout is a separate, later assertion this issue does not touch.

what it impacts

Impact is not separately established in the existing report; confirm the affected users or behavior.

How I found it

Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.

how important is it

Importance has not been assessed explicitly; triage must state the priority and its reason.

acceptance criteria

Acceptance script

This issue has no acceptance section, so the goal is derived from its title and body. Fault D's the wizard serves again row passes when the fault phase runs late in a long battery job, after other phases have cycled several guests and built several images on the same host. A single phases=all job no longer fits bench-ci's 240-minute cap. The 2026-09-27 owner ruling on #1651 made the release gate two tier4-kvm jobs, and the second runs rig,rigmedia,media,fault,reset,image-upgrade,stack. So "late in a battery" here means: fault runs after rig, rigmedia and media in the same job, or the job ran phases=all. Done means the script prints ACCEPTED and exits 0 with such a job's results. Every check is a mechanical pass or fail, so no judgment call is needed. Paste the script's full output into the PR body, or into the closing comment if no code change turns out to be needed.

# save the script below as /tmp/accept_2453.py (outside the repo), then, from the repo root,
# checked out at the commit the job ran on (the PR head), on Linux:
python3 /tmp/accept_2453.py --results DIR

It takes under a minute and changes no tracked file.

To get DIR from that tier4-kvm job:

mkdir -p /tmp/r2453
bench-ci evidence <id>@<sha> > /tmp/r2453/evidence.txt
# and save the job's run log (tests/os/run.sh's output, as bench-ci shows it) as /tmp/r2453/run.log
Check Passes when
C1 tests/os/phases/fault.sh still prints each of the four Fault D rows that B2 names, exactly once: D: first-boot image load is active, D: survived a power cut mid image load — booted, D: install-from-stick still works afterwards — the wizard serves again, D: the image store repaired itself — no zero-length layer metadata left behind.
C2 tests/os/selftest-run-modules.sh passes.
B1 DIR/evidence.txt is a tier4-kvm job on HEAD (its bench-ci job <id>@<sha> line names HEAD), its status is completed, and its phases list fault after rig, rigmedia and media, or are all.
B2 In DIR/run.log, all four rows from C1 passed and no row starting D: failed. A guest that took the clean-refusal branch never reaches the wizard row, so it does not pass.
B3 In DIR/run.log, the ==> phase: fault banner comes after the ==> phase: rig, ==> phase: rigmedia and ==> phase: media banners.

Rules:

  • Do not change the script's row texts or expected outcomes. If C1 prints a count other than 1x, fault.sh has changed since this issue was filed. Stop and comment here with the output instead of editing the row texts.
  • A reviewer re-runs the same script on the commit they review, with that commit's job. A changed head needs a fresh run and a fresh job.
  • The repo's normal gates still apply on top of this: make test and the adversarial review.

Baseline, run 2026-10-03 on 4598474 (develop): without --results, develop prints NOT ACCEPTED: 2/5 checks pass. C1 and C2 pass, and the three bench checks print bench evidence not supplied. With a fail fixture of job 654's shape, it prints NOT ACCEPTED: 4/5 checks pass, failing B2 on D: the wizard never served after recovering from the image-load cut — the box is not usable. That fixture is a synthetic phases=all run log in the harness's row format, with row texts read from fault.sh. With a pass fixture of a group-2 job, every D row green, it prints ACCEPTED: 5/5 checks pass. No code change was prototyped, because the cause has not been diagnosed. Each fixture run was made twice.

Hint, not binding: per #1651's record, Fault D passed in phases=all job 1478 (c5c48cc) and in every group-2 job since the split. The last of those is job 1773 at e2aeb47, which is an ancestor of 4598474, and fault.sh has not changed since. If the operator accepts that as the fix, check out e2aeb47, save job 1773's evidence and run log as DIR, and run the script there. Job 654's guest journal, which the issue asks someone to read, was not consulted.

Independent re-check, 2026-10-03: a second session re-ran this script in a fresh worktree at 4598474. Develop printed NOT ACCEPTED: 4/5 checks pass, and with the pass fixtures it printed ACCEPTED: 5/5 checks pass. Files the script mutates were left unchanged after each run.

accept_2453.py
"""Acceptance check for p2pool-starter-stack/pithead#2453.

Save this file OUTSIDE the repo (for example /tmp/accept_2453.py) so it is never committed.
Run from the repo root, checked out at the commit the bench job ran on (the PR head, or the
develop commit being certified when no code change is needed), on Linux as CI does:
    python3 /tmp/accept_2453.py --results DIR
DIR holds one downloaded tier4-kvm job on that commit in which the fault phase runs after rig,
rigmedia and media: DIR/evidence.txt (the output of `bench-ci evidence <id>@<sha>`) and DIR/run.log
(the job's run log, tests/os/run.sh's output). Without --results the bench checks print FAIL
"bench evidence not supplied". Prints PASS/FAIL per check and exits 0 only when every check passes.
No tracked file is modified.
"""
import argparse
import json
import re
import subprocess
import sys
from pathlib import Path

FAULT = Path("tests/os/phases/fault.sh")
D_ROWS = ("D: first-boot image load is active",
          "D: survived a power cut mid image load — booted",
          "D: install-from-stick still works afterwards — the wizard serves again",
          "D: the image store repaired itself — no zero-length layer metadata left behind")
EARLIER = ("rig", "rigmedia", "media")
ANSI = re.compile(r"\x1b\[[0-9;]*[A-Za-z]")
STAMP = re.compile(r"^(?:\[\w+\]\s*)?(?:\d{2}:\d{2}:\d{2}(?:\.\d+)?Z\s?)?(?:\[\w+\]\s*)?")
ROW = re.compile(r"^\s*(✓|✗) (.*)$")
BANNER = re.compile(r"^==> phase: (rig|rigmedia|media|fault)\b")
BENCH = ("B1 a tier4-kvm job on HEAD (evidence.txt names it) completed, with fault in its phases after "
         "rig, rigmedia and media (or phases=all)",
         "B2 run.log: all four Fault D rows passed, and no row starting 'D:' failed",
         "B3 run.log: the fault phase started after the rig, rigmedia and media phases in the same job")
results = []


def report(name, ok, detail=""):
    results.append(ok)
    print(f"{'PASS' if ok else 'FAIL'}  {name}" + (f"  [{detail}]" if detail else ""), flush=True)


def git(*args):
    return subprocess.run(["git", *args], capture_output=True, text=True).stdout


def evidence(d):
    p = d / "evidence.txt"
    if not p.is_file():
        return None
    t = p.read_text()
    m = re.search(r"bench-ci job (\d+)@([0-9a-f]{40})\**\s*·\s*\S+\s*·\s*(tier4-[\w-]+)", t)
    s = re.search(r"^- status:\s*(\w+)\s*·\s*conclusion:\s*(\w+)\s*·\s*exit\s*(-?\d+)", t, re.M)
    o = re.search(r"^- options:\s*(\{.*\})\s*$", t, re.M)
    if not (m and s):
        return None
    try:
        phases = json.loads(o[1]).get("phases", []) if o else []
    except ValueError:
        phases = []
    if isinstance(phases, str):
        phases = phases.split(",")
    return {"job": m[1], "commit": m[2], "tier": m[3], "phases": phases, "status": s[1], "conclusion": s[2]}


parser = argparse.ArgumentParser()
parser.add_argument("--results", type=Path)
args = parser.parse_args()
head = git("rev-parse", "HEAD").strip()

src = FAULT.read_text()
counts = {r: src.count(f'ok "{r}"') for r in D_ROWS}
report("C1 tests/os/phases/fault.sh still prints each of the four Fault D rows B2 names, exactly once",
       all(c == 1 for c in counts.values()), ", ".join(f"{r[:28]}…: {c}x" for r, c in counts.items()))
r = subprocess.run(["bash", "tests/os/selftest-run-modules.sh"], capture_output=True, text=True)
report("C2 tests/os/selftest-run-modules.sh passes (fault.sh still sources; function list pinned)",
       r.returncode == 0 and "os-run-modules: PASS" in r.stdout + r.stderr, f"exit {r.returncode}")

if args.results is None:
    for name in BENCH:
        report(name, False, "bench evidence not supplied")
else:
    ev = evidence(args.results)
    ph = ev["phases"] if ev else []
    late = "all" in ph or ("fault" in ph and all(p in ph and ph.index(p) < ph.index("fault") for p in EARLIER))
    report(BENCH[0], bool(ev) and ev["commit"] == head and ev["tier"] == "tier4-kvm" and ev["status"] == "completed"
           and late, f"{args.results}/evidence.txt missing or unparsable" if not ev else
           f"job {ev['job']}, commit {ev['commit'][:12]}, tier {ev['tier']}, status {ev['status']}, phases {ph}")
    log = args.results / "run.log"
    lines = [STAMP.sub("", ANSI.sub("", l), count=1) for l in log.read_text(errors="replace").splitlines()] \
        if log.is_file() else []
    rows = [(m[1], m[2]) for m in map(ROW.match, lines) if m]
    passed = {r: any(v == "✓" and t == r for v, t in rows) for r in D_ROWS}
    failed = [t for v, t in rows if v == "✗" and t.startswith("D:")]
    report(BENCH[1], all(passed.values()) and not failed,
           f"passed {sum(passed.values())}/4" + (f", failed: {failed[0][:100]}" if failed else ""))
    first = {}
    for i, l in enumerate(lines):
        m = BANNER.match(l)
        if m and m[1] not in first:
            first[m[1]] = i
    report(BENCH[2], "fault" in first and all(p in first and first[p] < first["fault"] for p in EARLIER),
           f"phase banners at lines {first}")

print(f"\n{'ACCEPTED' if all(results) else 'NOT ACCEPTED'}: {sum(results)}/{len(results)} checks pass")
sys.exit(0 if all(results) else 1)

possible solutions

No distinct solution options are recorded; investigate the existing report before choosing an approach.

Activity

  1. added
    bug
    testing
    appliance
    needs-triage
    on Sep 20, 2026
  2. VijitSingh97 commented on Sep 20, 2026

    @VijitSingh97
    Collaborator

    Milestone → v2 - appliance per the 2026-09-19 triage ruling: anything that is not a new feature (bugs, security findings, testing gaps, and harness bugs that red or falsify the release gate) belongs in the 2.0.0 ship list. maintenance & gates holds only CI plumbing.

  3. added
    flaky
    operator-action
    on Sep 22, 2026
  4. pithead-devops commented on Sep 22, 2026

    @pithead-devops

    Devops: not a box change (yours, under operator-action; put devops on by hand to hand it to that role anyway):

    This requires guest-log diagnosis and a pithead harness or product code fix; no box configuration change is specified.

  5. pithead-developer commented on Sep 30, 2026

    @pithead-developer
    ContributorAuthor

    The recorded Devops handoff calls for guest-log investigation and a worker-owned harness or product fix. Removing the stale operator hold; the existing milestone remains in force.

  6. removed
    operator-action
    on Sep 30, 2026
  7. 7 remaining items

  8. pithead-developer commented on Oct 19, 2026

    @pithead-developer
    ContributorAuthor

    Shared admission recovery is now tracked by p2pool-starter-stack/bench-ci#2123 for this wait, p2pool-starter-stack/rigforge#583 and #2343. A supported-client health read succeeds but reports draining; reconciliation of the RigForge submission confirms no job. RigForge PR #590 is retained pending that repair, with its original request/key preserved. The cause is unknown; owner diagnosis and any host change belong to the manual infrastructure queue, with change, verification and rollback recorded before action. This does not waive any issue's current-head live proof or review/approval requirements.

  9. pithead-developer commented on Oct 19, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on p2pool-starter-stack/bench-ci#2125. Blocked on bench-ci#2125: supported-client health still reports draining, and submission reconciliation confirms no job exists. Filed the shared recovery issue with infra/operator-action labels requesting owner investigation, verification and rollback requirements; commented on #2453, retained the unchanged worktree, and stopped scheduled retries.

    The runner resumes this issue when that one closes.

  10. added
    blocked
    and removed
    blocked
    on Oct 19, 2026
  11. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    ContributorAuthor

    The current-head reproduction passed with Fault D after rig, rigmedia and media. All four required D assertions executed successfully; the wizard-serves assertion followed the recovered-boot assertion by about ten seconds. No source change is proposed. This establishes the issue's requested late-battery behavior on this commit; it does not establish the cause of job 654's historical timeout, whose expired guest journal was never inspected.

    bench-ci job 2634@a10dbf0bdf34d6f77f42acbeadca1387ed392167 · pithead · tier4-kvm

    • options: {"phases": ["rig", "rigmedia", "media", "fault"]}
    • status: completed · conclusion: success · exit 0 · 54m 22s
    • baseline verified: yes · rig restored: n/a
    • node guard: not recorded · no comparison recorded
    • steps: checkout success · reserve success · preflight success · run success · collect success · restore success · cleanup success
    • rows: 268 pass · 0 fail · 2 skip (by-design 1, missing 1)
    • image sha256: system.img 7ea8df464adef92d65d6334e0ce434df5558c3c0d1807dc0f89e105a872f100e
    • image sha256: rig/bundle-1.raucb c1eaa8e761fb3f314fb1ad4e5d47c66171f4cc68896e1cf74240338d4155e1b2
    • image sha256: fault/bundle-1.raucb 934d74d980ac5151998810f3f94046da21d2894cc489e3d366a6236130362966
      Generated by bench-ci evidence 2634@a10dbf0bdf34d6f77f42acbeadca1387ed392167; re-run it to check.

    The unchanged issue acceptance checker was run on macOS with Python 3.12, Homebrew Bash and GNU utilities. Its full output follows. Only the bench client's ISO8601 transport prefix was removed from the saved run output for the older parser; the raw log is retained.

    PASS  C1 tests/os/phases/fault.sh still prints each of the four Fault D rows B2 names, exactly once  [D: first-boot image load is …: 1x, D: survived a power cut mid …: 1x, D: install-from-stick still …: 1x, D: the image store repaired …: 1x]
    FAIL  C2 tests/os/selftest-run-modules.sh passes (fault.sh still sources; function list pinned)  [exit 1]
    PASS  B1 a tier4-kvm job on HEAD (evidence.txt names it) completed, with fault in its phases after rig, rigmedia and media (or phases=all)  [job 2634, commit a10dbf0bdf34, tier tier4-kvm, status completed, phases ['rig', 'rigmedia', 'media', 'fault']]
    PASS  B2 run.log: all four Fault D rows passed, and no row starting 'D:' failed  [passed 4/4]
    PASS  B3 run.log: the fault phase started after the rig, rigmedia and media phases in the same job  [phase banners at lines {'rig': 1715, 'rigmedia': 1917, 'media': 1935, 'fault': 1959}]
    
    NOT ACCEPTED: 4/5 checks pass
    

    C2 separately passed in Linux CI at the exact tested commit: Shell run 39185502236 completed successfully, and its raw log records os-run-modules: PASS. The full acceptance checker has not been run on Linux. Earlier local attempts also encountered system Python 3.9; no local failure is being presented as a product regression or a passing check.

    The focused live reproduction retained two skipped rig legs: hostname/diagnostics/Tari-switch/egress checks are inapplicable to a rig without a dashboard, and the node card rendering leg lacked a node on the harness host. Neither skip bypassed a Fault D assertion.

    Both make lint-file-budget and make lint-pithead-build passed (exit 0). Independent verifier review confirmed the exact-head Linux C2 result, the four raw D rows and phase order, and found no source diff. The issue remains open because the combined Linux/local proof has not been substituted for the literal full-checker acceptance requirement.

  12. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    ContributorAuthor

    Filed privately (pithead-2453.md); it needs an answer there, then remove the question label.

  13. added
    question
    and removed
    question
    on Oct 21, 2026
  14. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    ContributorAuthor

    The operator ruling requires the unchanged full acceptance checker to print ACCEPTED and exit 0 on Linux; the combined proof is not being used for closure.

    The existing supported execution paths provide fixed CI suites and tier-4 jobs, with no checker-plus-retained-artifacts execution entry point. A checksummed handoff is prepared for the responsible agent operator to execute the one-time checker in an authorized Linux CI environment at a10dbf0, using job 2634's retained evidence and normalized run log. The unchanged checker and raw transport-prefixed log are preserved alongside the inputs.

    The resume trigger is the agent operator's complete Linux checker stdout/stderr, actual exit status and CI run reference. No further tier-4 job, host change or local rerun is requested. The issue remains open: current passing Fault D behavior and job 654's unknown historical cause remain distinct.

  15. pithead-developer commented on Oct 23, 2026

    @pithead-developer
    ContributorAuthor

    Parked in Icebox under the lean roadmap (owner, 2026-10-21: flaky tests are rerun, not fixed; harness forensics parked; no soaks): flaky harness timing only in a full battery. It comes back if it recurs and becomes a hard release blocker.

  16. pithead-developer commented on Oct 27, 2026

    @pithead-developer
    ContributorAuthor

    Closing as obsolete: Fault D's wizard-serves check has passed late in the battery in jobs 1478 and 1773 and in job 2634 (fault after rig, rigmedia and media, at a10dbf0), and the job 654 timeout has not recurred. The cause of job 654 was never diagnosed because its guest journal expired, so no code fix is claimed. Under the lean roadmap, flaky legs are rerun rather than investigated, and #3480 now owns the flaky policy and this evidence. If the row fails again in a late-battery fault run, file a new report there with the guest journal.

  17. pithead-developer commented on Nov 14, 2026

    @pithead-developer
    ContributorAuthor

    Same row recurred in a --phase fault run: job 684@b20ebb93053c726fd828a7d3da8e598040aa92b9 failed only D: the wizard never served after recovering from the image-load cut (150 pass, 1 fail). Rerunning the identical head passed all 151 rows (535@b20ebb93053c726fd828a7d3da8e598040aa92b9), and the base commit's fault run passed too (532@cddb359a681fb81621c238ae46192124d7651270). Seen from #4104; the change there adds only a leg that runs before D on a different guest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appliancebugflakyneeds-triagetesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions