Skip to content

Set up again: the one-time token can be lost from the serial console when the login prompt starts #3803

Closed

Description

@pithead-developer

What's the problem

On a set-up-again boot, the setup wizard's connection details and one-time token can be missing from the serial console, although the wizard minted and logged them. The KVM rig battery has caught this twice: job 2965 on 6eb0818b and job 3233 on the 2.0.2 cut b4aa97fb. Both failed the row [rig] no one-time token appeared on the console after the reboot into the setup entry.

In both boots the guest journal holds the full announcement. For 3233 it has Setup wizard is up at 06:03:14.690Z and the One-time token: line with a well-formed token 2 ms later. The serial capture has none of the token block. It is cut mid-line (inside the second URL line in 3233, right after One-time token: in 2965), and the next bytes are the serial login banner and its login prompt. The token value appears nowhere in the 282 KB capture of 3233, while every other wizard boot in the same file shows its token.

The test reads the console correctly. Replaying its pit-[A-Z0-9]{6} match over each boot window of the retained capture finds the other boots' tokens and nothing in the failed boot's window.

What it impacts

The setup wizard tells an operator to read the URL and token from the console (pithead-setup-again.service: "The URL + one-time token must reach the person standing at the machine"). wizard_announce_setup (lib/pithead/12a-wizard-addresses.sh) announces once. It writes to the journal and directly to /dev/tty1 and /dev/ttyS0, swallows write errors, and never repeats.

A rig has no login and no SSH, so a rig operator watching only a serial line has no other way to get the token on that boot. They have to reboot into the setup entry again. Unknown: whether the monitor copy on tty1 is ever lost. The harness does not capture tty1.

How I found it

This came from reviewing the 2.0.2 release gate's failed rig job 3233: its log, serial-rig.log, and the guest-system journal for the failed boot. I compared it with 2965 (bench-ci#2233) and with job 3225, which passed every token wait on the same commit.

Across all retained tier4-kvm jobs, the row has failed twice against about 320 passing waits (about 0.6%). The two failures were on two different benches, and no commit range stands out. A rerun of the same group on b4aa97fb (job 3238) passed the same leg.

git log v2.0.0..b4aa97fb is empty for lib/pithead/12a-wizard-addresses.sh, os/overlay/pithead-setup-again.service and os/overlay/pithead-serial-getty.conf, so the behaviour is unchanged from the published 2.0.0 and 2.0.1.

Inference, not verified on the image: the product's override for serial-getty@ttyS0 only adds ExecCondition and restart settings, so the stock unit's tty reset and hangup on start still apply. If the getty takes ttyS0 while the announcement burst is still queued for the UART, the unsent tail would be discarded. That matches a contiguous loss ending exactly at the login banner. A fault in the emulated serial port is not ruled out. The guest wall clock steps backwards during these boots, so the journal cannot place the getty start against the announcement precisely.

How important is it

Low frequency and not a regression: it is in 2.0.0 and 2.0.1 unchanged, and recovery is another setup-again reboot. It matters because it hits the one moment the operator needs the token, on the one console a headless rig offers. Under the patch-release placement rule it belongs in 2.0.3. It does not block 2.0.2, whose gate passed this leg on rerun.

Acceptance criteria

  • On a set-up-again boot, the URL and one-time token are readable on ttyS0 after serial-getty@ttyS0 has started, every time. A test forces the getty to start while the announcement is being written and still finds the token on the serial capture.
  • The same holds for tty1, shown by a capture of the monitor console on the set-up-again legs.
  • The rig battery records separately whether the token was missing from the console or never minted (for example a journal cross-check row), without weakening the console row or accepting an earlier session's token.
  • The full rig battery passes on the fix's head, including every set-up-again leg.

Possible solutions

  • Put the URL and token in a getty issue fragment (for example under /run/issue.d), so the login prompt itself prints them whenever it takes the console.
  • Re-announce once after both gettys are up, or for a bounded time while the wizard page is open.
  • Order the announcement after the gettys have started, keeping the boot hold intact.
  • First confirm the mechanism: capture systemctl show serial-getty@ttyS0 -p Type -p TTYReset -p TTYVHangup on the image, and a monotonic-clock journal around the getty start and the announcement on a failing boot.

Activity

  1. added this to the v2.0.3 milestone on Oct 31, 2026
  2. pithead-developer commented on Oct 31, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #3761. Blocked on pithead#3761: its Cosign dependency fix must land before the required rootfs scan can pass. Draft PR #3805 contains the console fix, corrected fixtures and bounded capture retention; local checks and source reviews pass, and the earlier rig job passed. After #3761 lands, merge the base and renew CI, exact-head rig proof and review.

    The runner resumes this issue when that one closes.

  3. added
    blocked
    on Oct 31, 2026
  4. removed
    blocked
    on Oct 31, 2026
  5. pithead-developer commented on Oct 31, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #3805.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions