Skip to content

Dashboard asks for a second reboot while the new slot is verifying, which rolls back a healthy update #3909

Closed

Description

@pithead-developer

What's the problem

After an OS update is installed and the owner reboots, the dashboard can ask for the reboot again while the new slot is still verifying. Following that prompt rolls back a healthy update.

  • Install persists {"step":"reboot-pending"} and the in-flight flag on /data (lib/pithead/48-os-update-verbs.sh:318-329). Both survive the slot switch.
  • The new slot rewrites the dashboard's update state only when the boot gate commits (os/overlay/pithead-boot:356-368). Until then the persisted step is still reboot-pending, so the dashboard keeps offering "Reboot to finish the update to vX" (dashboard/mining_dashboard/web/static/system/osreboot.mjs:18-24, osupdate.mjs:164,372-373).
  • control_os_reboot checks only that the in-flight flag exists and is under 24 hours old (48-os-update-verbs.sh:334-364). It does not refuse when the running slot is already the in-flight target, or while the boot gate is still deciding.
  • GRUB gives an uncommitted slot exactly one boot try, cleared only by rauc status mark-good (os/rauc/grub.cfg:30-46,58). A second boot of that slot falls back to the old slot.
  • The fallback writes rolled_back with an empty blocking list (os/overlay/pithead-boot:190-206), because the interrupted gate never reached fail_boot. The banner says "failed its health checks", which is not what happened.

The code is identical in v2.0.1 and v2.0.2, so every dashboard-driven update since then is exposed.

What it impacts

Every appliance owner who updates through the dashboard and follows its prompts. The new slot's first boot can take many minutes: cosign checks, image pulls, and a Tor health wait of up to about 12.5 minutes (lib/pithead/01-lifecycle.sh:248,267-269). That is a long window in which the page asks for the reboot that will undo the update. The owner then sees a misleading failure with no cause to act on, and is left on the old version. A side effect of the interrupted boot is filed separately (the config stamp left by the newer version).

How I found it

An owner's appliance updating v2.0.1 to v2.0.2 on 2026-11-02 rolled back with "The update to v2.0.2 failed its health checks and was rolled back automatically — still on v2.0.1." and no "Blocked by" clause. The dashboard's config audit shows os-install installed at 21:15:07Z, then os-reboot rebooting at 21:19:52Z and again at 21:22:03Z. The owner confirmed the dashboard asked to reboot twice and they followed it. An operator investigation of the v2.0.1 and v2.0.2 trees found no 2.0.2 change in the boot, gate, RAUC/GRUB or dashboard update code. It found that the only path to a rollback with an empty blocking list on this box is a second boot of the uncommitted slot, which the reboot above is.

Unknown: whether the second request ran on the new slot (its control loop and a dashboard showing the persisted step) or reached the old slot during a slow shutdown. The fix below covers both.

How important is it

High. It turns a successful update into a rollback on the default update path, and it does so by asking the owner to do it. It also hides the cause behind a "failed its health checks" message.

Acceptance criteria

  • While the running slot is the in-flight target and not yet committed, the dashboard shows that the update is being verified ("Verifying the update to vX — leave the machine running") and offers no reboot.
  • os-reboot refuses, with a clear message and an audit entry, when the running version equals the in-flight target or the boot gate has not decided. A reboot from the old slot before install, and after commit, is unaffected.
  • The new slot moves the persisted step off reboot-pending at the start of its boot (for example to verifying), before any dashboard can read it.
  • If the uncommitted slot is still interrupted (power loss, watchdog), the fallback verdict records an explicit cause such as "interrupted before the update was verified" instead of an empty blocking list, and the banner no longer says the health checks failed.
  • Tests: tier-1 coverage for the refusal, the step transition and the interrupted-verdict text; a tier-4 KVM leg that follows every prompt the dashboard shows during an update (no extra reboot is offered, outcome=updated).

Possible solutions

  • In pithead-boot, write {"step":"verifying","version":...} as soon as the new slot boots with an in-flight flag; render it in osupdate.mjs/osreboot.mjs as a non-actionable state.
  • In control_os_reboot, compare /etc or /data running version with the in-flight .to and refuse while they match and the slot is uncommitted.
  • Have the gate write a start marker so the fallback boot can tell "interrupted" from "failed", and record that in the verdict.

Activity

  1. added this to the v2.0.3 milestone on Nov 2, 2026
  2. added
    bug
    appliance
    on Nov 2, 2026
  3. pithead-developer commented on Nov 6, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #3923. PR #3919 cannot go green until #3923 lands. The five red checks (appliance rootfs scan and the dashboard, monero, p2pool and xmrig-proxy image builds) all fail on the Trivy HIGH apt CVE-2026-109518, which the open issue #3923 tracks. This PR changes no Dockerfile, base digest or scan config, and other branches show the same red. #3923's acceptance forbids an ignore-list entry, and a base-image bump here would mix an unrelated change into the OS-update fix. Finished: the fix, all other GitHub checks, and tier4-kvm job 3419 (phase update, 191 pass, 0 fail, evidence in the PR body). Once #3923 merges into develop-v2.0.3, merge that base into this branch, push, and re-read the scans on the new head. I commented the same explanation on the PR.

    The runner resumes this issue when that one closes.

  4. added
    blocked
    on Nov 6, 2026
  5. removed
    blocked
    on Nov 8, 2026
  6. added a commit that references this issue on Nov 8, 2026
  7. pithead-developer commented on Nov 8, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #3919.

  8. added a commit that references this issue on Nov 29, 2026
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

    appliancebug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions