own-VPS deploy: bare-apex TLS door times out past the 10-min cold-start budget while the wildcard succeeds — apex ACME retry order also flips to LE staging #548

Closed
opened 2026-08-14 22:42:47 +00:00 by ben · 2 comments
Owner

Failure: drive 20260814T221459Z reds at finish — internal/founding/deploy.go:493-508 marks the public-entry deploy row failed because probeDoorsLive (internal/founding/deploy.go:845, called at deploy.go:489) exhausted its shared 120×5s=600s cold-start budget (deploy.go:826-829) without https://rehearsal-b.idss.nz (the bare apex) ever answering over TLS. The app then renders the full-install "no rollback" recovery screen (internal/founding/deploy.go:752-773), caught honestly by the Playwright assertion at tests/e2e/journey.droplet.spec.ts:289.

Evidence:

  • test-results/drive-droplet/20260814T221459Z/state/founding-state.json → standup.deploy.log: https://id.rehearsal-b.idss.nz answered over TLS on probe 47/120 (~235s), but [rehearsal-b.idss.nz] not answering yet continues through probe 119/120 — the bare apex never comes up.
  • test-results/drive-droplet/20260814T221459Z/logs/droplet-caddy.txt: Caddy's ACME obtain for identifier rehearsal-b.idss.nz fails "timed out waiting for record to fully propagate" on every attempt (elapsed 122s/306s/547s, backoff 60→120→120s), while *.rehearsal-b.idss.nz's single retry at elapsed 122s succeeds and never errors again.
  • Anomaly: the apex's 2nd/3rd failed-obtain lines carry order=https://acme-staging-v02.api.letsencrypt.org/... (Let's Encrypt STAGING), while its 1st attempt and the wildcard's attempt both used production acme-v02.api.letsencrypt.org. Nothing in this repo configures a staging fallback — state/clan-config/machines/gateway/front-door.nix (the only rendered Caddy TLS config in this run, front-door.nix:76-114) sets no ca/issuer override, and no .go/.nix file outside test-results/ mentions acme-staging at all (checked via repo-wide grep). docs/GOTCHAS.md #32 explicitly rules staging out ("LE staging is NOT an option here: staging certs aren't browser-trusted"). This CA-URL flip on retries of the SAME identifier is unexplained by anything in-repo.

Ruled out: GOTCHAS #32's rate-limit wall (429 rateLimited ... too many certificates) — that exact string is absent from droplet-caddy.txt; the error here is DNS-01 propagation timeout, a different signature. Cert persistence (internal/certpersist, ADR 0176) is also not in play — test-results/cert-store/ does not exist on this workstation, so no store was seeded for this drive. The control-plane unit's /srv/ourcloud/bin/control-plane: No such file or directory restart loop (22:20:25-22:22:04, droplet-journal.txt:1146-1273) and the two failed + one succeeded clan-switch-gateway-* activation attempts (droplet-journal.txt:1341-1639) are the expected pre-Supply race (control-plane.nix:207-252 execs the binary unconditionally, before fleetwire.Supply.Seed lands it) — the deploy's final standup.deploy.steps shows control-plane/dashboard/brand/admin all done, so this is not the cause of the red.

Suspected layer: infra/timing — DNS-01 propagation for the bare-apex identifier lagging the wildcard's beyond the (already Ben-tuned, 2026-08-13) 600s budget, possibly compounded by a genuine Caddy/certmagic issuer-fallback behavior on the pinned build (pkgs.caddy.withPlugins + caddy-dns/acmedns@v0.7.0, front-door.nix:76-81) that isn't visible from static config. Not a repo code line I can point to with certainty.

What plugging it needs: reproduce against a live droplet (not locally testable — needs a real acme-dns delegation + Let's Encrypt) and determine (a) whether the acme-staging order URL is a real Caddy/certmagic fallback landing unexpectedly on this pinned build, or a red herring, and (b) whether the bare-apex DNS-01 challenge has a structurally slower/different propagation path than the wildcard's (e.g. acme-dns TXT-slot contention when both SANs are solved close together) that the existing 600s budget should account for, versus lengthening doorProbeDefaultAttempts/doorProbeDefaultDelay (deploy.go:826-829) being the wrong lever entirely if the apex order is structurally stuck rather than just slow.

drive 20260814T221459Z red at finish: finish faulted: the gateway deploy failed — The gateway deploy failed. [There is no old operating system to roll back to — this machine was taken over for the community.]
evidence: test-results/…/20260814T221459Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)

**Failure:** drive `20260814T221459Z` reds at `finish` — `internal/founding/deploy.go:493-508` marks the `public-entry` deploy row failed because `probeDoorsLive` (`internal/founding/deploy.go:845`, called at `deploy.go:489`) exhausted its shared 120×5s=600s cold-start budget (`deploy.go:826-829`) without `https://rehearsal-b.idss.nz` (the bare apex) ever answering over TLS. The app then renders the full-install "no rollback" recovery screen (`internal/founding/deploy.go:752-773`), caught honestly by the Playwright assertion at `tests/e2e/journey.droplet.spec.ts:289`. **Evidence:** - `test-results/drive-droplet/20260814T221459Z/state/founding-state.json` → `standup.deploy.log`: `https://id.rehearsal-b.idss.nz answered over TLS on probe 47/120` (~235s), but `[rehearsal-b.idss.nz] not answering yet` continues through `probe 119/120` — the bare apex never comes up. - `test-results/drive-droplet/20260814T221459Z/logs/droplet-caddy.txt`: Caddy's ACME obtain for identifier `rehearsal-b.idss.nz` fails `"timed out waiting for record to fully propagate"` on every attempt (elapsed 122s/306s/547s, backoff 60→120→120s), while `*.rehearsal-b.idss.nz`'s single retry at elapsed 122s succeeds and never errors again. - **Anomaly:** the apex's 2nd/3rd failed-obtain lines carry `order=https://acme-staging-v02.api.letsencrypt.org/...` (Let's Encrypt STAGING), while its 1st attempt and the wildcard's attempt both used production `acme-v02.api.letsencrypt.org`. Nothing in this repo configures a staging fallback — `state/clan-config/machines/gateway/front-door.nix` (the only rendered Caddy TLS config in this run, `front-door.nix:76-114`) sets no `ca`/`issuer` override, and no `.go`/`.nix` file outside `test-results/` mentions `acme-staging` at all (checked via repo-wide grep). `docs/GOTCHAS.md` #32 explicitly rules staging out ("LE staging is NOT an option here: staging certs aren't browser-trusted"). This CA-URL flip on retries of the SAME identifier is unexplained by anything in-repo. **Ruled out:** GOTCHAS #32's rate-limit wall (`429 rateLimited ... too many certificates`) — that exact string is absent from `droplet-caddy.txt`; the error here is DNS-01 propagation timeout, a different signature. Cert persistence (`internal/certpersist`, ADR 0176) is also not in play — `test-results/cert-store/` does not exist on this workstation, so no store was seeded for this drive. The control-plane unit's `/srv/ourcloud/bin/control-plane: No such file or directory` restart loop (22:20:25-22:22:04, `droplet-journal.txt:1146-1273`) and the two failed + one succeeded `clan-switch-gateway-*` activation attempts (`droplet-journal.txt:1341-1639`) are the expected pre-Supply race (`control-plane.nix:207-252` execs the binary unconditionally, before `fleetwire.Supply.Seed` lands it) — the deploy's final `standup.deploy.steps` shows control-plane/dashboard/brand/admin all `done`, so this is not the cause of the red. **Suspected layer:** infra/timing — DNS-01 propagation for the bare-apex identifier lagging the wildcard's beyond the (already Ben-tuned, 2026-08-13) 600s budget, possibly compounded by a genuine Caddy/certmagic issuer-fallback behavior on the pinned build (`pkgs.caddy.withPlugins` + `caddy-dns/acmedns@v0.7.0`, `front-door.nix:76-81`) that isn't visible from static config. Not a repo code line I can point to with certainty. **What plugging it needs:** reproduce against a live droplet (not locally testable — needs a real acme-dns delegation + Let's Encrypt) and determine (a) whether the acme-staging order URL is a real Caddy/certmagic fallback landing unexpectedly on this pinned build, or a red herring, and (b) whether the bare-apex DNS-01 challenge has a structurally slower/different propagation path than the wildcard's (e.g. acme-dns TXT-slot contention when both SANs are solved close together) that the existing 600s budget should account for, versus lengthening `doorProbeDefaultAttempts`/`doorProbeDefaultDelay` (`deploy.go:826-829`) being the wrong lever entirely if the apex order is structurally stuck rather than just slow. drive `20260814T221459Z` red at `finish`: `finish faulted: the gateway deploy failed — The gateway deploy failed. [There is no old operating system to roll back to — this machine was taken over for the community.]` evidence: `test-results/…/20260814T221459Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) <!-- rehearsal-sig: 8d0cd71d20a2 -->
Author
Owner

Ruled by agent under ADR 0174 — veto anytime. Answers to this ticket's two questions, from the live DNS probe that ran DURING this drive (session 2026-08-14, evidence on #492/#547):

(a) The staging flip is benign and designed — certmagic retries a failed ACME order against Let's Encrypt's test CA to avoid burning production rate limits, and switches back to production once validation would succeed. It's built into Caddy/certmagic, which is why no in-repo config mentions it. Not the cause — the propagation self-check fails BEFORE any CA is contacted.

(b) The apex is not structurally slower — it's losing a cache race the wildcard also runs. The pre-challenge point writes *.<slug> CNAME <slug>, which matches _acme-challenge.<slug>; Caddy's first attempts start ~100s before the heartbeat writes the real delegation, and those early polls prime the pinned public resolvers with the wrong chain — including cacheable NEGATIVE answers whose TTL rides Cloudflare's SOA minimum, not our record TTL. The wildcard won its retry right after the caches I was watching converged (22:25:58Z); the apex's checks kept landing on still-poisoned cache nodes. Root cause + fix (broker TTL 60 AND a pre-Caddy delegation-live gate) are directed on #547 (in flight on the swarm). Lengthening the door budget is the wrong lever, as suspected.

Routing: #547 carries the fix; the next drive after it lands is exactly the live reproduction this ticket asks for. Relabelling ready-for-human → deferred with criteria: re-evaluate if a post-#547 drive still reds at finish with the apex-lag signature; close in #547's favour if it greens.

Ruled by agent under ADR 0174 — veto anytime. Answers to this ticket's two questions, from the live DNS probe that ran DURING this drive (session 2026-08-14, evidence on #492/#547): **(a) The staging flip is benign and designed** — certmagic retries a failed ACME order against Let's Encrypt's test CA to avoid burning production rate limits, and switches back to production once validation would succeed. It's built into Caddy/certmagic, which is why no in-repo config mentions it. Not the cause — the propagation self-check fails BEFORE any CA is contacted. **(b) The apex is not structurally slower — it's losing a cache race** the wildcard also runs. The pre-challenge point writes `*.<slug> CNAME <slug>`, which matches `_acme-challenge.<slug>`; Caddy's first attempts start ~100s before the heartbeat writes the real delegation, and those early polls prime the pinned public resolvers with the wrong chain — including cacheable NEGATIVE answers whose TTL rides Cloudflare's SOA minimum, not our record TTL. The wildcard won its retry right after the caches I was watching converged (22:25:58Z); the apex's checks kept landing on still-poisoned cache nodes. Root cause + fix (broker TTL 60 AND a pre-Caddy delegation-live gate) are directed on **#547** (in flight on the swarm). Lengthening the door budget is the wrong lever, as suspected. **Routing:** #547 carries the fix; the next drive after it lands is exactly the live reproduction this ticket asks for. Relabelling ready-for-human → deferred with criteria: re-evaluate if a post-#547 drive still reds at finish with the apex-lag signature; close in #547's favour if it greens.
Author
Owner

Deferred criteria MET on the first post-#547 drive (234251Z, new broker TTL 60): the finish leg CLEARED — both certs issued inside the budget (6 early propagation timeouts inside the now-60s stale window, then success), the apex answered, and the drive ran into the phase-2 tail for the first time since drive 14. The apex-lag was the cache race, as diagnosed. Closing in #547's favour. The un-landed delegation-gate amendment stays optional hardening — re-open only if a future drive shows the finish signature again.

Deferred criteria MET on the first post-#547 drive (`234251Z`, new broker TTL 60): the finish leg CLEARED — both certs issued inside the budget (6 early propagation timeouts inside the now-60s stale window, then success), the apex answered, and the drive ran into the phase-2 tail for the first time since drive 14. The apex-lag was the cache race, as diagnosed. Closing in #547's favour. The un-landed delegation-gate amendment stays optional hardening — re-open only if a future drive shows the finish signature again.
ben closed this issue 2026-08-15 00:04:30 +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.

Dependencies

No dependencies set.

Reference
Matou/idss#548
No description provided.