The member files front-door route is rendered before the takeover, so it targets the dead pre-kexec landing address #1072

Closed
opened 2026-08-31 15:53:58 +00:00 by matou-build-agent · 2 comments

Failure

A member-device files placement commits the gateway's front-door route files.<apex> → <device-mesh-ip>:80 before the takeover runs, using the device's PRE-kexec landing address. The takeover then moves the device to a different mesh address, and nothing re-renders the route — so StepDeployServices deploys a gateway whose files door points at an address no mesh peer holds.

Not yet observed on a drive: 20260831T141810Z red one step earlier, at seed (healed in commit a9a01025), so the deploy never reached StepDeployServices. With that step now reachable the next drive walks straight into this at files-door.

Evidence

The address genuinely moves across the takeover. logs/gateway-journal.txt: the device's original netbird peer ZWxBVn3a4… (v0.77.1 — the peer holding 100.82.250.140) goes ICE-disconnected at 15:33:32 and never returns; the kexec installer registers as a NEW peer h6G/OBEY… at 15:33:49 (v0.71.4, endpoint 10.126.0.5) and the installed member comes back as that same peer at 15:39:34 (v0.72.3, endpoint 170.64.152.147). That is #1068's premise as stated in code — internal/clan/enrollment.go:915-921: "a fresh WireGuard key redeeming the single-use node-scoped key is, to management, a new peer, so it is allocated a new IP".

The route is rendered from the pre-takeover address. internal/provision/deploy.go:778 — files := clan.LiveService{Slug: clan.FilesSlug, MeshTarget: d.MeshAddress + ":80"} — then AttachFrontDoor at internal/provision/deploy.go:782.

…and it runs in deploy step 1, before the takeover. internal/provision/takeover.go:68-84 (StepCommitConfig → attachCatalogueService → attachFilesPlacement, internal/provision/deploy.go:659-671 → attachMemberFilesPlacement), whereas runTakeover is step 3 at internal/provision/takeover.go:104.

The #1069 write-back is the ledger only, and runs after. internal/provision/takeover.go:289 calls recordRejoinedMeshAddress (internal/provision/takeover.go:306-324), whose sole write is meshRecorder.RecordMeshAddress at internal/provision/takeover.go:320. It fixes Device.MeshAddress; it re-renders nothing.

Nothing else rewrites the route. AttachFrontDoor with a member mesh target has exactly one production call site — internal/provision/deploy.go:782 (the other two are the gateway co-host path at :721 and the files-removal path at :866).

Step 5 applies the step-1 revision. run.Revision is set at internal/provision/takeover.go:80 and handed to applyRevision at internal/provision/takeover.go:125.

So #1069's claim — "the front door's files route (deploy.go) targets the live box, not the dead landing IP1" — holds for the ledger's Device.MeshAddress but not for the route that is actually committed and deployed.

Suspected layer

internal/provision orchestration ordering, not the clan render. The render is correct; it just runs before the address it needs is knowable.

What plugging it needs

After recordRejoinedMeshAddress lands the live address and before StepDeployServices, re-drive the member files placement's front-door half against the freshly-read o.fleet.Device — the AttachFrontDoor + ComposeGatewayCohost pair in attachMemberFilesPlacement (internal/provision/deploy.go:770-786) — and advance run.Revision to that new commit so applyRevision (internal/provision/takeover.go:123-132) deploys the corrected route rather than the step-1 one. Gate it on a real mesh member-device files placement (memberDevicePlacement, internal/provision/deploy.go:746-759) so every other deploy is byte-unchanged; a no-op when the address did not move (the same early return recordRejoinedMeshAddress already makes at internal/provision/takeover.go:317).

Seam test to pin it: a takeover that reaches Done with an InstallerResolver returning a DIFFERENT address must leave the gateway apply carrying a front-door live set that names the NEW address and never the landing one.

drive 20260831T141810Z red at deploy-takeover: deploy failed (rescue): provision: seed node-req-0003: clan: connectivity on node-req-0003: could not reach the node: ssh: connect to host 100.82.250.140 port 22: No route to host error: failed to sta
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260831T141810Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Failure A member-device files placement commits the gateway's front-door route `files.<apex> → <device-mesh-ip>:80` **before** the takeover runs, using the device's PRE-kexec landing address. The takeover then moves the device to a different mesh address, and nothing re-renders the route — so `StepDeployServices` deploys a gateway whose files door points at an address no mesh peer holds. Not yet observed on a drive: `20260831T141810Z` red one step earlier, at `seed` (healed in commit `a9a01025`), so the deploy never reached `StepDeployServices`. With that step now reachable the next drive walks straight into this at `files-door`. ## Evidence **The address genuinely moves across the takeover.** `logs/gateway-journal.txt`: the device's original netbird peer `ZWxBVn3a4…` (v0.77.1 — the peer holding `100.82.250.140`) goes ICE-disconnected at 15:33:32 and never returns; the kexec installer registers as a NEW peer `h6G/OBEY…` at 15:33:49 (v0.71.4, endpoint 10.126.0.5) and the installed member comes back as that same peer at 15:39:34 (v0.72.3, endpoint 170.64.152.147). That is #1068's premise as stated in code — `internal/clan/enrollment.go:915-921`: "a fresh WireGuard key redeeming the single-use node-scoped key is, to management, a new peer, so it is allocated a new IP". **The route is rendered from the pre-takeover address.** `internal/provision/deploy.go:778` — `files := clan.LiveService{Slug: clan.FilesSlug, MeshTarget: d.MeshAddress + ":80"}` — then `AttachFrontDoor` at `internal/provision/deploy.go:782`. **…and it runs in deploy step 1, before the takeover.** `internal/provision/takeover.go:68-84` (`StepCommitConfig` → `attachCatalogueService` → `attachFilesPlacement`, `internal/provision/deploy.go:659-671` → `attachMemberFilesPlacement`), whereas `runTakeover` is step 3 at `internal/provision/takeover.go:104`. **The #1069 write-back is the ledger only, and runs after.** `internal/provision/takeover.go:289` calls `recordRejoinedMeshAddress` (`internal/provision/takeover.go:306-324`), whose sole write is `meshRecorder.RecordMeshAddress` at `internal/provision/takeover.go:320`. It fixes `Device.MeshAddress`; it re-renders nothing. **Nothing else rewrites the route.** `AttachFrontDoor` with a member mesh target has exactly one production call site — `internal/provision/deploy.go:782` (the other two are the gateway co-host path at `:721` and the files-removal path at `:866`). **Step 5 applies the step-1 revision.** `run.Revision` is set at `internal/provision/takeover.go:80` and handed to `applyRevision` at `internal/provision/takeover.go:125`. So #1069's claim — "the front door's files route (deploy.go) targets the live box, not the dead landing IP1" — holds for the ledger's `Device.MeshAddress` but not for the route that is actually committed and deployed. ## Suspected layer `internal/provision` orchestration **ordering**, not the clan render. The render is correct; it just runs before the address it needs is knowable. ## What plugging it needs After `recordRejoinedMeshAddress` lands the live address and **before** `StepDeployServices`, re-drive the member files placement's front-door half against the freshly-read `o.fleet.Device` — the `AttachFrontDoor` + `ComposeGatewayCohost` pair in `attachMemberFilesPlacement` (`internal/provision/deploy.go:770-786`) — and advance `run.Revision` to that new commit so `applyRevision` (`internal/provision/takeover.go:123-132`) deploys the corrected route rather than the step-1 one. Gate it on a real mesh member-device files placement (`memberDevicePlacement`, `internal/provision/deploy.go:746-759`) so every other deploy is byte-unchanged; a no-op when the address did not move (the same early return `recordRejoinedMeshAddress` already makes at `internal/provision/takeover.go:317`). Seam test to pin it: a takeover that reaches Done with an `InstallerResolver` returning a DIFFERENT address must leave the gateway apply carrying a front-door live set that names the NEW address and never the landing one. drive `20260831T141810Z` red at `deploy-takeover`: `deploy failed (rescue): provision: seed node-req-0003: clan: connectivity on node-req-0003: could not reach the node: ssh: connect to host 100.82.250.140 port 22: No route to host error: failed to sta` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260831T141810Z` 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 -->
Author
Member

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

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

close-report for #1072 — status success

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

envelope
{
  "issue": 1072,
  "status": "success",
  "commits": [
    "63e16af7"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "internal/provision/deploy.go",
    "internal/provision/takeover.go",
    "internal/provision/takeover_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/provision/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go test ./internal/clan/... ./internal/enroll/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go vet ./internal/provision/",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/provision/deploy.go internal/provision/takeover.go internal/provision/takeover_test.go",
      "exit_code": 0
    }
  ],
  "criteria": {
    "After recordRejoinedMeshAddress lands the live address and before StepDeployServices, the member files front-door route is re-driven against the rejoined address": "internal/provision/takeover.go recordRejoinedMeshAddress now returns (addr, moved); the Done path calls repointMemberFilesRoute when moved, before StepDeployServices; internal/provision/deploy.go repointMemberFilesRoute re-runs AttachFrontDoor + ComposeGatewayCohost and advances run.Revision",
    "Gated on a real mesh member-device files placement so every other deploy is byte-unchanged": "repointMemberFilesRoute gates via memberFilesGateway (memberDevicePlacement + selectionTouchesFiles); returns early otherwise",
    "A no-op when the address did not move": "recordRejoinedMeshAddress returns moved=false when resolved addr == landing addr (takeover.go:317 early return preserved); repoint only called when moved",
    "Seam test: a takeover reaching Done with an InstallerResolver returning a DIFFERENT address leaves the gateway apply carrying a front-door live set that names the NEW address and never the landing one": "TestDeployTakeover_RepointsFrontDoorRouteToRejoinedAddress (internal/provision/takeover_test.go) — asserts last AttachFrontDoor MeshTarget == 100.83.9.42:80 (not 100.83.1.22:80) and both deploy nodes apply run.Revision; verified red-first (fails 'got 1' without the fix), green with it"
  },
  "summary": "Re-point the member files front-door route to the rejoined mesh address before StepDeployServices so the gateway stops deploying a door on the dead pre-kexec IP.",
  "blockers": []
}
**close-report** for #1072 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1072, "status": "success", "commits": [ "63e16af7" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "internal/provision/deploy.go", "internal/provision/takeover.go", "internal/provision/takeover_test.go" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/provision/", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go test ./internal/clan/... ./internal/enroll/", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go vet ./internal/provision/", "exit_code": 0 }, { "command": "gofmt -l internal/provision/deploy.go internal/provision/takeover.go internal/provision/takeover_test.go", "exit_code": 0 } ], "criteria": { "After recordRejoinedMeshAddress lands the live address and before StepDeployServices, the member files front-door route is re-driven against the rejoined address": "internal/provision/takeover.go recordRejoinedMeshAddress now returns (addr, moved); the Done path calls repointMemberFilesRoute when moved, before StepDeployServices; internal/provision/deploy.go repointMemberFilesRoute re-runs AttachFrontDoor + ComposeGatewayCohost and advances run.Revision", "Gated on a real mesh member-device files placement so every other deploy is byte-unchanged": "repointMemberFilesRoute gates via memberFilesGateway (memberDevicePlacement + selectionTouchesFiles); returns early otherwise", "A no-op when the address did not move": "recordRejoinedMeshAddress returns moved=false when resolved addr == landing addr (takeover.go:317 early return preserved); repoint only called when moved", "Seam test: a takeover reaching Done with an InstallerResolver returning a DIFFERENT address leaves the gateway apply carrying a front-door live set that names the NEW address and never the landing one": "TestDeployTakeover_RepointsFrontDoorRouteToRejoinedAddress (internal/provision/takeover_test.go) — asserts last AttachFrontDoor MeshTarget == 100.83.9.42:80 (not 100.83.1.22:80) and both deploy nodes apply run.Revision; verified red-first (fails 'got 1' without the fix), green with it" }, "summary": "Re-point the member files front-door route to the rejoined mesh address before StepDeployServices so the gateway stops deploying a door on the dead pre-kexec IP.", "blockers": [] } ``` </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#1072
No description provided.