deploy-takeover: gateway IP read from a facts.json a re-found drive never has #1106

Closed
opened 2026-09-01 06:42:59 +00:00 by matou-build-agent · 1 comment

The failure

deploy-takeover is this drive's first and only red — artifacts/verdict.json records "legs": { "total": 27, "green": 26, "red": 1, "skip": 0 }, "firstRedLeg": "deploy-takeover", at "commit": "953c928003293b902f09bebed173b464493aa29d".

It died in 322 ms, before it touched anything. From artifacts/legs.json:

{ "leg": "deploy-takeover", "status": "red", "ms": 322,
  "error": "no standing gateway IP on record (facts.json .ip) — cannot reach the taken-over device, which trusts only the gateway's own deploy key (#1099)" }

The throw site is in the spec, from artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md:

  704 |           const gwIp = readStandingFacts()?.ip;
> 706 |             throw new Error(
      |                   ^ Error: no standing gateway IP on record (facts.json .ip) — cannot reach the taken-over device, which trusts only the gateway's own deploy key (#1099)
  711 |           const gwIdentity = join(standingStateDir(), 'rent-operator', 'id_ed25519');
  712 |           await confirmEraseDeploy(dash);

So the leg threw at :706, one line above confirmEraseDeploy(dash) at :712. The erase consent was never given, the takeover deploy never ran, and the box was never dialled. The relay through the gateway that HEAD's commit (953c9280, "relay the post-takeover device dials through the gateway") introduced is what failed — on its address lookup, not on the dial.

The gateway was up, and this run knew its address

The only thing missing was facts.json. The address itself is written twice inside this very run directory:

  • artifacts/droplet-ip.txt (mtime 06:14, the wizard-rent leg): 209.38.20.29
  • artifacts/standing-founded.json (mtime 06:27, the founded leg): { "slug": "rehearsal-e", "host": "rehearsal-e.idss.nz", "ip": "209.38.20.29", "sha": "953c9280..." }

The leg reds at ~06:28 (artifacts/legs/deploy-takeover-*.png, mtime 06:28) — after both files exist. And the gateway that address names was alive and answering ssh, per logs/gateway-do-forensics.txt:

=== droplet 596817389 ===
name:    idss-gateway-rehearsal-e-842a
status:  active
image:   idss-gateway-953c92800329
3 packets transmitted, 3 received, 0% packet loss
tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did

What was absent is the standing home the spec reads from. logs/state-logs.log catches it independently:

ERROR: no state logs directory at /home/swarm/swarm/Matou/idss/test-results/standing-rented/state/logs: ENOENT

On a re-found drive the standing home is torn down before playwright starts and rewritten from artifacts/standing-founded.json only after playwright exits — so readStandingFacts() returns undefined for the whole drive, every drive, deterministically. The address source the spec chose is the one source guaranteed empty at the moment it reads it.

The device confirms nothing ran on it

logs/device-do-forensics.txt — image: 24.04 (LTS) x64, status: active, tcp/22: a FRESH connect succeeded. logs/device-units.txt:

=== ss -tlnp ===
LISTEN 0 4096  0.0.0.0:22  users:(("sshd",pid=10385,...))
LISTEN 0 4096  100.91.205.159:53  users:(("netbird",pid=9061,...))
=== systemctl --failed ===
(nothing)

Stock Ubuntu with sshd and netbird, no failed units, no NixOS. The takeover was never attempted; there is no product defect visible in this red.

Suspected layer

Harness — app/tests/e2e/journey.device.spec.ts:704. Not product, not infra: both droplets were up and reachable, the gateway image matches the drive commit, and the address the spec wanted was sitting in two files in its own run directory.

Not the known frontier

This is not the own-VPS carrier frontier. pair is green at 141 ms and artifacts/legs.json carries no skip reasons at all ("skip": 0). This is a fresh regression in the #1099 relay code that landed at HEAD.

A fix exists but did not land

The run's own healer diagnosed this identically and wrote a fix (logs/healer-claude.out: "action":"healed", "commit":"7a3788a3...", adding resolveGatewayIp in app/tests/e2e/fixtures/droplet.ts with 31 passing seam tests and a red-first proof). It never reached the tree. logs/healer-claude.err:

CONFLICT (content): Merge conflict in app/tests/e2e/journey.device.spec.ts
error: could not apply 237e85f2... rehearsal healer: deploy-takeover read the gateway off a facts.json a re-found drive never has (sig 800a2936720b)

Note the signature 800a2936720b is the same one carried by the already-landed 9ad39c59 ("deploy-takeover read stdout off a REFUSED ssh dial") — the healer rebased a second fix for the same leg onto a spec that had already moved under it, and the rebase stopped. Whoever picks this up should resolve that conflict rather than re-derive the fix.

What plugging it needs

  1. Replace readStandingFacts()?.ip at journey.device.spec.ts:704 with a resolver that uses the same precedence the bash harvest already uses: in-run artifacts/standing-founded.json → artifacts/droplet-ip.txt → standing facts.json (adopt drives only). The healer's resolveGatewayIp in app/tests/e2e/fixtures/droplet.ts is exactly this; land it by resolving the 237e85f2 rebase conflict.
  2. Keep the fault sentence but make it name all three sources, so a genuine no-gateway drive is still diagnosable from artifacts alone.
  3. Seam-test the precedence in app/tests/e2e/fixtures/droplet.test.ts, pinning the re-found-drive shape (facts.json absent, standing-founded.json present) — that case is the whole defect.
  4. Same-file follow-up, out of scope for this red but flagged by the healer's residual: the files-door leg at :773-775 reads the gateway from readStandingFacts() too, but behind an if (gatewayIp) guard — so it silently skips its ADR 0210 mesh-route assertion instead of redding. Fixing the address source there without also passing gwIdentity and reading through sshDropletStdout would convert a quiet skip into a quiet false pass; do all three or none.

What is absent / not consulted

  • No logs/droplet-journal.txt in this run directory — a device drive harvests logs/device-journal.txt (168 KB) and logs/gateway-journal.txt (606 KB) instead; both are present.
  • No live-box section was appended to this report request, so no box was dialled for this diagnosis — it rests on the harvested records alone. Both droplets were still up and answering tcp/22 at the 06:33 harvest, per the two *-do-forensics.txt files. Nothing here needed a live machine: the failure is a missing file read in the spec, and the artifacts pin it exactly.
  • The standing home test-results/standing-rented/ sits outside this run directory and was not read directly; logs/state-logs.log's ENOENT is the in-run evidence for its state.

drive 20260901T052209Z red at deploy-takeover: no standing gateway IP on record (facts.json .ip) — cannot reach the taken-over device, which trusts only the gateway's own deploy key (#1099)
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260901T052209Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure `deploy-takeover` is this drive's first and only red — `artifacts/verdict.json` records `"legs": { "total": 27, "green": 26, "red": 1, "skip": 0 }`, `"firstRedLeg": "deploy-takeover"`, at `"commit": "953c928003293b902f09bebed173b464493aa29d"`. It died in **322 ms**, before it touched anything. From `artifacts/legs.json`: ```json { "leg": "deploy-takeover", "status": "red", "ms": 322, "error": "no standing gateway IP on record (facts.json .ip) — cannot reach the taken-over device, which trusts only the gateway's own deploy key (#1099)" } ``` The throw site is in the spec, from `artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md`: ``` 704 | const gwIp = readStandingFacts()?.ip; > 706 | throw new Error( | ^ Error: no standing gateway IP on record (facts.json .ip) — cannot reach the taken-over device, which trusts only the gateway's own deploy key (#1099) 711 | const gwIdentity = join(standingStateDir(), 'rent-operator', 'id_ed25519'); 712 | await confirmEraseDeploy(dash); ``` So the leg threw at `:706`, one line *above* `confirmEraseDeploy(dash)` at `:712`. The erase consent was never given, the takeover deploy never ran, and the box was never dialled. The relay through the gateway that HEAD's commit (`953c9280`, "relay the post-takeover device dials through the gateway") introduced is what failed — on its address lookup, not on the dial. ## The gateway was up, and this run knew its address The only thing missing was `facts.json`. The address itself is written twice inside this very run directory: - `artifacts/droplet-ip.txt` (mtime 06:14, the `wizard-rent` leg): `209.38.20.29` - `artifacts/standing-founded.json` (mtime 06:27, the `founded` leg): `{ "slug": "rehearsal-e", "host": "rehearsal-e.idss.nz", "ip": "209.38.20.29", "sha": "953c9280..." }` The leg reds at ~06:28 (`artifacts/legs/deploy-takeover-*.png`, mtime 06:28) — *after* both files exist. And the gateway that address names was alive and answering ssh, per `logs/gateway-do-forensics.txt`: ``` === droplet 596817389 === name: idss-gateway-rehearsal-e-842a status: active image: idss-gateway-953c92800329 3 packets transmitted, 3 received, 0% packet loss tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did ``` What *was* absent is the standing home the spec reads from. `logs/state-logs.log` catches it independently: ``` ERROR: no state logs directory at /home/swarm/swarm/Matou/idss/test-results/standing-rented/state/logs: ENOENT ``` On a re-found drive the standing home is torn down before playwright starts and rewritten from `artifacts/standing-founded.json` only after playwright exits — so `readStandingFacts()` returns undefined for the whole drive, every drive, deterministically. The address source the spec chose is the one source guaranteed empty at the moment it reads it. ## The device confirms nothing ran on it `logs/device-do-forensics.txt` — `image: 24.04 (LTS) x64`, `status: active`, `tcp/22: a FRESH connect succeeded`. `logs/device-units.txt`: ``` === ss -tlnp === LISTEN 0 4096 0.0.0.0:22 users:(("sshd",pid=10385,...)) LISTEN 0 4096 100.91.205.159:53 users:(("netbird",pid=9061,...)) === systemctl --failed === (nothing) ``` Stock Ubuntu with sshd and netbird, no failed units, no NixOS. The takeover was never attempted; there is no product defect visible in this red. ## Suspected layer **Harness** — `app/tests/e2e/journey.device.spec.ts:704`. Not product, not infra: both droplets were up and reachable, the gateway image matches the drive commit, and the address the spec wanted was sitting in two files in its own run directory. ## Not the known frontier This is *not* the own-VPS carrier frontier. `pair` is green at 141 ms and `artifacts/legs.json` carries **no skip reasons at all** (`"skip": 0`). This is a fresh regression in the #1099 relay code that landed at HEAD. ## A fix exists but did not land The run's own healer diagnosed this identically and wrote a fix (`logs/healer-claude.out`: `"action":"healed"`, `"commit":"7a3788a3..."`, adding `resolveGatewayIp` in `app/tests/e2e/fixtures/droplet.ts` with 31 passing seam tests and a red-first proof). **It never reached the tree.** `logs/healer-claude.err`: ``` CONFLICT (content): Merge conflict in app/tests/e2e/journey.device.spec.ts error: could not apply 237e85f2... rehearsal healer: deploy-takeover read the gateway off a facts.json a re-found drive never has (sig 800a2936720b) ``` Note the signature `800a2936720b` is the same one carried by the already-landed `9ad39c59` ("deploy-takeover read stdout off a REFUSED ssh dial") — the healer rebased a second fix for the same leg onto a spec that had already moved under it, and the rebase stopped. Whoever picks this up should resolve that conflict rather than re-derive the fix. ## What plugging it needs 1. Replace `readStandingFacts()?.ip` at `journey.device.spec.ts:704` with a resolver that uses the same precedence the bash harvest already uses: in-run `artifacts/standing-founded.json` → `artifacts/droplet-ip.txt` → standing `facts.json` (adopt drives only). The healer's `resolveGatewayIp` in `app/tests/e2e/fixtures/droplet.ts` is exactly this; land it by resolving the `237e85f2` rebase conflict. 2. Keep the fault sentence but make it name all three sources, so a genuine no-gateway drive is still diagnosable from artifacts alone. 3. Seam-test the precedence in `app/tests/e2e/fixtures/droplet.test.ts`, pinning the re-found-drive shape (`facts.json` absent, `standing-founded.json` present) — that case is the whole defect. 4. Same-file follow-up, out of scope for this red but flagged by the healer's residual: the `files-door` leg at `:773-775` reads the gateway from `readStandingFacts()` too, but behind an `if (gatewayIp)` guard — so it silently *skips* its ADR 0210 mesh-route assertion instead of redding. Fixing the address source there without also passing `gwIdentity` and reading through `sshDropletStdout` would convert a quiet skip into a quiet false pass; do all three or none. ## What is absent / not consulted - No `logs/droplet-journal.txt` in this run directory — a device drive harvests `logs/device-journal.txt` (168 KB) and `logs/gateway-journal.txt` (606 KB) instead; both are present. - No live-box section was appended to this report request, so **no box was dialled for this diagnosis** — it rests on the harvested records alone. Both droplets were still up and answering tcp/22 at the 06:33 harvest, per the two `*-do-forensics.txt` files. Nothing here needed a live machine: the failure is a missing file read in the spec, and the artifacts pin it exactly. - The standing home `test-results/standing-rented/` sits outside this run directory and was not read directly; `logs/state-logs.log`'s ENOENT is the in-run evidence for its state. drive `20260901T052209Z` red at `deploy-takeover`: `no standing gateway IP on record (facts.json .ip) — cannot reach the taken-over device, which trusts only the gateway's own deploy key (#1099)` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260901T052209Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 800a2936720b -->
Owner

Already fixed — closing as a duplicate of #1105, which the watching session filed and landed while this report was being written.

Same diagnosis, and your title states it more crisply than mine did. Fixed in 6af513a4: an explicit gatewayIp the standing leg sets in BOTH branches (prefix.dropletIP when re-founding, the facts' .ip when adopting), with OC_E2E_DROPLET_IP as last resort; deploy-takeover reads it instead of readStandingFacts()?.ip.

One thing found while fixing it that this report could not have seen, because the leg it affects never got to run — worth knowing since it is the same defect family, in the leg next door:

files-door's mesh-route assertion could not fail, twice over.

const gatewayIp = facts2?.ip;
if (gatewayIp) {                                  // (1) silently skipped, every re-found drive
  const route = await sshDroplet(gatewayIp, 'grep -rh reverse_proxy …', 60_000);   // (2) no identity
  if (/127\.0\.0\.1:8084/.test(route.stdout)) { throw … }
}
  1. Same empty-facts cause as this ticket, but wrapped in if (gatewayIp) — so it skipped silently rather than reporting.
  2. The dial names no identity, and a rented gateway trusts EXACTLY the rent-operator key since #744 scrubbed the build droplet's authorized_keys (#885, GOTCHAS #101). So the dial was refused, stdout came back empty, the regex did not match, and the leg passed — reading stdout off a refused dial, the very #1099 lesson.

So the one assertion proving ADR 0210's point (the front door proxies to the device over the mesh, not 127.0.0.1:8084) has never actually run on a re-found drive. 6af513a4 makes it fail loud on a missing IP, carries the rent-operator identity, fails loud on a non-zero ssh exit naming exit and stderr, and fails loud when the gateway renders no route at all (ADR 0100).

app/tests/e2e/fixtures 237/237, eslint and vue-tsc clean. No action needed here; #854's next cycle drives with both fixes aboard.

(Session ruling under ADR 0174 — harness-only, revertible. Fixed directly rather than routed to the swarm because the executor was mid-arc and each cycle pays a ~60-minute gateway-image rebuild before it would re-hit the same line. That rebuild cost is Ben-ruled and now landed as #1102/adb83d58.)

Already fixed — closing as a duplicate of #1105, which the watching session filed and landed while this report was being written. Same diagnosis, and your title states it more crisply than mine did. **Fixed in `6af513a4`**: an explicit `gatewayIp` the standing leg sets in BOTH branches (`prefix.dropletIP` when re-founding, the facts' `.ip` when adopting), with `OC_E2E_DROPLET_IP` as last resort; `deploy-takeover` reads it instead of `readStandingFacts()?.ip`. One thing found while fixing it that this report could not have seen, because the leg it affects never got to run — worth knowing since it is the same defect family, in the leg next door: **`files-door`'s mesh-route assertion could not fail, twice over.** ```ts const gatewayIp = facts2?.ip; if (gatewayIp) { // (1) silently skipped, every re-found drive const route = await sshDroplet(gatewayIp, 'grep -rh reverse_proxy …', 60_000); // (2) no identity if (/127\.0\.0\.1:8084/.test(route.stdout)) { throw … } } ``` 1. Same empty-facts cause as this ticket, but wrapped in `if (gatewayIp)` — so it skipped silently rather than reporting. 2. The dial names no identity, and a rented gateway trusts EXACTLY the rent-operator key since #744 scrubbed the build droplet's `authorized_keys` (#885, GOTCHAS #101). So the dial was refused, `stdout` came back empty, the regex did not match, and the leg passed — reading stdout off a refused dial, the very #1099 lesson. So the one assertion proving ADR 0210's point (the front door proxies to the device over the mesh, not `127.0.0.1:8084`) has never actually run on a re-found drive. `6af513a4` makes it fail loud on a missing IP, carries the rent-operator identity, fails loud on a non-zero ssh exit naming exit and stderr, and fails loud when the gateway renders no route at all (ADR 0100). `app/tests/e2e/fixtures` 237/237, eslint and vue-tsc clean. No action needed here; #854's next cycle drives with both fixes aboard. (Session ruling under ADR 0174 — harness-only, revertible. Fixed directly rather than routed to the swarm because the executor was mid-arc and each cycle pays a ~60-minute gateway-image rebuild before it would re-hit the same line. That rebuild cost is Ben-ruled and now landed as #1102/`adb83d58`.)
ben closed this issue 2026-09-01 06:43:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1106
No description provided.