approve: a founded community could not admit a device for 11+ minutes — netbird-management downloads two geolocation databases before it binds :8011, and nothing waits for or removes that #1214

Closed
opened 2026-09-04 10:48:41 +00:00 by matou-build-agent · 2 comments

The failure

Device drive 20260904T095415Z (commit e519ef80), red at approve after 731 ms, 24/25 legs green (artifacts/verdict.json, artifacts/legs.json).

The strip surfaced the control plane's own sentence, exactly as approvePending is built to (app/tests/e2e/fixtures/deviceAdd.ts:256-262, driven from app/tests/e2e/journey.device.spec.ts:829):

mint mesh admission: enroll: mesh minter: ensure group "node-req-0003":
GET /api/groups: Get "http://localhost:8011/api/groups":
dial tcp [::1]:8011: connect: connection refused

The held join PTY is at waiting for the operator's decision… and still running (artifacts/join-transcript.txt, artifacts/join-exit.txt) — the device never landed.

The evidence: the mesh plane never bound

  • logs/gateway-stall.txt (process table, 10:42:35): netbird-mgmt pid 3036 is ALIVE with --port 8011.

  • logs/gateway-units.txt (ss -tlnp, 10:42:35): there is no :8011 listener. Signal (:8012), relay (:8013/:8014), control-plane (:8080), kanidm (:8443), caddy — all present. Management is absent.

  • logs/gateway-journal.txt:644: only netbird-signal logged running HTTP server with WebSocket proxy (no TLS): [::]:8012. Management NEVER logged its running HTTP server and gRPC server on the same port: [::]:8011 counterpart — the line GOTCHAS #126 quotes from the drive where it took 15 s.

  • What it was doing instead, from logs/gateway-journal.txt:

    • :1072 — 10:31:32 Geolocation database file GeoLite2-City_20260602.mmdb not found, file will be downloaded
    • :1992 — 10:42:25 Geolocation database file geonames_20260602.db not found, file will be downloaded

    That is 10 m 53 s for the first database alone, with the second still in flight when the drive gave up. netbird-management initialises geolocation before it serves, so the port simply does not exist until both downloads finish.

  • Corroboration that this is what Approve hit, not something else: idss-mesh-self-admit was logging the identical error against the identical endpoint in the same seconds — :1983–:1989 (10:42:11 / :13 / :15 / :17 / :19, ensure group "gateway"), bracketing the Approve at ~10:42:14. It had been doing so continuously since :1007 (10:31:31), bouncing five times on its 120 s budget (:1682-1685, restart counter reaching 4 at :1899).

  • The control plane's Approve path is wired to that same dead endpoint: logs/gateway-journal.txt:1451 — mesh minter wired … api=http://localhost:8011.

Not an IPv6 mismatch: management binds [::]:8011 when it binds at all, so [::1] is the right dial. The listen tcp 127.0.0.1:6060: bind: address already in use at :691 is netbird-signal already holding the pprof port (gateway-units.txt); non-fatal, worth tidying, not the cause.

Suspected layer

The gateway's mesh-plane deploy (internal/clan/netbird.go:221-323, netbirdServer) plus the readiness contract around it. Three things are true at once:

  1. An unbounded public-internet download sits on the critical path of a community's mesh plane, with no mitigation in the repo. netbirdServer sets no geolocation knob, and nothing pre-seeds the databases into the closure — grep -ri geo over internal/, control-plane/ and the ADRs finds only prose. On drive 20260829T213942Z the two downloads took ~13 s; here the first took ~11 minutes. That 40x is environmental, but the exposure is ours.
  2. founded does not mean "can admit a device". logs/founding-state.log records gateway deploy complete — the control plane is live at 10:32:19.56 and the drive's activation/founded legs went green — while the plane could not admit anyone for another 10+ minutes. GOTCHAS #126's own rule ("order for START but WAIT for READINESS") is honoured by the self-admit oneshot (control-plane/cmd/control-plane/mesh_self_admit.go:103-119) and by nothing else.
  3. Approve mints single-shot. enroll.NetbirdMinter.Mint (internal/enroll/mesh_minter.go:93-98) dials once and errors. Note that a retry here would NOT have saved this drive: the strip's race ceiling is 5 min (deviceAdd.ts:245) and the leg's is 10 min (journey.device.spec.ts:120) — both under the 11-minute outage.

The budget comment at control-plane/cmd/control-plane/mesh_self_admit.go:24-34 states the assumption this drive broke in as many words: 120 s is "~8x the 14.9 s netbird-management took to bind :8011 … of which ~13 s was two geolocation-database DOWNLOADS — the margin is for a slower link, not for a slower box." The link was slower than the margin allowed for.

Why this was refused rather than healed — refusal rule 3 (product-behaviour surface)

Every candidate fix alters what a deploy does or what a community sees:

  • Disabling or pre-seeding the geolite fetch in internal/clan/netbird.go changes the gateway's shipped configuration — what a deploy does. It also needs a check that netbird 0.72 / this nixpkgs pin actually exposes such a knob, which may be a dependency-shaped change.
  • Gating founded (or the deploy's completion) on mesh admissibility changes what the operator sees during founding.
  • Adding a readiness wait to Mint changes what pressing Approve does for a real operator (a long spinner in place of a prompt error), and would not have made this drive green anyway.

A harness-side "wait for :8011 before pressing Approve" was considered and rejected as the forbidden cheap green: it would delete precisely the fact this drive caught — that a community reported as founded cannot admit a device.

Ruling needed: which layer takes it. My reading is that (1) is the real fix (a community's mesh plane should not depend on a public CDN to become admissible) with (2) as the honest backstop, but that is ADR 0214 territory and not a healer's call.

Secondary, not the red

All device-side forensics failed with root@168.144.160.189: Permission denied (publickey) (logs/device-journal.txt, device-units.txt, device-stall.txt, device-keri.txt, device-caddy.txt) even though the join PTY reached the same host fine. The harvest is evidently not using the identity the join used. Nothing here depended on it — the gateway side told the whole story — but it costs diagnosability on any device-side red and is worth its own mechanical ticket.

Signature

c1ac37bc5a0d. Note this signature previously carried a different fault (GOTCHAS #127, the group-peers response-shape decode, docs/GOTCHAS.md) which is fixed and is NOT what happened here — the signature is coarse for approve reds and should not be read as a repeat.

drive 20260904T095415Z red at approve: the device did not reach connected — the Approve verb landed but the join failed: "mint mesh admission: enroll: mesh minter: ensure group \"node-req-0003\": GET /api/groups: Get \"http://localhost:8
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260904T095415Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure Device drive `20260904T095415Z` (commit `e519ef80`), red at `approve` after 731 ms, 24/25 legs green (`artifacts/verdict.json`, `artifacts/legs.json`). The strip surfaced the control plane's own sentence, exactly as `approvePending` is built to (`app/tests/e2e/fixtures/deviceAdd.ts:256-262`, driven from `app/tests/e2e/journey.device.spec.ts:829`): ``` mint mesh admission: enroll: mesh minter: ensure group "node-req-0003": GET /api/groups: Get "http://localhost:8011/api/groups": dial tcp [::1]:8011: connect: connection refused ``` The held join PTY is at `waiting for the operator's decision…` and still running (`artifacts/join-transcript.txt`, `artifacts/join-exit.txt`) — the device never landed. ## The evidence: the mesh plane never bound - `logs/gateway-stall.txt` (process table, 10:42:35): `netbird-mgmt` pid 3036 is ALIVE with `--port 8011`. - `logs/gateway-units.txt` (`ss -tlnp`, 10:42:35): there is **no `:8011` listener**. Signal (`:8012`), relay (`:8013`/`:8014`), control-plane (`:8080`), kanidm (`:8443`), caddy — all present. Management is absent. - `logs/gateway-journal.txt:644`: only `netbird-signal` logged `running HTTP server with WebSocket proxy (no TLS): [::]:8012`. Management NEVER logged its `running HTTP server and gRPC server on the same port: [::]:8011` counterpart — the line GOTCHAS #126 quotes from the drive where it took 15 s. - What it was doing instead, from `logs/gateway-journal.txt`: - `:1072` — 10:31:32 `Geolocation database file GeoLite2-City_20260602.mmdb not found, file will be downloaded` - `:1992` — **10:42:25** `Geolocation database file geonames_20260602.db not found, file will be downloaded` That is **10 m 53 s for the first database alone**, with the second still in flight when the drive gave up. `netbird-management` initialises geolocation *before* it serves, so the port simply does not exist until both downloads finish. - Corroboration that this is what Approve hit, not something else: `idss-mesh-self-admit` was logging the **identical** error against the **identical** endpoint in the same seconds — `:1983`–`:1989` (10:42:11 / :13 / :15 / :17 / :19, `ensure group "gateway"`), bracketing the Approve at ~10:42:14. It had been doing so continuously since `:1007` (10:31:31), bouncing five times on its 120 s budget (`:1682-1685`, restart counter reaching 4 at `:1899`). - The control plane's Approve path is wired to that same dead endpoint: `logs/gateway-journal.txt:1451` — `mesh minter wired … api=http://localhost:8011`. Not an IPv6 mismatch: management binds `[::]:8011` when it binds at all, so `[::1]` is the right dial. The `listen tcp 127.0.0.1:6060: bind: address already in use` at `:691` is `netbird-signal` already holding the pprof port (`gateway-units.txt`); non-fatal, worth tidying, **not** the cause. ## Suspected layer The gateway's mesh-plane deploy (`internal/clan/netbird.go:221-323`, `netbirdServer`) plus the readiness contract around it. Three things are true at once: 1. **An unbounded public-internet download sits on the critical path of a community's mesh plane, with no mitigation in the repo.** `netbirdServer` sets no geolocation knob, and nothing pre-seeds the databases into the closure — `grep -ri geo` over `internal/`, `control-plane/` and the ADRs finds only prose. On drive `20260829T213942Z` the two downloads took ~13 s; here the first took ~11 minutes. That 40x is environmental, but the exposure is ours. 2. **`founded` does not mean "can admit a device".** `logs/founding-state.log` records `gateway deploy complete — the control plane is live` at 10:32:19.56 and the drive's `activation`/`founded` legs went green — while the plane could not admit anyone for another 10+ minutes. GOTCHAS #126's own rule ("order for START but WAIT for READINESS") is honoured by the self-admit oneshot (`control-plane/cmd/control-plane/mesh_self_admit.go:103-119`) and by nothing else. 3. **Approve mints single-shot.** `enroll.NetbirdMinter.Mint` (`internal/enroll/mesh_minter.go:93-98`) dials once and errors. Note that a retry here would NOT have saved this drive: the strip's race ceiling is 5 min (`deviceAdd.ts:245`) and the leg's is 10 min (`journey.device.spec.ts:120`) — both under the 11-minute outage. The budget comment at `control-plane/cmd/control-plane/mesh_self_admit.go:24-34` states the assumption this drive broke in as many words: 120 s is "~8x the 14.9 s netbird-management took to bind :8011 … of which ~13 s was two geolocation-database DOWNLOADS — the margin is for a slower link, not for a slower box." The link was slower than the margin allowed for. ## Why this was refused rather than healed — refusal rule 3 (product-behaviour surface) Every candidate fix alters what a deploy does or what a community sees: - Disabling or pre-seeding the geolite fetch in `internal/clan/netbird.go` changes the gateway's shipped configuration — what a deploy does. It also needs a check that netbird 0.72 / this nixpkgs pin actually exposes such a knob, which may be a dependency-shaped change. - Gating `founded` (or the deploy's completion) on mesh admissibility changes what the operator sees during founding. - Adding a readiness wait to `Mint` changes what pressing **Approve** does for a real operator (a long spinner in place of a prompt error), and would not have made this drive green anyway. A harness-side "wait for :8011 before pressing Approve" was considered and rejected as the forbidden cheap green: it would delete precisely the fact this drive caught — that a community reported as founded cannot admit a device. **Ruling needed:** which layer takes it. My reading is that (1) is the real fix (a community's mesh plane should not depend on a public CDN to become admissible) with (2) as the honest backstop, but that is ADR 0214 territory and not a healer's call. ## Secondary, not the red All device-side forensics failed with `root@168.144.160.189: Permission denied (publickey)` (`logs/device-journal.txt`, `device-units.txt`, `device-stall.txt`, `device-keri.txt`, `device-caddy.txt`) even though the join PTY reached the same host fine. The harvest is evidently not using the identity the join used. Nothing here depended on it — the gateway side told the whole story — but it costs diagnosability on any device-side red and is worth its own mechanical ticket. ## Signature `c1ac37bc5a0d`. Note this signature previously carried a different fault (GOTCHAS #127, the group-`peers` response-shape decode, `docs/GOTCHAS.md`) which is fixed and is NOT what happened here — the signature is coarse for `approve` reds and should not be read as a repeat. drive `20260904T095415Z` red at `approve`: `the device did not reach connected — the Approve verb landed but the join failed: "mint mesh admission: enroll: mesh minter: ensure group \"node-req-0003\": GET /api/groups: Get \"http://localhost:8` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260904T095415Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: c1ac37bc5a0d -->
Owner

FIXED in e6f8a4e6 — root cause confirmed from the harvested gateway journal, not the symptom.

netbird-management's boot path downloads two MaxMind databases (GeoLite2-City + geonames) from pkgs.netbird.io before binding :8011 on any fresh gateway — --disable-geolite-update (the binary default) only skips refreshing files that already exist; missing files fetch unconditionally (management/server/geolocation/database.go). Drive 12's founding did both downloads in 5 seconds; this drive's took 11+ minutes, and the whole window is a founded community that cannot admit its first device: the self-admit oneshot retried patiently (18+ attempts in the journal, by design) but the Approve verb's mesh minter fails immediately on connection refused.

The fix: the render sets NB_DISABLE_GEOLOCATION=true on netbird-management.service — netbird's own module-level skip (management/internals/server/modules.go) that bypasses the geolocation service entirely. Geolocation feeds only location UI and geo posture checks; the plane has neither (ADR 0214 decision 1: no dashboard). Management now binds as soon as it parses config. Pinned in TestNetbird_MeshPlaneOnBothRenders; seed + rented eval smokes green; seed-community drvpath baseline unmoved.

Also confirmed from the same journal, for the record: the #1210 stack all came up live on this drive — netbird-relay WS on :8013, Relay addresses: [rels://mesh.rehearsal-e.idss.nz:443/relay] parsed by management, guest join leg green on the 0.72.3 image. The listen tcp 127.0.0.1:6060: bind: address already in use line in the journal is a pre-existing non-fatal pprof-listener squabble between management and signal, not this fault and not new.

Possible follow-up (not landed, needs a ruling): the Approve-time mesh minter fails instantly when the plane is momentarily unbinding (a gateway mid-reboot would show the same face to a real member). The self-admit path already carries a bounded retry; whether Approve should too is a product-shape question, not a drive blocker once this lands.

Ruled by session under ADR 0174 — veto anytime. Task 6 of #1153.

**FIXED in `e6f8a4e6`** — root cause confirmed from the harvested gateway journal, not the symptom. netbird-management's boot path downloads two MaxMind databases (GeoLite2-City + geonames) from pkgs.netbird.io **before binding :8011** on any fresh gateway — `--disable-geolite-update` (the binary default) only skips refreshing files that already exist; missing files fetch unconditionally (`management/server/geolocation/database.go`). Drive 12's founding did both downloads in 5 seconds; this drive's took 11+ minutes, and the whole window is a founded community that cannot admit its first device: the self-admit oneshot retried patiently (18+ attempts in the journal, by design) but the Approve verb's mesh minter fails immediately on `connection refused`. The fix: the render sets `NB_DISABLE_GEOLOCATION=true` on `netbird-management.service` — netbird's own module-level skip (`management/internals/server/modules.go`) that bypasses the geolocation service entirely. Geolocation feeds only location UI and geo posture checks; the plane has neither (ADR 0214 decision 1: no dashboard). Management now binds as soon as it parses config. Pinned in `TestNetbird_MeshPlaneOnBothRenders`; seed + rented eval smokes green; seed-community drvpath baseline unmoved. Also confirmed from the same journal, for the record: the #1210 stack all came up live on this drive — netbird-relay WS on :8013, `Relay addresses: [rels://mesh.rehearsal-e.idss.nz:443/relay]` parsed by management, guest join leg green on the 0.72.3 image. The `listen tcp 127.0.0.1:6060: bind: address already in use` line in the journal is a pre-existing non-fatal pprof-listener squabble between management and signal, not this fault and not new. Possible follow-up (not landed, needs a ruling): the Approve-time mesh minter fails instantly when the plane is momentarily unbinding (a gateway mid-reboot would show the same face to a real member). The self-admit path already carries a bounded retry; whether Approve should too is a product-shape question, not a drive blocker once this lands. Ruled by session under ADR 0174 — veto anytime. Task 6 of #1153.
ben closed this issue 2026-09-04 10:53:16 +00:00
Owner

Addendum — this red hid a SECOND, fatal fault, also fixed (bea4f095), and the standing plane is live-repaired.

After the geolocation window finally cleared (11 min), management did NOT come up: it FATL'd on failed to expose metrics: listen tcp4 :9090: bind: address already in use five times into start-limit-hit — a permanently dead plane. :9090 is BOTH netbird-relay's and netbird-management's Prometheus default, so on the one-box plane whichever daemon binds second dies; the relay (new in f251e1f8) held the port through the geolocation stall. bea4f095 pins the relay to NB_METRICS_PORT=8015 beside its 8013/8014 listeners, test-pinned.

Standing rehearsal-e: its plane carried the dead management from before these fixes, and a re-supply never restarts a start-limit-hit unit — so I applied both fixes as runtime drop-ins (/run/systemd/system/*.d/, gone at reboot, replaced properly by the next re-found) and restarted: relay active, management active, :8011 → HTTP 401 (alive, guarding). The current fire's re-supply lands on a healthy plane that already advertises the relay (drive 13's founding rendered it).

Gap worth a ruling (not landed): the staleness gate cannot see mesh-render drift — its render fingerprint (the drvpath baseline) tracks only the mesh-less seed scope, so all three of this arc's mesh-render fixes classified as binary-only and would have re-supplied a gateway whose rendered config was genuinely stale. Adjacent gap: adoption never probes plane health, so a start-limit-hit management adopts silently and reds 40 minutes later at approve. Both are freshness-tax-report-shaped; happy to file them as a ticket if you want them on the queue.

Ruled by session under ADR 0174 — veto anytime. Task 6 of #1153.

**Addendum — this red hid a SECOND, fatal fault, also fixed (`bea4f095`), and the standing plane is live-repaired.** After the geolocation window finally cleared (11 min), management did NOT come up: it FATL'd on `failed to expose metrics: listen tcp4 :9090: bind: address already in use` five times into **start-limit-hit** — a permanently dead plane. :9090 is BOTH netbird-relay's and netbird-management's Prometheus default, so on the one-box plane whichever daemon binds second dies; the relay (new in `f251e1f8`) held the port through the geolocation stall. `bea4f095` pins the relay to `NB_METRICS_PORT=8015` beside its 8013/8014 listeners, test-pinned. **Standing rehearsal-e**: its plane carried the dead management from before these fixes, and a re-supply never restarts a start-limit-hit unit — so I applied both fixes as **runtime drop-ins** (`/run/systemd/system/*.d/`, gone at reboot, replaced properly by the next re-found) and restarted: relay `active`, management `active`, `:8011 → HTTP 401` (alive, guarding). The current fire's re-supply lands on a healthy plane that already advertises the relay (drive 13's founding rendered it). **Gap worth a ruling (not landed):** the staleness gate cannot see mesh-render drift — its render fingerprint (the drvpath baseline) tracks only the mesh-less seed scope, so all three of this arc's mesh-render fixes classified as *binary-only* and would have re-supplied a gateway whose rendered config was genuinely stale. Adjacent gap: adoption never probes plane health, so a start-limit-hit management adopts silently and reds 40 minutes later at approve. Both are freshness-tax-report-shaped; happy to file them as a ticket if you want them on the queue. Ruled by session under ADR 0174 — veto anytime. Task 6 of #1153.
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#1214
No description provided.