Skip to content

feat(agent): show the config error below the pairing QR code - #5227

Merged
Itxaka merged 3 commits into
kairos-io:masterfrom
itxaka-agent:triage/3248-config-error-under-qr
Oct 7, 2026
Merged

Itxaka merged 3 commits into
kairos-io:masterfrom
itxaka-agent:triage/3248-config-error-under-qr

Conversation

@itxaka-agent

@itxaka-agent itxaka-agent commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Automated triage agent (kairos-triage-agent) running as @itxaka-agent.
This comment was generated by software. A human maintainer can override
any action taken here.

When a node boots with a cloud-config that is found but fails to read, AutoInstall printed the error and Install cleared the screen right after, so the QR code was the only thing left and nothing said the config was broken.

AutoInstall now returns the scan error separately from the install error. Install takes it and prints it as the last thing on the pairing screen, below the QR code and the interfaces line, or just before dropping to a shell when no provider is registered. A node with no config at all stays quiet: config.Scan reports that as an empty config, not as an error. The install command passes the error through; interactive-install is unchanged.

New specs check the notice text, that it comes after the QR code and Interfaces:, that it still shows with no QR code, and that it is silent without an error. AutoInstall specs cover the missing-config and broken-config cases. The ordering spec fails if the print moves above the QR code.

Booted the v4.3.0 Hadron live ISO with install.ssh_hardening: true and no users: master shows the QR code with no error, this branch shows the red error under it, and a node with no config shows only the QR code. Screenshots are in the next comment. The agent binary was swapped inside the running guest and kairos-agent install was run by hand, not through the GRUB boot path.

Left out on purpose: schema warnings outside strict mode, which are still printed before the clear, and the interactive-install screen.

Fixes: #3248

Audit summary: #3248 (comment)

Signed-off-by: itxaka-agent itxaka-agent@users.noreply.github.com

A config that is found but fails to read was reported by AutoInstall
before Install cleared the screen to draw the branding and the QR code,
so the operator never saw it. AutoInstall now hands the scan error back
to its caller, and Install prints it again as the last thing on the
pairing screen, below the QR code and the interfaces, or before dropping
to a shell when there are no providers.

A node booted with no config at all stays quiet: config.Scan reports
that as an empty config, not as an error.

Fixes kairos-io#3248

Co-authored-by: Itxaka <itxakaserrano@gmail.com>
Signed-off-by: itxaka-agent <itxaka-agent@users.noreply.github.com>
@itxaka-agent

Copy link
Copy Markdown
Collaborator Author

Automated triage agent (kairos-triage-agent) running as @itxaka-agent.
This comment was generated by software. A human maintainer can override
any action taken here.

QEMU verification and test run for 104193e.

Booted the v4.3.0 Hadron live ISO under KVM with a broken /oem config (install.ssh_hardening: true, no users, auto: false), stopped kairos-installer.service and ran kairos-agent install by hand on tty1. Only the agent binary was swapped, built from master (1020f7f) and from this branch. This is not the GRUB boot path.

master, broken config: QR code and Interfaces: ens3, no error.

master

This branch, same config: red error under the QR code and interfaces line.

branch

This branch, no config at all: QR code only, no notice.

no config

Unit tests: go test -count=1 ./agent/internal/agent/ ./agent/pkg/cmd/ at 104193e on 2026-10-05, both packages ok.

tests

Blob SHAs: qemu-before 524b2dc, qemu-after 4a275c8, qemu-noconfig e16e615, tests-agent d511976.

@ci-robbot

Copy link
Copy Markdown
Collaborator

Picking this up for QA.

@ci-robbot

Copy link
Copy Markdown
Collaborator

QA Result: PASS

Check Result
Environment Hadron v0.5.3 standard ISO (k3s v1.36.5, agent-provider-kairos present), amd64, QEMU/KVM, BIOS. Booted through GRUB's default Kairos entry (install-mode), so tty1 is driven by the real kairos-installer.service. Agent built from PR head 104193e2 and from its merge base 1020f7fe (master), bound over /usr/bin/kairos by an ExecStartPre drop-in before the unit's first start. sha256 of the bound binary checked on each VM: base 4a619604..., PR f53ebd01...
Reproduction Three boots, config delivered as a NoCloud cidata disk. (A) master agent, broken config: user kairos with only a passwd, plus install.ssh_hardening: true, which makes config.Scan fail its semantic check. (B) PR agent, same broken config. (C) PR agent, same config minus install.ssh_hardening, so the scan succeeds. Screendump of tty1 after the pairing screen settled, and the QR code decoded with zbarimg
Expected (A) reproduces #3248: QR code, no word about the config. (B) the error is printed under the QR code and stays on screen. (C) no notice. The QR code stays readable in all three
Actual (A) QR code and Interfaces: ens3, nothing else. (B) QR code, Interfaces: ens3, then a red ERROR The configuration on this node could not be read: ERROR: install.ssh_hardening: true requires at least one user with ssh_authorized_keys; ... as the last lines on tty1. (C) QR code and Interfaces: ens3, no notice. zbarimg decodes the same pairing payload from all three screens, so the two extra lines do not push the code off the screen
Proofs Screenshots below, and the broken user-data. go test -count=1 ./agent/internal/agent/ ./agent/pkg/cmd/ at 104193e2: both ok

(A) master, broken config:

master broken config

(B) this PR, broken config:

PR broken config

(C) this PR, valid config:

PR valid config

Summary: On a real live boot of a standard image, the installer unit now shows why a config was rejected, under the pairing QR code where #3248 asked for it. A valid config still shows no notice, and the QR code still decodes.

Not covered: the "No providers found" branch (core images) was not booted; it is covered by the PR's unit specs only. Also seen, not caused by this PR: with a 1024x768 console the two extra lines scroll the top border of the banner box off screen in (B). The box text is still visible.

@Itxaka
Itxaka enabled auto-merge (squash) October 6, 2026 11:01
@Itxaka
Itxaka temporarily deployed to fork-pr-builds October 6, 2026 11:01 — with GitHub Actions Inactive
@Itxaka
Itxaka disabled auto-merge October 7, 2026 08:16
@Itxaka
Itxaka merged commit 6e569f2 into kairos-io:master Oct 7, 2026
25 checks passed
@github-project-automation github-project-automation Bot moved this from QA OK to Done โœ… in ๐Ÿง™Issue tracking board Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: display invalid config on a new node at boot end

3 participants