readiness probe fails an ACTIVE control-plane on ssh's known-hosts warning — own-vps dir never created in VM mode #561

Closed
opened 2026-08-15 04:03:30 +00:00 by ben · 2 comments
Owner

Symptom

2026-08-15 drive (post-#558): the entire gateway deploy succeeded — closure pushed, both sops uploads authenticated, boot+switch applied twice, ourcloud-control-plane.service genuinely active — and the control-plane row still failed, at the last possible moment, on its own readiness probe:

founding: gateway deploy: founding: probe ourcloud-control-plane.service on the gateway: clan: probe ourcloud-control-plane.service on gateway over ssh: <nil>: Failed to add the host to the list of known hosts (/home/benz/.config/Electron/own-vps/known_hosts). active

Read it closely: the ssh command returned no error (<nil>) and its stdout was active — the probe's true answer. The "failure" is ssh's benign stderr warning Failed to add the host to the list of known hosts, printed because the #458-pinned known-hosts path's parent directory (~/.config/Electron/own-vps/) does not exist on a fresh VM-mode drive — nothing in the VM path creates it, and accept-new cannot append into a missing directory.

Cause — two stacked defects

  1. The UnitActive probe folds stderr into its verdict. A probe that got exit 0 + stdout active must classify as active; ssh stderr noise (host-key bookkeeping warnings) is not part of the answer. (Same family as #549's scanner-vs-noise lesson, different code path.)
  2. The #458 own-VPS known-hosts pin is applied to the VM-mode guest without anyone owning the file's existence. Either the helper should create the directory when it first constructs the pin path, or the VM-mode face should not use the own-VPS pin at all (the VM guest's host key could be pinned from the guest's own provisioning instead).

Workaround used mid-drive

mkdir -p ~/.config/Electron/own-vps and one manual probe to record the host key — after which the probe runs clean and Retry proceeds. A fresh state home will reproduce the failure every time until fixed.

Proof

Fresh tier-1 wipe (state home has no own-vps/), drive founding: the control-plane row's readiness probe passes on first attempt. Unit test: probe classification with exit 0, stdout active, stderr carrying the known-hosts warning → active.

## Symptom 2026-08-15 drive (post-#558): the entire gateway deploy succeeded — closure pushed, both sops uploads authenticated, boot+switch applied twice, `ourcloud-control-plane.service` genuinely **active** — and the control-plane row still failed, at the last possible moment, on its own readiness probe: ``` founding: gateway deploy: founding: probe ourcloud-control-plane.service on the gateway: clan: probe ourcloud-control-plane.service on gateway over ssh: <nil>: Failed to add the host to the list of known hosts (/home/benz/.config/Electron/own-vps/known_hosts). active ``` Read it closely: the ssh command returned no error (`<nil>`) and its stdout was `active` — the probe's true answer. The "failure" is ssh's benign stderr warning `Failed to add the host to the list of known hosts`, printed because the #458-pinned known-hosts path's parent directory (`~/.config/Electron/own-vps/`) does not exist on a fresh VM-mode drive — nothing in the VM path creates it, and `accept-new` cannot append into a missing directory. ## Cause — two stacked defects 1. **The UnitActive probe folds stderr into its verdict.** A probe that got exit 0 + stdout `active` must classify as active; ssh stderr noise (host-key bookkeeping warnings) is not part of the answer. (Same family as #549's scanner-vs-noise lesson, different code path.) 2. **The #458 own-VPS known-hosts pin is applied to the VM-mode guest without anyone owning the file's existence.** Either the helper should create the directory when it first constructs the pin path, or the VM-mode face should not use the own-VPS pin at all (the VM guest's host key could be pinned from the guest's own provisioning instead). ## Workaround used mid-drive `mkdir -p ~/.config/Electron/own-vps` and one manual probe to record the host key — after which the probe runs clean and Retry proceeds. A fresh state home will reproduce the failure every time until fixed. ## Proof Fresh tier-1 wipe (state home has no `own-vps/`), drive founding: the control-plane row's readiness probe passes on first attempt. Unit test: probe classification with exit 0, stdout `active`, stderr carrying the known-hosts warning → active.
Author
Owner

This was generated by AI during triage.

Redundancy check: searched internal/clan/adapter.go (Adapter.UnitActive, execSSH) and app/helper/cmd/helper/wiring_prod.go (ownVPSKnownHostsPath) — both defects are live on main; neither is fixed. .out-of-scope/ doesn't exist yet, so no prior rejection to check.

Verified: execSSH (internal/clan/adapter.go) runs ssh via CombinedOutput(), merging stdout+stderr into one blob; UnitActive exact-matches that blob against "active"/"inactive"/"failed", so any stderr line (like ssh's known-hosts warning) makes a genuinely active unit fail the probe — reproduces the issue's exact error shape (warning line followed by the real active verdict, both folded together). Separately, ownVPSKnownHostsPath() builds the pin path but nothing MkdirAlls its parent directory before ssh's first accept-new write, and this path is shared unconditionally by every founding journey (VM/private, own-VPS, rented) via the one clan adapter wired at the founding face's construction — no per-journey branch exists.

Precedent for the fix shape: #549 (internal/clan/errors.go's logSaysFailed) established that a probe's real verdict must be read separately from incidental noise lines, never via blanket stderr suppression — same pattern applies here (classify on stdout+exit code, don't fold streams).

Defect 2 isn't a genuine two-way judgment call: giving VM mode its own host-key source would mean threading a new per-journey known-hosts choice through newClanAdapter's single call site (a real design change, unimplemented today), whereas creating the directory before first use is a one-line, zero-risk fix that covers every fresh-state-home journey. Routing to an agent with that as the steered default, per the issue's own "Proof" acceptance criteria.

Agent Brief

Category: bug
Summary: Founding's control-plane readiness probe fails a genuinely ACTIVE unit because ssh's benign known-hosts warning gets folded into the verdict, and the own-VPS known-hosts pin's directory is never created ahead of a fresh drive.

Current behavior:
Adapter.UnitActive runs systemctl is-active <unit> over ssh through Adapter.sshRun; the production implementation merges stdout and stderr into one combined stream before UnitActive classifies it. Any stderr noise — such as ssh's Failed to add the host to the list of known hosts warning — breaks the exact-match against "active", so the probe reports failure even when the unit truly is active and stdout truly was active. Separately, the own-VPS known-hosts pin path (used unconditionally by every founding journey, not just real droplets) has no parent directory created before ssh first writes a host key into it with accept-new pinning; on a fresh state home the directory doesn't exist, ssh can't write, and that failed write is exactly the stderr noise breaking the probe above.

Desired behavior:
The readiness probe classifies strictly on the ssh command's real signal — exit code and stdout — never on stderr content. Incidental stderr (host-key bookkeeping warnings, etc.) must not turn an active unit into a probe failure, while a real failure (unit inactive/failed, or a genuine ssh error) must still fail loud. Independently, the own-VPS known-hosts pin's parent directory exists before its first use on every drive, including the very first drive against a brand-new state home — no manual mkdir workaround should ever be required.

Key interfaces:

  • Adapter.sshRun / the production ssh execution path — currently merges stdout+stderr via a combined-output call; needs to make stdout available to the caller separately from stderr so classification only ever looks at stdout.
  • Adapter.UnitActive's classification logic — must key off stdout alone.
  • ownVPSKnownHostsPath() and its wiring at the founding face's construction — the directory containing this path must exist (create it, private mode) before first use, rather than assuming it's already there.

Acceptance criteria:

  • Unit test: ssh exit 0, stdout active, stderr carrying a known-hosts warning → probe classifies active.
  • Fresh state home (no own-vps/ directory yet) → a founding drive's control-plane readiness probe passes on the first attempt, no manual mkdir needed.
  • A real failure (unit inactive/failed, or a non-benign ssh error) still fails loud — this fix must not mask genuine failures, only stop misclassifying stderr noise as the verdict.

Out of scope:

  • Giving VM-mode drives their own host-key pin source separate from the own-VPS/rented-droplet pin — all journeys keep sharing the one pin path; that's a larger design change not needed to close this issue.
  • #549's own scanner/exemption list — already fixed; only its stdout/stderr-separation pattern is being reused here.
> *This was generated by AI during triage.* **Redundancy check:** searched `internal/clan/adapter.go` (`Adapter.UnitActive`, `execSSH`) and `app/helper/cmd/helper/wiring_prod.go` (`ownVPSKnownHostsPath`) — both defects are live on main; neither is fixed. `.out-of-scope/` doesn't exist yet, so no prior rejection to check. **Verified:** `execSSH` (`internal/clan/adapter.go`) runs ssh via `CombinedOutput()`, merging stdout+stderr into one blob; `UnitActive` exact-matches that blob against `"active"`/`"inactive"`/`"failed"`, so any stderr line (like ssh's known-hosts warning) makes a genuinely active unit fail the probe — reproduces the issue's exact error shape (warning line followed by the real `active` verdict, both folded together). Separately, `ownVPSKnownHostsPath()` builds the pin path but nothing `MkdirAll`s its parent directory before ssh's first accept-new write, and this path is shared unconditionally by every founding journey (VM/private, own-VPS, rented) via the one clan adapter wired at the founding face's construction — no per-journey branch exists. Precedent for the fix shape: #549 (`internal/clan/errors.go`'s `logSaysFailed`) established that a probe's real verdict must be read separately from incidental noise lines, never via blanket stderr suppression — same pattern applies here (classify on stdout+exit code, don't fold streams). Defect 2 isn't a genuine two-way judgment call: giving VM mode its own host-key source would mean threading a new per-journey known-hosts choice through `newClanAdapter`'s single call site (a real design change, unimplemented today), whereas creating the directory before first use is a one-line, zero-risk fix that covers every fresh-state-home journey. Routing to an agent with that as the steered default, per the issue's own "Proof" acceptance criteria. ## Agent Brief **Category:** bug **Summary:** Founding's control-plane readiness probe fails a genuinely ACTIVE unit because ssh's benign known-hosts warning gets folded into the verdict, and the own-VPS known-hosts pin's directory is never created ahead of a fresh drive. **Current behavior:** `Adapter.UnitActive` runs `systemctl is-active <unit>` over ssh through `Adapter.sshRun`; the production implementation merges stdout and stderr into one combined stream before `UnitActive` classifies it. Any stderr noise — such as ssh's `Failed to add the host to the list of known hosts` warning — breaks the exact-match against `"active"`, so the probe reports failure even when the unit truly is active and stdout truly was `active`. Separately, the own-VPS known-hosts pin path (used unconditionally by every founding journey, not just real droplets) has no parent directory created before ssh first writes a host key into it with accept-new pinning; on a fresh state home the directory doesn't exist, ssh can't write, and that failed write is exactly the stderr noise breaking the probe above. **Desired behavior:** The readiness probe classifies strictly on the ssh command's real signal — exit code and stdout — never on stderr content. Incidental stderr (host-key bookkeeping warnings, etc.) must not turn an active unit into a probe failure, while a real failure (unit inactive/failed, or a genuine ssh error) must still fail loud. Independently, the own-VPS known-hosts pin's parent directory exists before its first use on every drive, including the very first drive against a brand-new state home — no manual `mkdir` workaround should ever be required. **Key interfaces:** - `Adapter.sshRun` / the production ssh execution path — currently merges stdout+stderr via a combined-output call; needs to make stdout available to the caller separately from stderr so classification only ever looks at stdout. - `Adapter.UnitActive`'s classification logic — must key off stdout alone. - `ownVPSKnownHostsPath()` and its wiring at the founding face's construction — the directory containing this path must exist (create it, private mode) before first use, rather than assuming it's already there. **Acceptance criteria:** - [ ] Unit test: ssh exit 0, stdout `active`, stderr carrying a known-hosts warning → probe classifies active. - [ ] Fresh state home (no `own-vps/` directory yet) → a founding drive's control-plane readiness probe passes on the first attempt, no manual `mkdir` needed. - [ ] A real failure (unit inactive/failed, or a non-benign ssh error) still fails loud — this fix must not mask genuine failures, only stop misclassifying stderr noise as the verdict. **Out of scope:** - Giving VM-mode drives their own host-key pin source separate from the own-VPS/rented-droplet pin — all journeys keep sharing the one pin path; that's a larger design change not needed to close this issue. - #549's own scanner/exemption list — already fixed; only its stdout/stderr-separation pattern is being reused here.
Author
Owner

Claimed: being fixed directly in Ben's manual session (2026-08-15) — probe verdict from last output line + own-vps dir creation at pin construction. Swarm workers: skip.

Claimed: being fixed directly in Ben's manual session (2026-08-15) — probe verdict from last output line + own-vps dir creation at pin construction. Swarm workers: skip.
ben closed this issue 2026-08-15 04:14:17 +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.

Dependencies

No dependencies set.

Reference
Matou/idss#561
No description provided.