Skip to content

Abandoning "Set up again" on a committed slot makes every later boot run the previous release #3960

Closed

Description

@pithead-developer

What's the problem

docs/appliance.md:555-557 promises that with Set up again, nothing changes "for a page you never touch or a machine switched off part way". That is not true on an appliance that has taken an update. If someone opens Set up again and then reboots or powers off without choosing, the next boot runs the other slot, which is the previous release. The machine stays there.

How the slot logic gets there:

Walkthrough on an updated machine with ORDER="B A", B_OK=1 B_TRY=0 (committed long ago) and A_OK=1 A_TRY=0:

  1. Set up again boots B and stores B_TRY=1.
  2. The page waits, and pithead-boot has not run.
  3. The machine reboots or loses power. GRUB skips B (OK=1 TRY=1) and selects A, the previous release. A's boot gate then commits A.
  4. B_TRY stays 1. Every later boot picks A until the next update installs into B. The exception is a boot of A that is itself interrupted before it commits: then the "nothing selectable" branch clears both flags, and B returns on the boot after. That exception is inferred from grub.cfg:48-56 and not run.

When it is safe:

  • Keep it, or finishing the wizard: pithead-boot runs after the unit in the same boot and marks the slot good.
  • A machine never updated (B_OK=0, the seed in os/installer/pithead-install:286 and os/rauc/mkimage.sh:104): the "nothing selectable" branch clears A_TRY.

Context, by design and not this issue. Every boot of a committed slot has the same window until pithead-boot's health gate passes, so an unhealthy committed slot falls back (#1065, pithead-boot:23-30). Set up again is different in two ways: the window has no limit, it ends by a human backing out rather than by a health verdict, and the docs promise the opposite. The unit's comment (pithead-setup-again.service:14-16) calls the fallback "the A/B promise". That is right for a freshly installed slot nobody has verified, not for one committed long ago.

What it impacts

  • Who: rig and coordinator appliances that have taken at least one update. On a rig, whose only interface is the console, rebooting is the natural way to back out of the setup page.
  • What happens: the machine runs the previous release from then on, without the current release's fixes.
  • No rollback is reported. The in-flight update record was removed when B committed (pithead-boot:370-379), so no verdict is written; only the running version changes. This is inferred, and I did not trace the dashboard.
  • Not traced: what the older slot does when the current release raised the /data migration floor.

How I found it

I read the code on the 2.0.x line (develop-v2.0.3 at 5efb61bb) while reviewing how RigForge-only appliances update, then compared it with #3374. The grub.cfg selection block is identical on develop-v2.1.0. There, the pithead-boot mark-good lines are :275 and :356. I did not reproduce it on hardware or in KVM.

Existing tests don't catch it:

  • tests/os/setup-again-leg.sh checks B_OK/B_TRY only as a precondition before leg 3 (lines ~201-213). It never checks the slot state after a leg, and never reboots with the page open.
  • tests/stack/appliance/test-appliance-reset-slot-boot.sh runs the shipped grub.cfg selection, but models only the firstboot and boot units. Its only setup-again row (117-126) covers the early return in reset_slot_restore_good. Lines 102-105 model a freshly installed update slot as OK=1 TRY=0.

How important is it

P2. Someone at the console has to open Set up again and then reboot. But rebooting is the obvious way to cancel, the docs say it is safe, and the result is a silent downgrade that persists across reboots. It is the same class of defect as #3374 (P1).

Acceptance criteria

  • On a committed slot: open Set up again, then reboot without choosing. The next boot runs the same slot, which is back to OK=1 TRY=0.
  • On an updated slot not yet committed, today's behaviour stays: abandoning Set up again falls back to the previous slot, and pithead-boot records the interrupted verdict.
  • A tier-1 row in tests/stack/appliance/test-appliance-reset-slot-boot.sh covers both cases.
  • tests/os/setup-again-leg.sh checks the slot state after an abandoned leg on an updated machine.
  • docs/appliance.md:555-557 matches the behaviour.

Possible solutions

  • Re-commit at the start of Set up again. When pithead-setup-again.service starts on a slot with no update in flight, it runs rauc status mark-good before opening the page. The in-flight record is data/os-update/in-flight.json, which pithead-boot already reads.
    • Grubenv alone can't tell a committed slot from a freshly installed one. RAUC's GRUB set-primary also leaves the new slot at OK=1 TRY=0, as the tier-1 model at lines 102-105 does.
    • Trade-off: if the boot after the page then fails the health gate, the slot is already committed. fail_boot's bounded reboot loop handles that, not a fallback.
  • Restore the flag inside the menu entry. The Set up again entry restores the slot's previous TRY value with save_env, in code that runs only when the entry is chosen. It needs the same "committed or freshly installed" distinction, so it is the harder option.

Activity

  1. added this to the v2.0.4 milestone on Nov 9, 2026
  2. added
    bug
    appliance
    P2-correctness
    on Nov 9, 2026
  3. pithead-developer commented on Nov 11, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4035. PR #3989 is blocked on #4035: three required checks (Build image for monero, p2pool and xmrig-proxy) fail at apt-get update with "Could not resolve 'archive.ubuntu.com'" on head 40b8356. The fake-daemon mini-stack and both browser-journey checks failed on their first run for the same network reason and passed on rerun, leaving 41 passing checks. This diff touches no Dockerfile, and other branches' ci.yml runs went red from about 14:52 UTC today, so I don't think the code causes it, though I haven't confirmed whether the runner network or the registry-mirror action is at fault. I filed #4035 for it. The rig bench job 651@40b835601461411c6e44ceb7fa1ca72cbd3361e9 passed on this head (257 pass, 0 fail). Its evidence block is in the PR body, and I posted the blocker on the PR. It clears when the runner network recovers and the three jobs are rerun, or when #4035 finds another cause.

    The runner resumes this issue when that one closes.

  4. added
    blocked
    on Nov 11, 2026
  5. removed
    blocked
    on Nov 12, 2026
  6. pithead-developer commented on Nov 12, 2026

    @pithead-developer
    ContributorAuthor

    Released from the #4035 wait

    The three Build image (monero|p2pool|xmrig-proxy) checks that held this issue's PR red failed on the transient hosted-runner DNS outage (2026-11-11 14:52–16:36 UTC) — the cause is recorded on #4035. They were rerun on PR #3989's head 40b8356: run 43059881241 attempt 3 — job 131102192110 (monero), 131102192129 (xmrig-proxy), 131102192149 (p2pool) — all passed 2026-11-12 09:47–09:48 UTC, and every check on that head is green. No code change is needed for them; #4035 closes as completed under maintenance & gates per the owner's ruling of 2026-11-12. The native blocked-by link to #4035 and the blocked label are removed here, and stage/blocked is removed on PR #3989. Normal review and merge gates apply.

  7. pithead-developer commented on Nov 12, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #3989.

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

    P2-correctnessappliancebug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions