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
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1214
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The failure
Device drive
20260904T095415Z(commite519ef80), red atapproveafter 731 ms, 24/25 legs green (artifacts/verdict.json,artifacts/legs.json).The strip surfaced the control plane's own sentence, exactly as
approvePendingis built to (app/tests/e2e/fixtures/deviceAdd.ts:256-262, driven fromapp/tests/e2e/journey.device.spec.ts:829):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-mgmtpid 3036 is ALIVE with--port 8011.logs/gateway-units.txt(ss -tlnp, 10:42:35): there is no:8011listener. Signal (:8012), relay (:8013/:8014), control-plane (:8080), kanidm (:8443), caddy — all present. Management is absent.logs/gateway-journal.txt:644: onlynetbird-signalloggedrunning HTTP server with WebSocket proxy (no TLS): [::]:8012. Management NEVER logged itsrunning HTTP server and gRPC server on the same port: [::]:8011counterpart — 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:32Geolocation database file GeoLite2-City_20260602.mmdb not found, file will be downloaded:1992— 10:42:25Geolocation database file geonames_20260602.db not found, file will be downloadedThat is 10 m 53 s for the first database alone, with the second still in flight when the drive gave up.
netbird-managementinitialises 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-admitwas 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
[::]:8011when it binds at all, so[::1]is the right dial. Thelisten tcp 127.0.0.1:6060: bind: address already in useat:691isnetbird-signalalready 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:netbirdServersets no geolocation knob, and nothing pre-seeds the databases into the closure —grep -ri geooverinternal/,control-plane/and the ADRs finds only prose. On drive20260829T213942Zthe two downloads took ~13 s; here the first took ~11 minutes. That 40x is environmental, but the exposure is ours.foundeddoes not mean "can admit a device".logs/founding-state.logrecordsgateway deploy complete — the control plane is liveat 10:32:19.56 and the drive'sactivation/foundedlegs 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.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-34states 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:
internal/clan/netbird.gochanges 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.founded(or the deploy's completion) on mesh admissibility changes what the operator sees during founding.Mintchanges 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-peersresponse-shape decode,docs/GOTCHAS.md) which is fixed and is NOT what happened here — the signature is coarse forapprovereds and should not be read as a repeat.drive
20260904T095415Zred atapprove: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:8evidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260904T095415Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedFIXED 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 onconnection refused.The fix: the render sets
NB_DISABLE_GEOLOCATION=trueonnetbird-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 inTestNetbird_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. Thelisten tcp 127.0.0.1:6060: bind: address already in useline 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.
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 usefive 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 inf251e1f8) held the port through the geolocation stall.bea4f095pins the relay toNB_METRICS_PORT=8015beside 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: relayactive, managementactive,: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.