Repository navigation
Description
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:
- GRUB marks every boot as a try.
os/rauc/grub.cfg:30-58walksORDER, sets each examined slot's*_TRY=1, and boots the first slot withOK=1andTRY=0.save_envstores the flags before the kernel starts. The Set up again entry (grub.cfg:161-168) boots that same slot withpithead.setup=1. - Normally only
rauc status mark-goodclears it again. It runs atos/overlay/pithead-boot:283(rig) and:364(coordinator), and atlib/pithead/16b-reset-slot.sh:60(config-reset only). The other wayTRYgets cleared is GRUB's "nothing selectable" branch (grub.cfg:48-56). - Set up again holds that step back without limit.
pithead-setup-again.servicerunsBefore=pithead-boot.servicewithTimeoutStartSec=infinity, sopithead-bootand itsmark-goodwait for the page. - The config-reset firstboot consumes the good slot TRY and next reboot selects the previous release #3374 fix doesn't reach this case. config-reset firstboot consumes the good slot TRY and next reboot selects the previous release #3374 was fixed by fix(os): keep committed slot after config-reset firstboot #3387, which restores the good slot after a config-reset. Its
reset_slot_restore_goodreturns early whenconfig.jsonormachine-roleexists (16b-reset-slot.sh:45-47), which is always true for Set up again.
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:
- Set up again boots B and stores
B_TRY=1. - The page waits, and
pithead-boothas not run. - 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. B_TRYstays 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 fromgrub.cfg:48-56and not run.
When it is safe:
- Keep it, or finishing the wizard:
pithead-bootruns after the unit in the same boot and marks the slot good. - A machine never updated (
B_OK=0, the seed inos/installer/pithead-install:286andos/rauc/mkimage.sh:104): the "nothing selectable" branch clearsA_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
/datamigration 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.shchecksB_OK/B_TRYonly 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.shruns the shippedgrub.cfgselection, but models only the firstboot and boot units. Its only setup-again row (117-126) covers the early return inreset_slot_restore_good. Lines 102-105 model a freshly installed update slot asOK=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-bootrecords the interrupted verdict. - A tier-1 row in
tests/stack/appliance/test-appliance-reset-slot-boot.shcovers both cases. tests/os/setup-again-leg.shchecks the slot state after an abandoned leg on an updated machine.docs/appliance.md:555-557matches the behaviour.
Possible solutions
- Re-commit at the start of Set up again. When
pithead-setup-again.servicestarts on a slot with no update in flight, it runsrauc status mark-goodbefore opening the page. The in-flight record isdata/os-update/in-flight.json, whichpithead-bootalready 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.
- Grubenv alone can't tell a committed slot from a freshly installed one. RAUC's GRUB set-primary also leaves the new slot at
- Restore the flag inside the menu entry. The Set up again entry restores the slot's previous
TRYvalue withsave_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
Say which updates Set up again leaves uncommitted (#3960)
release: state what 2.0.3 changes for an upgrade and verify its known…
release: prepare version 2.0.3 (#3993)
Poll for the set-up-again slot commit instead of reading it once (#3960)
pithead-developer commentedon Nov 11, 2026
Blocked on #4035. PR #3989 is blocked on #4035: three required checks (
Build imagefor monero, p2pool and xmrig-proxy) fail atapt-get updatewith "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.ymlruns 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. Therigbench 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.
pithead-developer commentedon Nov 12, 2026
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 undermaintenance & gatesper the owner's ruling of 2026-11-12. The native blocked-by link to #4035 and theblockedlabel are removed here, andstage/blockedis removed on PR #3989. Normal review and merge gates apply.Keep a committed slot committed when Set up again is abandoned (#3960) (
pithead-developer commentedon Nov 12, 2026
Merged in #3989.
Tor diagnostics snapshot: circuits, consensus, guards, bootstrap and …