own-VPS front door: acme-dns wildcard :53 bind loses to systemd-resolved and deadlocks silently — Caddy never starts, the public door has never served #502

Closed
opened 2026-08-13 03:38:17 +00:00 by ben · 2 comments
Owner

Drive 20260813T025903Z (and every own-VPS drive before it — masked until #499/#501 made public-entry honest): the takeover gateway's public front door NEVER serves. Complete causal chain, every link evidenced:

  1. systemd-resolved runs on the gateway (drive-7 droplet-journal.txt: systemd-resolved[742] up at 03:05:18) with its DNS stub listener on 127.0.0.53:53.
  2. acme-dns's wildcard bind fails: our render sets listen = "0.0.0.0:53" (internal/clan/acmedns.go renderAcmeDNSService); a wildcard :53 bind EADDRINUSEs against the stub listener.
  3. Upstream acme-dns 2.0.2 swallows the failure as a silent deadlock (pkg/nameserver/initialize.go InitAndStart, "both" branch): main blocks on waitLock.Lock() until the UDP server's NotifyStartedFunc fires — fired only on SUCCESSFUL start (dns.Server.NotifyStartedFunc); on a bind error Start sends to errChan, which nothing reads until InitAndStart returns — it never does. Journal signature: exactly three acme-dns lines (Using config file, Starting up, Starting DNS listener {0.0.0.0:53, udp}), then silence forever. No TCP listener line, no Listening HTTP (api.go logs that BEFORE binding — never reached).
  4. → the loopback API 127.0.0.1:8081 never binds → acme-dns-register's #431 health poll honestly exhausts its full 300×1s (journal: 301 refused curls, unit fails at 03:10:24) → Caddy (after/requires the register) never starts → https://id.<apex>/https://<apex> never answer → #499's door probe honestly runs its full 120×5s and the deploy declares failed.

Fix (product render, swarm-landable, next drive verifies)

In internal/clan/acmedns.go renderAcmeDNSService: bind acme-dns to the gateway's PUBLIC IP instead of the wildcard —

listen = "<cfg.GatewayIP>:53";

cfg.GatewayIP is already in the render (the zone's glue A records use it). A scoped bind coexists with resolved's 127.0.0.53 stub, keeps the box's own resolution untouched (less invasive than DNSStubListener=no), and is exactly the surface LE's validating resolvers dial. Update the seam test pinning the listen line (acmedns_test.go) and keep the eval smoke green.

Also in scope if small: a GOTCHAS entry for the deadlock signature (three-line acme-dns journal = failed :53 bind swallowed upstream). Out of scope (note only): an upstream acme-dns issue — a failed bind should crash loud, not hang; and drive 7's second finding, the deploy failure after all-rows-green never rendered [data-status="journey-fault"] (the 15-min silent finish leg) — file separately if the reporter hasn't.

Drive `20260813T025903Z` (and every own-VPS drive before it — masked until #499/#501 made `public-entry` honest): the takeover gateway's public front door NEVER serves. Complete causal chain, every link evidenced: 1. **systemd-resolved runs on the gateway** (drive-7 `droplet-journal.txt`: `systemd-resolved[742]` up at 03:05:18) with its DNS stub listener on `127.0.0.53:53`. 2. **acme-dns's wildcard bind fails**: our render sets `listen = "0.0.0.0:53"` (`internal/clan/acmedns.go` `renderAcmeDNSService`); a wildcard `:53` bind EADDRINUSEs against the stub listener. 3. **Upstream acme-dns 2.0.2 swallows the failure as a silent deadlock** (`pkg/nameserver/initialize.go InitAndStart`, "both" branch): main blocks on `waitLock.Lock()` until the UDP server's `NotifyStartedFunc` fires — fired only on SUCCESSFUL start (`dns.Server.NotifyStartedFunc`); on a bind error `Start` sends to `errChan`, which nothing reads until `InitAndStart` returns — it never does. Journal signature: exactly three acme-dns lines (`Using config file`, `Starting up`, `Starting DNS listener {0.0.0.0:53, udp}`), then silence forever. No TCP listener line, no `Listening HTTP` (api.go logs that BEFORE binding — never reached). 4. → the loopback API `127.0.0.1:8081` never binds → `acme-dns-register`'s #431 health poll honestly exhausts its full 300×1s (journal: 301 refused curls, unit fails at 03:10:24) → **Caddy (after/requires the register) never starts** → `https://id.<apex>`/`https://<apex>` never answer → #499's door probe honestly runs its full 120×5s and the deploy declares failed. ## Fix (product render, swarm-landable, next drive verifies) In `internal/clan/acmedns.go` `renderAcmeDNSService`: bind acme-dns to the gateway's PUBLIC IP instead of the wildcard — ``` listen = "<cfg.GatewayIP>:53"; ``` `cfg.GatewayIP` is already in the render (the zone's glue A records use it). A scoped bind coexists with resolved's `127.0.0.53` stub, keeps the box's own resolution untouched (less invasive than `DNSStubListener=no`), and is exactly the surface LE's validating resolvers dial. Update the seam test pinning the listen line (`acmedns_test.go`) and keep the eval smoke green. Also in scope if small: a GOTCHAS entry for the deadlock signature (three-line acme-dns journal = failed :53 bind swallowed upstream). Out of scope (note only): an upstream acme-dns issue — a failed bind should crash loud, not hang; and drive 7's second finding, the deploy failure after all-rows-green never rendered `[data-status="journey-fault"]` (the 15-min silent finish leg) — file separately if the reporter hasn't.
Author
Owner

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

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

close-report for #502 — status success

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

envelope
{
  "issue": 502,
  "status": "success",
  "commits": [
    "ea548a8"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "internal/clan/acmedns.go",
    "internal/clan/acmedns_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "renderAcmeDNSService binds cfg.GatewayIP:53 instead of the wildcard 0.0.0.0:53": "internal/clan/acmedns.go renderAcmeDNSService now emits listen = \"<GatewayIP>:53\" via fmt.Fprintf(cfg.GatewayIP+\":53\")",
    "the seam test pinning the listen line is updated": "internal/clan/acmedns_test.go TestRenderAcmeDNS_ServesDelegatedZone asserts listen = \"203.0.113.4:53\" and forbids 0.0.0.0:53",
    "eval smoke stays green": "nix develop .#go-ci go test ./internal/clan/ exit 0 (includes the eval smoke tests)",
    "GOTCHAS entry for the deadlock signature (in scope if small)": "docs/GOTCHAS.md #26 records the three-line acme-dns journal = failed :53 bind swallowed upstream"
  },
  "summary": "Bind the gateway acme-dns to its public IP not the wildcard :53, so it coexists with systemd-resolved's stub and the own-VPS front door can serve.",
  "blockers": []
}
**close-report** for #502 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 502, "status": "success", "commits": [ "ea548a8" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "internal/clan/acmedns.go", "internal/clan/acmedns_test.go" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/clan/", "exit_code": 0 } ], "criteria": { "renderAcmeDNSService binds cfg.GatewayIP:53 instead of the wildcard 0.0.0.0:53": "internal/clan/acmedns.go renderAcmeDNSService now emits listen = \"<GatewayIP>:53\" via fmt.Fprintf(cfg.GatewayIP+\":53\")", "the seam test pinning the listen line is updated": "internal/clan/acmedns_test.go TestRenderAcmeDNS_ServesDelegatedZone asserts listen = \"203.0.113.4:53\" and forbids 0.0.0.0:53", "eval smoke stays green": "nix develop .#go-ci go test ./internal/clan/ exit 0 (includes the eval smoke tests)", "GOTCHAS entry for the deadlock signature (in scope if small)": "docs/GOTCHAS.md #26 records the three-line acme-dns journal = failed :53 bind swallowed upstream" }, "summary": "Bind the gateway acme-dns to its public IP not the wildcard :53, so it coexists with systemd-resolved's stub and the own-VPS front door can serve.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-13 03:54:14 +00:00
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#502
No description provided.