standing/image-boot: timed-out first SSH dial escapes waitForSSHCommand's retry loop #929

Closed
opened 2026-08-28 06:48:52 +00:00 by matou-build-agent · 2 comments

No live box was offered

No live-box section was appended to this diagnosis, so there is no access line and no read-only limit to obey. Everything below is read from the harvested run directory alone. Both DO droplets are recorded as active at harvest time, but I did not dial either.

Not the known frontier

The drive's KNOWN frontier — pairing never flipping, the own-VPS carrier issue — is not what red this run. artifacts/legs.json carries zero skips and therefore names no skip reason at all; artifacts/verdict.json agrees ("skip": 0). The pairing frontier was never reached: artifacts/journey.json is

{ "rows": null, "fault": null }

— no founding rows, no fault. The drive died before it. This is an earlier, different red.

The failure

verdict.json names standing as firstRedLeg, but standing is the umbrella leg for the whole spec (journey.device.spec.ts:272, "drives the #183 device-add journey on the standing rented community"): its 48734 ms is the sum of the inner legs, and it carries the inner leg's error verbatim. The leg that actually broke is image-boot:

{ "leg": "image-boot", "status": "red", "ms": 10129,
  "error": "ssh root@134.199.165.253 timed out after 10000ms: systemctl is-active idss-agent" }

wizard-rent (36863 ms), claim and create were all green. The app was not failing — the page snapshot in error-context.md at the moment of the throw shows it mid-step, not errored:

- generic: Connect to the rented server over SSH
- generic: 2%

The defect

Playwright embedded the fixture source as it stood at drive time. waitForSSHCommand exists precisely to absorb a not-yet-reachable fresh box (its own comment cites GOTCHAS #2, #691), but it awaits the dial with no catch:

116 |   for (;;) {
117 |     last = await sshDroplet(ip, cmd, perAttemptMs, identityFile);
118 |     if (last.stdout.trim() === want) return last;
119 |     if (Date.now() >= deadline) return last;
120 |     await new Promise((resolve) => setTimeout(resolve, pollMs));
121 |   }

The two dial outcomes are not symmetric. A refused dial reaches the close handler and resolves with code 255, so the loop retries it:

 89 |     child.on('close', (code) => {
 90 |       clearTimeout(timer);
 91 |       resolve({ code: code ?? -1, stdout, stderr });

A timed-out dial takes the SIGKILL path and rejects — the caret in error-context.md points at exactly this line:

 81 |     const timer = setTimeout(() => {
 82 |       child.kill('SIGKILL');
> 83 |       reject(new Error(`ssh root@${ip} timed out after ${timeoutMs}ms: ${command}`));
      |              ^ Error: ssh root@134.199.165.253 timed out after 10000ms: systemctl is-active idss-agent

So the rejection escapes the loop on attempt one. The leg's own arithmetic is the proof: it died in 10129 ms — one 10000 ms perAttemptMs — out of a 120000 ms budget. It never made a second attempt.

And a second attempt would have succeeded. The gateway was seconds old when probed, and answered moments later (logs/gateway-do-forensics.txt):

=== droplet 595814907 ===
name:    idss-gateway-rehearsal-c-2068
created: 2026-08-28T06:36:46Z
3373056579    completed    create    2026-08-28 06:36:46 +0000 UTC    2026-08-28 06:37:20 +0000 UTC
=== reachability from the drive host, 2026-08-28T06:37:34Z ===
3 packets transmitted, 3 received, 0% packet loss
tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did

DO finished creating the box at 06:37:20; the probe ran against a ~1-second-old box, timed out at ~06:37:29, and 5 s later tcp/22 answered a fresh connect. Nothing was wrong with the box or the product — the harness raced its own budget away.

Suspected layer

Harness, and only the harness: app/tests/e2e/fixtures/droplet.ts. Not product (the app was at 2% of "Connect to the rented server over SSH", still working), not infra (the box came up on schedule and answered).

What plugging it needs

The in-run healer already reports this one healed — logs/healer-claude.out records "action":"healed", commit 2e038b6e85d25a90060e1b267db4c76406a34ef4, teaching the loop to catch a rejected dial and retry until the budget, rethrowing on a never-reachable box and raising the #885 missing-identity refusal up front so the new catch cannot swallow it, with +3 seam tests (vitest run tests/e2e/fixtures/droplet.test.ts — 17 pass; 1 fails with this drive's exact message when the fix is stashed). First action is to confirm that commit is on main — the drive ran at f618a6ce, and I could not read outside the run directory to verify it landed. If it did, this red needs no further code.

What is not plugged is the evidence gap this red exposed, which the healer filed as its residual and is worth acting on independently: every gateway-side harvest is one line —

root@134.199.165.253: Permission denied (publickey,keyboard-interactive).
    note: gateway ... harvest failed (gateway unreachable?)

— in all four of gateway-journal.txt, gateway-units.txt, gateway-stall.txt, gateway-caddy.txt, while the same verb against the device box harvested 1272 lines of device-journal.txt plus stall and unit state. The parenthetical is wrong on its own evidence (tcp/22 answered a fresh connect at 06:37:34). The shell harvest in scripts/lib/rehearsal-droplet.sh dials with no -i, riding the executor's ambient key, which a broker-rented gateway can never accept (it trusts only the app's rent-operator key — #885, GOTCHAS #101). Threading a per-box identity through oc_droplet_evidence, derived from OC_STANDING_DIR and loud when absent, would have given this red gateway-side confirmation instead of an inference from timestamps.

Also absent from this run (explained, not defects)

  • logs/droplet-journal.txt does not exist — on a device-target drive #894 splits that capture into the gateway-/device- labelled files.
  • state/ in the run dir is empty: the drive red before any deploy, so no clan-config flake was captured.
  • logs/state-logs.log records ENOENT ... test-results/standing-rented/state/logs and logs/broker-journal.txt an off-mesh Permission denied — both self-describing and not load-bearing for this verdict (#681).
  • logs/guest-*.log and logs/qemu.log are empty by construction: host.json shows qemu: exit ENOENT: spawn qemu-system-x86_64 ENOENT, and guest-failed-units.log says "the guest was never created, so there is nothing to ask". This drive used real droplets, not a guest VM.

drive 20260828T063513Z red at standing: ssh root@134.199.165.253 timed out after 10000ms: systemctl is-active idss-agent
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260828T063513Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## No live box was offered No live-box section was appended to this diagnosis, so there is no access line and no read-only limit to obey. Everything below is read from the harvested run directory alone. Both DO droplets are recorded as `active` at harvest time, but I did not dial either. ## Not the known frontier The drive's KNOWN frontier — pairing never flipping, the own-VPS carrier issue — is **not** what red this run. `artifacts/legs.json` carries **zero skips** and therefore names no skip reason at all; `artifacts/verdict.json` agrees (`"skip": 0`). The pairing frontier was never reached: `artifacts/journey.json` is ```json { "rows": null, "fault": null } ``` — no founding rows, no fault. The drive died before it. This is an earlier, different red. ## The failure `verdict.json` names `standing` as `firstRedLeg`, but `standing` is the umbrella leg for the whole spec (`journey.device.spec.ts:272`, "drives the #183 device-add journey on the standing rented community"): its 48734 ms is the sum of the inner legs, and it carries the inner leg's error verbatim. The leg that actually broke is **`image-boot`**: ```json { "leg": "image-boot", "status": "red", "ms": 10129, "error": "ssh root@134.199.165.253 timed out after 10000ms: systemctl is-active idss-agent" } ``` `wizard-rent` (36863 ms), `claim` and `create` were all green. The app was not failing — the page snapshot in `error-context.md` at the moment of the throw shows it mid-step, not errored: ``` - generic: Connect to the rented server over SSH - generic: 2% ``` ## The defect Playwright embedded the fixture source as it stood at drive time. `waitForSSHCommand` exists precisely to absorb a not-yet-reachable fresh box (its own comment cites GOTCHAS #2, #691), but it awaits the dial with no catch: ```ts 116 | for (;;) { 117 | last = await sshDroplet(ip, cmd, perAttemptMs, identityFile); 118 | if (last.stdout.trim() === want) return last; 119 | if (Date.now() >= deadline) return last; 120 | await new Promise((resolve) => setTimeout(resolve, pollMs)); 121 | } ``` The two dial outcomes are not symmetric. A *refused* dial reaches the close handler and **resolves** with code 255, so the loop retries it: ```ts 89 | child.on('close', (code) => { 90 | clearTimeout(timer); 91 | resolve({ code: code ?? -1, stdout, stderr }); ``` A *timed-out* dial takes the SIGKILL path and **rejects** — the caret in `error-context.md` points at exactly this line: ```ts 81 | const timer = setTimeout(() => { 82 | child.kill('SIGKILL'); > 83 | reject(new Error(`ssh root@${ip} timed out after ${timeoutMs}ms: ${command}`)); | ^ Error: ssh root@134.199.165.253 timed out after 10000ms: systemctl is-active idss-agent ``` So the rejection escapes the loop on attempt one. The leg's own arithmetic is the proof: it died in **10129 ms — one 10000 ms `perAttemptMs`** — out of a 120000 ms budget. It never made a second attempt. And a second attempt would have succeeded. The gateway was seconds old when probed, and answered moments later (`logs/gateway-do-forensics.txt`): ``` === droplet 595814907 === name: idss-gateway-rehearsal-c-2068 created: 2026-08-28T06:36:46Z 3373056579 completed create 2026-08-28 06:36:46 +0000 UTC 2026-08-28 06:37:20 +0000 UTC ``` ``` === reachability from the drive host, 2026-08-28T06:37:34Z === 3 packets transmitted, 3 received, 0% packet loss tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did ``` DO finished creating the box at 06:37:20; the probe ran against a ~1-second-old box, timed out at ~06:37:29, and 5 s later tcp/22 answered a fresh connect. Nothing was wrong with the box or the product — the harness raced its own budget away. ## Suspected layer **Harness**, and only the harness: `app/tests/e2e/fixtures/droplet.ts`. Not product (the app was at 2% of "Connect to the rented server over SSH", still working), not infra (the box came up on schedule and answered). ## What plugging it needs The in-run healer already reports this one healed — `logs/healer-claude.out` records `"action":"healed"`, commit `2e038b6e85d25a90060e1b267db4c76406a34ef4`, teaching the loop to catch a rejected dial and retry until the budget, rethrowing on a never-reachable box and raising the #885 missing-identity refusal up front so the new catch cannot swallow it, with +3 seam tests (`vitest run tests/e2e/fixtures/droplet.test.ts` — 17 pass; 1 fails with this drive's exact message when the fix is stashed). **First action is to confirm that commit is on `main`** — the drive ran at `f618a6ce`, and I could not read outside the run directory to verify it landed. If it did, this red needs no further code. What is *not* plugged is the evidence gap this red exposed, which the healer filed as its residual and is worth acting on independently: every gateway-side harvest is one line — ``` root@134.199.165.253: Permission denied (publickey,keyboard-interactive). note: gateway ... harvest failed (gateway unreachable?) ``` — in all four of `gateway-journal.txt`, `gateway-units.txt`, `gateway-stall.txt`, `gateway-caddy.txt`, while the same verb against the device box harvested 1272 lines of `device-journal.txt` plus stall and unit state. The parenthetical is wrong on its own evidence (tcp/22 answered a fresh connect at 06:37:34). The shell harvest in `scripts/lib/rehearsal-droplet.sh` dials with no `-i`, riding the executor's ambient key, which a broker-rented gateway can never accept (it trusts only the app's rent-operator key — #885, GOTCHAS #101). Threading a per-box identity through `oc_droplet_evidence`, derived from `OC_STANDING_DIR` and loud when absent, would have given this red gateway-side confirmation instead of an inference from timestamps. ## Also absent from this run (explained, not defects) - `logs/droplet-journal.txt` does not exist — on a device-target drive #894 splits that capture into the `gateway-`/`device-` labelled files. - `state/` in the run dir is empty: the drive red before any deploy, so no clan-config flake was captured. - `logs/state-logs.log` records `ENOENT ... test-results/standing-rented/state/logs` and `logs/broker-journal.txt` an off-mesh `Permission denied` — both self-describing and not load-bearing for this verdict (#681). - `logs/guest-*.log` and `logs/qemu.log` are empty by construction: `host.json` shows `qemu: exit ENOENT: spawn qemu-system-x86_64 ENOENT`, and `guest-failed-units.log` says "the guest was never created, so there is nothing to ask". This drive used real droplets, not a guest VM. drive `20260828T063513Z` red at `standing`: `ssh root@134.199.165.253 timed out after 10000ms: systemctl is-active idss-agent` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260828T063513Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 25304f657c24 -->
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=13097
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=13097 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #929 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 929,
  "status": "success",
  "commits": [
    "3901e93"
  ],
  "changed_files": [
    "app/tests/e2e/fixtures/droplet.ts",
    "app/tests/e2e/fixtures/droplet.test.ts"
  ],
  "tests": [
    {
      "command": "npx vitest run tests/e2e/fixtures/droplet.test.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A timed-out first SSH dial no longer escapes waitForSSHCommand's retry loop": "droplet.ts waitForSSHCommand now wraps sshDroplet in try/catch, swallows a rejected (timed-out) dial and retries until budget — proven by droplet.test.ts 'retries past a timed-out first dial and succeeds on a later attempt' (fails with the drive's exact 'timed out after ...ms' message when the fix is stashed, passes with it)",
    "A genuinely-unreachable box still reds loud": "on budget exhaustion the last attempt's rejection is rethrown — droplet.test.ts 'rethrows the dial timeout when the box is never reachable within budget'",
    "The #885 missing-identity refusal is not swallowed by the new catch": "assertIdentityFileExists raised up front before the loop — droplet.test.ts 'rejects a missing identityFile up front, before any dial is attempted' asserts no ssh dial is ever spawned"
  },
  "summary": "waitForSSHCommand now retries a rejected (timed-out) first dial to the budget instead of reding the leg on attempt one, while raising the #885 missing-identity refusal up front so the catch can never swallow it.",
  "no_code_change": ""
}
**close-report** for #929 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 929, "status": "success", "commits": [ "3901e93" ], "changed_files": [ "app/tests/e2e/fixtures/droplet.ts", "app/tests/e2e/fixtures/droplet.test.ts" ], "tests": [ { "command": "npx vitest run tests/e2e/fixtures/droplet.test.ts", "exit_code": 0 } ], "criteria": { "A timed-out first SSH dial no longer escapes waitForSSHCommand's retry loop": "droplet.ts waitForSSHCommand now wraps sshDroplet in try/catch, swallows a rejected (timed-out) dial and retries until budget — proven by droplet.test.ts 'retries past a timed-out first dial and succeeds on a later attempt' (fails with the drive's exact 'timed out after ...ms' message when the fix is stashed, passes with it)", "A genuinely-unreachable box still reds loud": "on budget exhaustion the last attempt's rejection is rethrown — droplet.test.ts 'rethrows the dial timeout when the box is never reachable within budget'", "The #885 missing-identity refusal is not swallowed by the new catch": "assertIdentityFileExists raised up front before the loop — droplet.test.ts 'rejects a missing identityFile up front, before any dial is attempted' asserts no ssh dial is ever spawned" }, "summary": "waitForSSHCommand now retries a rejected (timed-out) first dial to the budget instead of reding the leg on attempt one, while raising the #885 missing-identity refusal up front so the catch can never swallow it.", "no_code_change": "" } ``` </details>
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#929
No description provided.