takeover: the kexec installer's mesh rejoin runs netbird up against no daemon — renderInstallerMesh ships pkgs.netbird + the oneshot but never declares services.netbird.clients, so wt0 never returns and deploy-takeover reds target_lost #1057

Closed
opened 2026-08-31 05:30:52 +00:00 by ben · 2 comments
Owner

Symptom

Drive 20260831T043317Z (device target, first drive on the warm snapshot idss-gateway-a4252af41e5a): every leg green through select-files, then deploy-takeover red at 709 s:

clan: target_lost on node-req-0003: the takeover's deploy target root@100.68.233.153 stopped answering during the kexec phase, before any disk work completed — … ssh: connect to host 100.68.233.153 port 22: No route to host (×8)

(artifacts/legs.json, artifacts/legs/deploy-takeover-dash.png — the dashboard's own deploy-failed panel says the same.)

What actually happened — the kexec WORKED, the mesh rejoin can't

Read off the kept member droplet clan-lab-rehearsal-e2c27a61 (170.64.206.39, REHEARSAL_KEEP_RED_DROPLET=1) over its public IP at 05:29Z:

  • hostname nixos-installer, NixOS 26.05 (Yarara), kernel 6.18.45, /etc/NIXOS present — the custom kexec installer composed on the warm gateway store and booted. #1016/#1036/#1048's chain is proven: no 20 m build wall, no pkgsStatic from source.
  • ip -br a: lo, ens3 (public), ens4 (private) — no wt0.
  • idss-installer-mesh.service: activating (start), restart counter 18 and climbing, every attempt:
    netbird up … → grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird/sock" …}
      Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird/sock: connect: no such file or directory"
    Error: failed to connect to daemon error: context deadline exceeded
    If the daemon is not running please run: netbird service install / netbird service start
    
  • journalctl -u netbird, -u netbird-wt0, -u netbird-mesh: No entries — there is no daemon unit in the image at all.

Cause

renderInstallerMesh (internal/clan/netbird.go:~643-690) renders

environment.systemPackages = [ pkgs.netbird ];
systemd.services.idss-installer-mesh = { … script = ''… "$netbird" up --management-url … --setup-key …''; };

netbird up is a client command: it talks to the daemon over /var/run/netbird/sock. Nothing in the module declares the daemon. On the gateway the daemon exists because renderMeshClient (netbird.go:~418) declares services.netbird.clients.mesh = { port = 51820; interface = "wt0"; hardened = false; environment.NB_MANAGEMENT_URL = …; } (→ netbird-mesh.service + the socket) and the self-admit oneshot orders after = [ "netbird-mesh.service" … ] and puts config.services.netbird.clients.mesh.wrapper on its path. The installer module copied the oneshot but not the daemon declaration, so the oneshot's "retry forever" (ADR 0159) retries against a socket that will never exist, wt0 never comes up, and every post-kexec phase sees No route to host on 100.68.233.153 until the leg ceiling.

The offline tests (internal/clan/installer_mesh_test.go) assert the package + oneshot + baked key, not that a daemon is declared — which is exactly the gap that let this ship.

Rule

renderInstallerMesh declares the daemon the same way the fleet does — mirror renderMeshClient's shape (services.netbird.clients.mesh = { port = 51820; interface = "wt0"; hardened = false; environment.NB_MANAGEMENT_URL = <ManagementURL>; }), order the oneshot after = [ "netbird-mesh.service" "network-online.target" ] / wants, and drive netbird up/status through config.services.netbird.clients.mesh.wrapper on path (the wrapper carries the right --daemon-addr), not lib.getExe pkgs.netbird. Keep the baked single-use setup key exactly as is (ADR 0209 amendment, #1012). Prove it in installer_mesh_test.go: the render MUST contain services.netbird.clients.mesh and the oneshot's after MUST name netbird-mesh.service; a render with only environment.systemPackages fails the test. Confirm the nixos-images kexec-installer profile evaluates with the multi-client module (it's plain nixpkgs 26.05 — it should); if the profile's initrd/squashfs needs the daemon's state dir, add the tmpfiles rule.

Acceptance

  • go test ./internal/clan/ -run InstallerMesh green with the new assertions.
  • Next #854 drive: post-kexec, ip -br a on the installer shows wt0 with the device's mesh address, idss-installer-mesh reaches active (exited), and deploy-takeover proceeds into disko/install (a red later than the kexec phase is a new ticket, not this one).

Evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260831T043317Z on elitebook-03; the installer is still up at root@170.64.206.39 (elitebook's key) for anyone who wants to look before it's reaped.

## Symptom Drive `20260831T043317Z` (device target, first drive on the warm snapshot `idss-gateway-a4252af41e5a`): **every leg green through `select-files`**, then `deploy-takeover` red at 709 s: > clan: target_lost on node-req-0003: the takeover's deploy target root@100.68.233.153 stopped answering during the kexec phase, before any disk work completed — … ssh: connect to host 100.68.233.153 port 22: No route to host (×8) (`artifacts/legs.json`, `artifacts/legs/deploy-takeover-dash.png` — the dashboard's own deploy-failed panel says the same.) ## What actually happened — the kexec WORKED, the mesh rejoin can't Read off the kept member droplet `clan-lab-rehearsal-e2c27a61` (170.64.206.39, `REHEARSAL_KEEP_RED_DROPLET=1`) over its public IP at 05:29Z: - hostname `nixos-installer`, `NixOS 26.05 (Yarara)`, kernel 6.18.45, `/etc/NIXOS` present — **the custom kexec installer composed on the warm gateway store and booted.** #1016/#1036/#1048's chain is proven: no 20 m build wall, no `pkgsStatic` from source. - `ip -br a`: `lo`, `ens3` (public), `ens4` (private) — **no `wt0`**. - `idss-installer-mesh.service`: `activating (start)`, restart counter 18 and climbing, every attempt: ``` netbird up … → grpc: addrConn.createTransport failed to connect to {Addr: "/var/run/netbird/sock" …} Err: connection error: desc = "transport: Error while dialing: dial unix /var/run/netbird/sock: connect: no such file or directory" Error: failed to connect to daemon error: context deadline exceeded If the daemon is not running please run: netbird service install / netbird service start ``` - `journalctl -u netbird`, `-u netbird-wt0`, `-u netbird-mesh`: **No entries** — there is no daemon unit in the image at all. ## Cause `renderInstallerMesh` (`internal/clan/netbird.go:~643-690`) renders ```nix environment.systemPackages = [ pkgs.netbird ]; systemd.services.idss-installer-mesh = { … script = ''… "$netbird" up --management-url … --setup-key …''; }; ``` `netbird up` is a **client** command: it talks to the daemon over `/var/run/netbird/sock`. Nothing in the module declares the daemon. On the gateway the daemon exists because `renderMeshClient` (`netbird.go:~418`) declares `services.netbird.clients.mesh = { port = 51820; interface = "wt0"; hardened = false; environment.NB_MANAGEMENT_URL = …; }` (→ `netbird-mesh.service` + the socket) and the self-admit oneshot orders `after = [ "netbird-mesh.service" … ]` and puts `config.services.netbird.clients.mesh.wrapper` on its `path`. The installer module copied the oneshot but not the daemon declaration, so the oneshot's "retry forever" (ADR 0159) retries against a socket that will never exist, wt0 never comes up, and every post-kexec phase sees `No route to host` on 100.68.233.153 until the leg ceiling. The offline tests (`internal/clan/installer_mesh_test.go`) assert the package + oneshot + baked key, not that a daemon is declared — which is exactly the gap that let this ship. ## Rule `renderInstallerMesh` declares the daemon the same way the fleet does — mirror `renderMeshClient`'s shape (`services.netbird.clients.mesh = { port = 51820; interface = "wt0"; hardened = false; environment.NB_MANAGEMENT_URL = <ManagementURL>; }`), order the oneshot `after = [ "netbird-mesh.service" "network-online.target" ]` / `wants`, and drive `netbird up`/`status` through `config.services.netbird.clients.mesh.wrapper` on `path` (the wrapper carries the right `--daemon-addr`), not `lib.getExe pkgs.netbird`. Keep the baked single-use setup key exactly as is (ADR 0209 amendment, #1012). Prove it in `installer_mesh_test.go`: the render MUST contain `services.netbird.clients.mesh` and the oneshot's `after` MUST name `netbird-mesh.service`; a render with only `environment.systemPackages` fails the test. Confirm the nixos-images kexec-installer profile evaluates with the multi-client module (it's plain nixpkgs 26.05 — it should); if the profile's initrd/squashfs needs the daemon's state dir, add the tmpfiles rule. ## Acceptance - `go test ./internal/clan/ -run InstallerMesh` green with the new assertions. - Next #854 drive: post-kexec, `ip -br a` on the installer shows `wt0` with the device's mesh address, `idss-installer-mesh` reaches `active (exited)`, and `deploy-takeover` proceeds into disko/install (a red **later** than the kexec phase is a new ticket, not this one). Evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260831T043317Z` on elitebook-03; the installer is still up at `root@170.64.206.39` (elitebook's key) for anyone who wants to look before it's reaped.

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

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

close-report for #1057 — status success

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

envelope
{
  "issue": 1057,
  "status": "success",
  "commits": [
    "082daa34"
  ],
  "changed_files": [
    "internal/clan/netbird.go",
    "internal/clan/installer_mesh_test.go",
    "STATUS.md",
    "docs/GOTCHAS.md"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/ -run InstallerMesh",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "go test ./internal/clan/ -run InstallerMesh green with the new assertions": "installer_mesh_test.go now asserts the render contains services.netbird.clients.mesh, the oneshot's `after` names netbird-mesh.service, and it does NOT drive lib.getExe pkgs.netbird; run passed (commit 082daa34)",
    "post-kexec wt0 comes up / idss-installer-mesh reaches active / deploy-takeover proceeds": "offline seam fixed — renderInstallerMesh (netbird.go) now declares services.netbird.clients.mesh (daemon socket + wt0), orders the oneshot after netbird-mesh.service, and drives the client wrapper; live wt0 rejoin is the next #854 device drive's proof per the acceptance note"
  },
  "summary": "renderInstallerMesh now declares the netbird daemon (services.netbird.clients.mesh), orders the rejoin oneshot after netbird-mesh.service, and drives the client wrapper so the kexec installer's wt0 returns.",
  "reason": "",
  "blockers": []
}
**close-report** for #1057 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1057, "status": "success", "commits": [ "082daa34" ], "changed_files": [ "internal/clan/netbird.go", "internal/clan/installer_mesh_test.go", "STATUS.md", "docs/GOTCHAS.md" ], "tests": [ { "command": "go test ./internal/clan/ -run InstallerMesh", "exit_code": 0 }, { "command": "go test ./internal/clan/", "exit_code": 0 } ], "criteria": { "go test ./internal/clan/ -run InstallerMesh green with the new assertions": "installer_mesh_test.go now asserts the render contains services.netbird.clients.mesh, the oneshot's `after` names netbird-mesh.service, and it does NOT drive lib.getExe pkgs.netbird; run passed (commit 082daa34)", "post-kexec wt0 comes up / idss-installer-mesh reaches active / deploy-takeover proceeds": "offline seam fixed — renderInstallerMesh (netbird.go) now declares services.netbird.clients.mesh (daemon socket + wt0), orders the oneshot after netbird-mesh.service, and drives the client wrapper; live wt0 rejoin is the next #854 device drive's proof per the acceptance note" }, "summary": "renderInstallerMesh now declares the netbird daemon (services.netbird.clients.mesh), orders the rejoin oneshot after netbird-mesh.service, and drives the client wrapper so the kexec installer's wt0 returns.", "reason": "", "blockers": [] } ``` </details>
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#1057
No description provided.