enroll-configure: masked_exit misreads sops-install-secrets' ssh-host-key probe as failure #456

Closed
opened 2026-08-11 23:40:39 +00:00 by ben · 2 comments
Owner

Failure

The #183 rehearsal drive went RED on the enroll-configure leg after 3 green legs (connect, point, seed), 201934ms in. connect/point/seed all passed cleanly, so pairing/founding/DNS are not implicated — this is not the known own-VPS carrier frontier (legs.json carries no skip entries for this run).

artifacts/legs.json:

journey leg "enroll-configure" went red: founding: stand up the server: clan: masked_exit on gateway: clan reported success but the log shows a real failure: [gateway] Cannot read ssh key '/etc/ssh/ssh_host_rsa_key': open /etc/ssh/ssh_host_rsa_key: no such file or directory
[gateway] Cannot read ssh key '/etc/ssh/ssh_host_ed25519_key': open /etc/ssh/ssh_host_ed25519_key: no such file or directory

state/founding-state.json gives the fuller sequence inside enroll-configure: eval preflight passed, machine vars generated, then "install · kexec: kexec complete", "install · disko: disko complete", and only then:

install · install: clan reported success but the log shows a real failure: [gateway] Cannot read ssh key '/etc/ssh/ssh_host_rsa_key' ...

So nixos-anywhere itself exited 0 (kexec and disko both completed) — the harness's own masked_exit classifier is what turned this into a fault, by treating a line in the install log as proof of a hidden failure despite the tool's clean exit.

logs/guest-*.log are all empty or connection-refused (guest-journal.log: "-- No entries --"; guest-unit.log: "Failed to connect to bus: No medium found"), and logs/droplet-journal.txt only contains journal lines from the nixos-installer kexec environment, never from the installed gateway system. That's consistent with the drive dying at/around the install step, before the target ever booted into its final config — there is no evidence of a second, later failure downstream.

Suspected layer: harness

logs/healer-claude.out (present in this same run directory) already carries a diagnosis and an applied fix for exactly this signature:

masked_exit false-positived on sops-install-secrets' benign ssh-host-key age probe (host keys don't exist yet at install time; it falls back to /var/lib/sops-nix/key.txt) — added a cannot read ssh key exemption to logSaysFailed beside the existing failed to reload/error (ignored)/warning: error: cases.
checks: go test ./internal/clan/... -run TestClassify -v — all pass incl. new TestClassify_SopsInstallSecretsSSHKeyProbeIsNotMasked; go test ./internal/clan/... — full package ok, no regressions

That matches the evidence exactly: sops-install-secrets probes several possible age-key sources during a fresh install — including deriving a key from the target's ssh host keys — and is expected to fail that probe on a brand-new machine (the host keys don't exist yet) before falling back to /var/lib/sops-nix/key.txt. logSaysFailed in internal/clan was flagging that benign stderr line as a real failure even though clan/nixos-anywhere exited 0, so masked_exit converted a successful install into a reported fault.

The healer's fix commit is 235c30f9ba6133e569b0e30e62500cc87fb2d744, but it does not appear in this repo's current main history (recent commits are b102fcc, ef08a0a, 42c33fb, 74947d2, 39c5a23 — none of them 235c30f9). Either that commit lives on an unmerged branch/worktree from the healer's own run, or it hasn't landed yet.

What plugging it needs

  1. Confirm whether 235c30f9ba6133e569b0e30e62500cc87fb2d744 (the logSaysFailed "cannot read ssh key" exemption in internal/clan, with TestClassify_SopsInstallSecretsSSHKeyProbeIsNotMasked) is merged into the branch this drive ran against; if not, land/cherry-pick it.
  2. Re-run the #183 rehearsal drive against a fresh droplet to confirm enroll-configure goes green with the fix in place — this run's own evidence (empty guest logs, journal only from the installer stage) can't confirm the gateway would have come up cleanly past this point, only that nothing else failed downstream.
  3. No product-layer defect is indicated: the community stand-up's own install step succeeded (kexec + disko complete, clan exited 0); the only thing that needs fixing is the harness's failure classifier.

drive 20260811T232725Z red at enroll-configure: journey leg "enroll-configure" went red: founding: stand up the server: clan: masked_exit on gateway: clan reported success but the log shows a real failure: [gateway] Cannot read ssh key '/etc/ssh/ss [gateway] Cannot read ssh key '/etc/ssh/ssh_host_H_key': open /etc/ssh/ssh_host_H_key: no such file or directory
evidence: test-results/…/20260811T232725Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)

## Failure The #183 rehearsal drive went RED on the `enroll-configure` leg after 3 green legs (`connect`, `point`, `seed`), 201934ms in. `connect`/`point`/`seed` all passed cleanly, so pairing/founding/DNS are not implicated — this is not the known own-VPS carrier frontier (`legs.json` carries no skip entries for this run). `artifacts/legs.json`: > journey leg "enroll-configure" went red: founding: stand up the server: clan: masked_exit on gateway: clan reported success but the log shows a real failure: [gateway] Cannot read ssh key '/etc/ssh/ssh_host_rsa_key': open /etc/ssh/ssh_host_rsa_key: no such file or directory > [gateway] Cannot read ssh key '/etc/ssh/ssh_host_ed25519_key': open /etc/ssh/ssh_host_ed25519_key: no such file or directory `state/founding-state.json` gives the fuller sequence inside `enroll-configure`: eval preflight passed, machine vars generated, then "install · kexec: kexec complete", "install · disko: disko complete", and only then: > install · install: clan reported success but the log shows a real failure: [gateway] Cannot read ssh key '/etc/ssh/ssh_host_rsa_key' ... So `nixos-anywhere` itself exited 0 (kexec and disko both completed) — the harness's own `masked_exit` classifier is what turned this into a fault, by treating a line in the install log as proof of a hidden failure despite the tool's clean exit. `logs/guest-*.log` are all empty or connection-refused (`guest-journal.log`: "-- No entries --"; `guest-unit.log`: "Failed to connect to bus: No medium found"), and `logs/droplet-journal.txt` only contains journal lines from the `nixos-installer` kexec environment, never from the installed `gateway` system. That's consistent with the drive dying at/around the install step, before the target ever booted into its final config — there is no evidence of a second, later failure downstream. ## Suspected layer: harness `logs/healer-claude.out` (present in this same run directory) already carries a diagnosis and an applied fix for exactly this signature: > masked_exit false-positived on sops-install-secrets' benign ssh-host-key age probe (host keys don't exist yet at install time; it falls back to /var/lib/sops-nix/key.txt) — added a `cannot read ssh key` exemption to logSaysFailed beside the existing `failed to reload`/`error (ignored)`/`warning: error:` cases. > checks: go test ./internal/clan/... -run TestClassify -v — all pass incl. new TestClassify_SopsInstallSecretsSSHKeyProbeIsNotMasked; go test ./internal/clan/... — full package ok, no regressions That matches the evidence exactly: `sops-install-secrets` probes several possible age-key sources during a fresh install — including deriving a key from the target's ssh host keys — and is *expected* to fail that probe on a brand-new machine (the host keys don't exist yet) before falling back to `/var/lib/sops-nix/key.txt`. `logSaysFailed` in `internal/clan` was flagging that benign stderr line as a real failure even though `clan`/`nixos-anywhere` exited 0, so `masked_exit` converted a successful install into a reported fault. The healer's fix commit is `235c30f9ba6133e569b0e30e62500cc87fb2d744`, but it does not appear in this repo's current `main` history (recent commits are `b102fcc`, `ef08a0a`, `42c33fb`, `74947d2`, `39c5a23` — none of them `235c30f9`). Either that commit lives on an unmerged branch/worktree from the healer's own run, or it hasn't landed yet. ## What plugging it needs 1. Confirm whether `235c30f9ba6133e569b0e30e62500cc87fb2d744` (the `logSaysFailed` "cannot read ssh key" exemption in `internal/clan`, with `TestClassify_SopsInstallSecretsSSHKeyProbeIsNotMasked`) is merged into the branch this drive ran against; if not, land/cherry-pick it. 2. Re-run the #183 rehearsal drive against a fresh droplet to confirm `enroll-configure` goes green with the fix in place — this run's own evidence (empty guest logs, journal only from the installer stage) can't confirm the gateway would have come up cleanly past this point, only that nothing else failed downstream. 3. No product-layer defect is indicated: the community stand-up's own install step succeeded (kexec + disko complete, clan exited 0); the only thing that needs fixing is the harness's failure classifier. drive `20260811T232725Z` red at `enroll-configure`: `journey leg "enroll-configure" went red: founding: stand up the server: clan: masked_exit on gateway: clan reported success but the log shows a real failure: [gateway] Cannot read ssh key '/etc/ssh/ss [gateway] Cannot read ssh key '/etc/ssh/ssh_host_H_key': open /etc/ssh/ssh_host_H_key: no such file or directory` evidence: `test-results/…/20260811T232725Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) <!-- rehearsal-sig: a26965b5356b -->
Author
Owner

swarm-claim host=matou-dev-server-01 run=4824
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=4824 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

Landed as a2db19e on main. logSaysFailed (internal/clan/errors.go) now exempts cannot read ssh key beside the existing failed to reload / error (ignored) / warning: error: cases — the benign line sops-install-secrets prints when it probes the target's ssh host keys during a fresh install (keys absent on a brand-new machine; it falls back to /var/lib/sops-nix/key.txt). A real failure line elsewhere in the same log still trips masked_exit.

The healer's 235c30f9 fix was NOT in this branch's history — this reimplements the same exemption from the evidence. Pinned by TestClassify_SopsInstallSecretsSSHKeyProbeIsNotMasked (benign probe → success; real failure beside it → masked_exit carrying the real line as proof). go test ./internal/clan/... -run TestClassify green; full package green, no regressions.

Note item 2 (re-run the #183 rehearsal drive against a fresh droplet to confirm enroll-configure goes green with the fix in place) still needs a human/operator with lab access — this run's own evidence (empty guest logs, journal only from the installer stage) can only confirm nothing failed downstream, not that the gateway would boot clean past this point.

Landed as `a2db19e` on `main`. `logSaysFailed` (`internal/clan/errors.go`) now exempts `cannot read ssh key` beside the existing `failed to reload` / `error (ignored)` / `warning: error:` cases — the benign line sops-install-secrets prints when it probes the target's ssh host keys during a fresh install (keys absent on a brand-new machine; it falls back to `/var/lib/sops-nix/key.txt`). A real failure line elsewhere in the same log still trips `masked_exit`. The healer's `235c30f9` fix was NOT in this branch's history — this reimplements the same exemption from the evidence. Pinned by `TestClassify_SopsInstallSecretsSSHKeyProbeIsNotMasked` (benign probe → success; real failure beside it → masked_exit carrying the real line as proof). `go test ./internal/clan/... -run TestClassify` green; full package green, no regressions. Note item 2 (re-run the #183 rehearsal drive against a fresh droplet to confirm enroll-configure goes green with the fix in place) still needs a human/operator with lab access — this run's own evidence (empty guest logs, journal only from the installer stage) can only confirm nothing failed downstream, not that the gateway would boot clean past this point.
ben closed this issue 2026-08-12 00:02:02 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#456
No description provided.