rented founding: the first control-plane switch burns ~4 min behind the acme-dns gate and exits status 4 on idss-mesh-self-admit's first attempt — publish the delegation at claim and bound the client wait so the switch exits 0 (phase-9 drive refinement) #1500

Closed
opened 2026-09-15 19:31:34 +00:00 by ben · 2 comments
Owner

Symptom

Every founding on a rented gateway spends ~4 minutes inside the first control-plane switch, and that switch then exits status 4 (a unit it started failed), so clan-switch-gateway-*.service ends Failed with result 'exit-code' and the founding's apply has to re-switch to converge. Activation still goes green — this is time and a lying failure, not a broken founding. Seen on every phase-9 fire (#1491, 5/5) and it is not new: GOTCHAS #126 (drive 20260829T213942Z) documents the self-admit half.

Two runs, from the harvested logs/droplet-journal.txt (both on matou-workstation under test-results/drive-rented-services/):

run switch starts self-admit first tries acme gate releases → Caddy starts switch fails (status 4) wall
20260915T155605Z 16:02:40 16:05:45 ("management API has not answered yet"), netbird up DeadlineExceeded 16:06:37 16:06:40 16:06:41 4 min 01 s
20260915T164205Z 17:05:24 17:08:29 17:09:14 17:09:15 3 min 51 s

In both the box re-switches 1 s later (2 s, clean) and idss-mesh-self-admit finishes on its restart (16:06:42 / 17:09:18 — "the gateway's own peer joined its mesh plane on wt0"). Fire 2's self-admit failure was the netbird up client call deadlining against its own daemon (daemon up failed: call service up method: rpc error: code = DeadlineExceeded), i.e. past GOTCHAS #126's "wait for the management API" guard — a second readiness hole, one layer down.

Two costs, two questions

  1. The 4 minutes are the acme-dns-gate (#554 / ADR 0014). Caddy is ordered after the gate, the gate polls the pinned resolvers (1.1.1.1, 8.8.8.8) until _acme-challenge.<slug>.idss.nz is live, and switch-to-configuration waits for every unit it starts. That is DNS propagation of a delegation the box itself only registers at first boot (acme-dns-register.service). The rented path already knows the slug at claim (the wizard claims before it rents — claim → wizard-rent legs) and the drive even seeds a held cert store pre-deploy (#724) — yet the first switch still pays the full propagation wait behind the gate. Question: can the delegation be published at claim/rent time (broker side, the moment the slug is reserved) so it is already resolvable when the box first switches — or can Caddy start behind the gate without holding the switch (the gate as a Caddy ExecStartPre/wait rather than a Before= of the switch's own job set)?
  2. The status 4 is idss-mesh-self-admit failing its first attempt and being rescued by its restart — exactly the "retry loop that PRINTS" GOTCHAS #126 rules against, now from the netbird client up deadline rather than the management API bind. Question: bound the wait for the daemon the same way mintSelfOncePlaneAnswers bounds the wait for the plane (control-plane/cmd/control-plane/mesh_self_admit.go), so the unit's first attempt succeeds and the switch exits 0.

Acceptance

  • The first control-plane switch of a rented founding exits 0 (no failed (status 4), no clan-switch-gateway-* Failed with result) — provable from logs/droplet-journal.txt of the next rented / rented-services drive.
  • The switch's wall time no longer contains the DNS-propagation wait, OR the ticket's close-report explains why the delegation cannot be published earlier and what the floor is. Measure: clan-switch-gateway-*.service: Consumed … wall clock time line, before/after.
  • GOTCHAS #126 gains the client-deadline finding (or a new entry) in the same commit.

Evidence

Phase 9 drive #1491 (GREEN 2026-09-15), runs 20260915T155605Z and 20260915T164205Z on matou-workstation. GOTCHAS #126. ADR 0014 (acme-dns), ADR 0159 (mesh ordering).

## Symptom Every founding on a rented gateway spends **~4 minutes inside the first control-plane switch**, and that switch then **exits status 4** (a unit it started failed), so `clan-switch-gateway-*.service` ends `Failed with result 'exit-code'` and the founding's apply has to re-switch to converge. Activation still goes green — this is time and a lying failure, not a broken founding. Seen on every phase-9 fire (#1491, 5/5) and it is not new: GOTCHAS #126 (drive `20260829T213942Z`) documents the self-admit half. Two runs, from the harvested `logs/droplet-journal.txt` (both on matou-workstation under `test-results/drive-rented-services/`): | run | switch starts | self-admit first tries | acme gate releases → Caddy starts | switch fails (status 4) | wall | |---|---|---|---|---|---| | `20260915T155605Z` | 16:02:40 | 16:05:45 ("management API has not answered yet"), `netbird up` **DeadlineExceeded** 16:06:37 | 16:06:40 | 16:06:41 | **4 min 01 s** | | `20260915T164205Z` | 17:05:24 | 17:08:29 | 17:09:14 | 17:09:15 | **3 min 51 s** | In both the box re-switches 1 s later (2 s, clean) and `idss-mesh-self-admit` finishes on its restart (16:06:42 / 17:09:18 — "the gateway's own peer joined its mesh plane on wt0"). Fire 2's self-admit failure was the `netbird up` client call deadlining against its own daemon (`daemon up failed: call service up method: rpc error: code = DeadlineExceeded`), i.e. past GOTCHAS #126's "wait for the management API" guard — a second readiness hole, one layer down. ## Two costs, two questions 1. **The 4 minutes are the `acme-dns-gate` (#554 / ADR 0014).** Caddy is ordered after the gate, the gate polls the pinned resolvers (1.1.1.1, 8.8.8.8) until `_acme-challenge.<slug>.idss.nz` is live, and `switch-to-configuration` waits for every unit it starts. That is DNS propagation of a delegation the box itself only registers at first boot (`acme-dns-register.service`). The rented path already knows the slug at **claim** (the wizard claims before it rents — `claim` → `wizard-rent` legs) and the drive even seeds a held cert store pre-deploy (#724) — yet the first switch still pays the full propagation wait behind the gate. Question: can the delegation be published at claim/rent time (broker side, the moment the slug is reserved) so it is already resolvable when the box first switches — or can Caddy start behind the gate without holding the switch (the gate as a Caddy `ExecStartPre`/wait rather than a `Before=` of the switch's own job set)? 2. **The status 4 is `idss-mesh-self-admit` failing its first attempt** and being rescued by its restart — exactly the "retry loop that PRINTS" GOTCHAS #126 rules against, now from the netbird *client* `up` deadline rather than the management API bind. Question: bound the wait for the daemon the same way `mintSelfOncePlaneAnswers` bounds the wait for the plane (`control-plane/cmd/control-plane/mesh_self_admit.go`), so the unit's first attempt succeeds and the switch exits 0. ## Acceptance - The first control-plane switch of a rented founding exits 0 (no `failed (status 4)`, no `clan-switch-gateway-*` `Failed with result`) — provable from `logs/droplet-journal.txt` of the next rented / rented-services drive. - The switch's wall time no longer contains the DNS-propagation wait, OR the ticket's close-report explains why the delegation cannot be published earlier and what the floor is. Measure: `clan-switch-gateway-*.service: Consumed … wall clock time` line, before/after. - GOTCHAS #126 gains the client-deadline finding (or a new entry) in the same commit. ## Evidence Phase 9 drive #1491 (GREEN 2026-09-15), runs `20260915T155605Z` and `20260915T164205Z` on matou-workstation. GOTCHAS #126. ADR 0014 (acme-dns), ADR 0159 (mesh ordering).

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

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

close-report for #1500 — status success

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

envelope
{
  "issue": 1500,
  "status": "success",
  "commits": [
    "f0c6eb122c0eb6777e16ebc238e279f571600b4b"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "internal/clan/netbird.go",
    "internal/clan/netbird_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/clan/ -run 'TestNetbird_SelfAdmit|TestNetbird_ClientDeclared|TestMeshBound'",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/clan/ ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c bash -c 'gofmt -l internal/clan/netbird.go internal/clan/netbird_test.go; go vet ./internal/clan/...; go build ./...'",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The first control-plane switch of a rented founding exits 0 (no failed status 4, no clan-switch-gateway-* Failed with result) — provable from logs/droplet-journal.txt of the next rented drive": "Root cause fixed at its source: the status-4 was idss-mesh-self-admit deadlining on `netbird up` against its still-binding Type=simple client daemon (the issue's own part-2 analysis). internal/clan/netbird.go meshSelfAdmitOneshot now wraps the redeem `netbird up` in a bounded, marker-free retry loop that confirms the join via `netbird status` and only fails loud on a spent budget, so the oneshot's FIRST attempt succeeds and the switch exits 0. Proven at the render seam by TestNetbird_SelfAdmitWaitsOutTheClientDaemon (commit f0c6eb12); the live droplet-journal confirmation rides the next rented-services fire (executor spend, not a one-shot session's to run — ADR 0174 rule 7).",
    "The switch's wall time no longer contains the DNS-propagation wait, OR the close-report explains why the delegation cannot be published earlier and what the floor is": "EXPLAINED (the acceptance clause's sanctioned OR). The delegation CANNOT be published at claim/rent: the `_acme-challenge.<slug>` CNAME's target is the gateway's acme-dns registration `fulldomain` — a RANDOM per-registration value acme-dns's /register mints on the box at FIRST BOOT (acme-dns-register.service), so the broker cannot know it at claim; it learns it only when the post-boot heartbeat reads the published fulldomain fact and writes the CNAME (ADR 0136 delegation-reconcile, #922). The #724 seed stages CADDY's cert store (cert + ACME account, ADR 0176), NOT the acme-dns account, so a seeded box still re-registers acme-dns fresh. THE FLOOR for a genuine first founding is therefore: first-boot register (post-boot) -> next heartbeat tick writes the CNAME -> DNS propagation on the pinned resolvers -> gate releases (~4 min observed). Neither option 2 (gate as Caddy ExecStartPre) removes it: `switch-to-configuration` waits for caddy.service to reach active, and Caddy's start must still block on the wait or its first ACME order poisons the resolver negative cache (#547) — the wait is fundamental and must complete before Caddy's first order. The ONE safe wall-time win — skipping the gate's poll when a valid cert is already seeded (Caddy then orders zero certs, so there is nothing to poison) — touches the #547 poisoning-sensitive TLS gate and wants its own rented drive to prove before/after; filed as #1502.",
    "GOTCHAS #126 gains the client-deadline finding (or a new entry) in the same commit": "docs/GOTCHAS.md #126 gains a 2026-09-15 #1500 amendment (same commit f0c6eb12): the mint's wait was closed but the REDEEM `netbird up` is the same class one layer down at the CLIENT daemon; the rule generalises to 'bound EVERY call to a Type=simple daemon, mint and redeem alike'. Names the tooth TestNetbird_SelfAdmitWaitsOutTheClientDaemon."
  },
  "summary": "The rented founding's first control-plane switch now exits 0: the self-admit redeem `netbird up` waits out its still-binding client daemon in a bounded, marker-free retry the way the mint waits out the management plane; the ~4-min acme-dns gate wait is ruled a real floor (delegation can't be published at claim) with the seeded-cert wall-time win filed as #1502.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1500 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1500, "status": "success", "commits": [ "f0c6eb122c0eb6777e16ebc238e279f571600b4b" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "internal/clan/netbird.go", "internal/clan/netbird_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/clan/ -run 'TestNetbird_SelfAdmit|TestNetbird_ClientDeclared|TestMeshBound'", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/clan/ ./control-plane/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c bash -c 'gofmt -l internal/clan/netbird.go internal/clan/netbird_test.go; go vet ./internal/clan/...; go build ./...'", "exit_code": 0 } ], "criteria": { "The first control-plane switch of a rented founding exits 0 (no failed status 4, no clan-switch-gateway-* Failed with result) — provable from logs/droplet-journal.txt of the next rented drive": "Root cause fixed at its source: the status-4 was idss-mesh-self-admit deadlining on `netbird up` against its still-binding Type=simple client daemon (the issue's own part-2 analysis). internal/clan/netbird.go meshSelfAdmitOneshot now wraps the redeem `netbird up` in a bounded, marker-free retry loop that confirms the join via `netbird status` and only fails loud on a spent budget, so the oneshot's FIRST attempt succeeds and the switch exits 0. Proven at the render seam by TestNetbird_SelfAdmitWaitsOutTheClientDaemon (commit f0c6eb12); the live droplet-journal confirmation rides the next rented-services fire (executor spend, not a one-shot session's to run — ADR 0174 rule 7).", "The switch's wall time no longer contains the DNS-propagation wait, OR the close-report explains why the delegation cannot be published earlier and what the floor is": "EXPLAINED (the acceptance clause's sanctioned OR). The delegation CANNOT be published at claim/rent: the `_acme-challenge.<slug>` CNAME's target is the gateway's acme-dns registration `fulldomain` — a RANDOM per-registration value acme-dns's /register mints on the box at FIRST BOOT (acme-dns-register.service), so the broker cannot know it at claim; it learns it only when the post-boot heartbeat reads the published fulldomain fact and writes the CNAME (ADR 0136 delegation-reconcile, #922). The #724 seed stages CADDY's cert store (cert + ACME account, ADR 0176), NOT the acme-dns account, so a seeded box still re-registers acme-dns fresh. THE FLOOR for a genuine first founding is therefore: first-boot register (post-boot) -> next heartbeat tick writes the CNAME -> DNS propagation on the pinned resolvers -> gate releases (~4 min observed). Neither option 2 (gate as Caddy ExecStartPre) removes it: `switch-to-configuration` waits for caddy.service to reach active, and Caddy's start must still block on the wait or its first ACME order poisons the resolver negative cache (#547) — the wait is fundamental and must complete before Caddy's first order. The ONE safe wall-time win — skipping the gate's poll when a valid cert is already seeded (Caddy then orders zero certs, so there is nothing to poison) — touches the #547 poisoning-sensitive TLS gate and wants its own rented drive to prove before/after; filed as #1502.", "GOTCHAS #126 gains the client-deadline finding (or a new entry) in the same commit": "docs/GOTCHAS.md #126 gains a 2026-09-15 #1500 amendment (same commit f0c6eb12): the mint's wait was closed but the REDEEM `netbird up` is the same class one layer down at the CLIENT daemon; the rule generalises to 'bound EVERY call to a Type=simple daemon, mint and redeem alike'. Names the tooth TestNetbird_SelfAdmitWaitsOutTheClientDaemon." }, "summary": "The rented founding's first control-plane switch now exits 0: the self-admit redeem `netbird up` waits out its still-binding client daemon in a bounded, marker-free retry the way the mint waits out the management plane; the ~4-min acme-dns gate wait is ruled a real floor (delegation can't be published at claim) with the seeded-cert wall-time win filed as #1502.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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.

Dependencies

No dependencies set.

Reference
Matou/idss#1500
No description provided.