front door: gate Caddy's first start on the acme delegation being live — TTL-60 narrowed but cannot close the DNS-01 poisoning race; + harvest certs on red (finish reds 003509Z vs 234251Z discriminating pair) #554

Closed
opened 2026-08-15 00:55:17 +00:00 by ben · 2 comments
Owner

What breaks

Drive 20260815T003509Z red at finish with the #547 signature BACK: 12 propagation timeouts, both identifiers, wildcard never issued, id.rehearsal-b never answered. The TTL-60 fix (#547, broker live since 23:40Z — this drive's records verified ttl=60) improved the odds but did NOT close the race: drive 234251Z cleared finish (6 timeouts then success), this one never converged. Discriminating pair, one variable.

Why TTL-60 cannot be sufficient (the #547 amendment, comment 8286)

The poisoning window is structural: Caddy starts ordering ~100s before the heartbeat writes the real _acme-challenge CNAME. Early propagation polls through the pinned resolvers cache the wildcard-synthesized chain — and the TXT lookups produce NODATA answers that negative-cache per Cloudflare's SOA minimum (RFC 2308), not per our record TTL. A poisoned cache node can serve that negative answer for ~30 min regardless of the 60s records. Each drive is a coin flip on which anycast nodes the checker lands on.

Fix directed (two halves, both this ticket)

1. Close the poisoning window — gate Caddy's first start on the delegation being live. Render-side (enrollment.go/frontdoor.go family): an ordered oneshot between acme-dns-register and caddy that polls dig +short CNAME _acme-challenge.<apex> @1.1.1.1 (and @8.8.8.8) until it returns the acme-dns fulldomain the register just published. Bounded ~5 min, FAIL-OPEN with a loud journal line (the door must never deadlock on a broker outage). The heartbeat writes the CNAME ~90s after boot, so the gate typically waits <2 min and saves every wasted early ACME attempt. Seam test on the rendered unit graph + the poll script's fail-open.

2. Stop wasting issued certs — harvest the Caddy store on ANY drive that has one, not green-only. scripts/lib/rehearsal-droplet.sh gates oc_droplet_harvest_certs on green; 234251Z issued a REAL wildcard cert, then red'd at files-healthy, and the cert died with the droplet — an LE exact-set order wasted (2 of 5/168h now burned for rehearsal-b, GOTCHAS #32) and the next drive left racing again. Harvest whenever the droplet's Caddy store contains certificates; the seed half (#532) already handles the rest. With this, even a red-after-issuance run makes every subsequent drive skip issuance entirely.

Evidence

  • test-results/drive-droplet/20260815T003509Z/logs/droplet-caddy.txt: 12× timed out waiting for record to fully propagate, identifiers *.rehearsal-b.idss.nz ×3 orders + rehearsal-b.idss.nz ×3.
  • Contrast 234251Z same logs: 6 timeouts then wildcard issued, finish cleared — same TTL-60 records (CF-verified), different cache luck.
  • Live probe transcript (2026-08-14 session, scratchpad dns-probe.log): 8.8.8.8 serving the real challenge TXT while 1.1.1.1 still served the poisoned wildcard chain.

Real-founding relevance: half 1 is a first-founding UX defect for every own-VPS community (stock founding fails ~half the time at the last step); half 2 is rehearsal-only.

## What breaks Drive `20260815T003509Z` red at finish with the #547 signature BACK: 12 propagation timeouts, both identifiers, wildcard never issued, `id.rehearsal-b` never answered. The TTL-60 fix (#547, broker live since 23:40Z — this drive's records verified ttl=60) improved the odds but did NOT close the race: drive `234251Z` cleared finish (6 timeouts then success), this one never converged. Discriminating pair, one variable. ## Why TTL-60 cannot be sufficient (the #547 amendment, comment 8286) The poisoning window is structural: Caddy starts ordering ~100s before the heartbeat writes the real `_acme-challenge` CNAME. Early propagation polls through the pinned resolvers cache the wildcard-synthesized chain — and the TXT lookups produce NODATA answers that negative-cache per **Cloudflare's SOA minimum** (RFC 2308), not per our record TTL. A poisoned cache node can serve that negative answer for ~30 min regardless of the 60s records. Each drive is a coin flip on which anycast nodes the checker lands on. ## Fix directed (two halves, both this ticket) **1. Close the poisoning window — gate Caddy's first start on the delegation being live.** Render-side (enrollment.go/frontdoor.go family): an ordered oneshot between `acme-dns-register` and `caddy` that polls `dig +short CNAME _acme-challenge.<apex> @1.1.1.1` (and `@8.8.8.8`) until it returns the acme-dns fulldomain the register just published. Bounded ~5 min, FAIL-OPEN with a loud journal line (the door must never deadlock on a broker outage). The heartbeat writes the CNAME ~90s after boot, so the gate typically waits <2 min and saves every wasted early ACME attempt. Seam test on the rendered unit graph + the poll script's fail-open. **2. Stop wasting issued certs — harvest the Caddy store on ANY drive that has one, not green-only.** `scripts/lib/rehearsal-droplet.sh` gates `oc_droplet_harvest_certs` on green; `234251Z` issued a REAL wildcard cert, then red'd at files-healthy, and the cert died with the droplet — an LE exact-set order wasted (2 of 5/168h now burned for rehearsal-b, GOTCHAS #32) and the next drive left racing again. Harvest whenever the droplet's Caddy store contains certificates; the seed half (#532) already handles the rest. With this, even a red-after-issuance run makes every subsequent drive skip issuance entirely. ## Evidence - `test-results/drive-droplet/20260815T003509Z/logs/droplet-caddy.txt`: 12× `timed out waiting for record to fully propagate`, identifiers `*.rehearsal-b.idss.nz` ×3 orders + `rehearsal-b.idss.nz` ×3. - Contrast `234251Z` same logs: 6 timeouts then wildcard issued, finish cleared — same TTL-60 records (CF-verified), different cache luck. - Live probe transcript (2026-08-14 session, scratchpad dns-probe.log): 8.8.8.8 serving the real challenge TXT while 1.1.1.1 still served the poisoned wildcard chain. Real-founding relevance: half 1 is a first-founding UX defect for every own-VPS community (stock founding fails ~half the time at the last step); half 2 is rehearsal-only.
Author
Owner

swarm-claim host=elitebook-distributed-server-03 run=6523
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=6523 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

close-report for #554 — status success

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

envelope
{
  "issue": 554,
  "status": "success",
  "commits": [
    "ca4ae10bd7eb1aaf080518229c7587fc79763a45"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/clan/acmedns.go",
    "internal/clan/acmedns_attach.go",
    "internal/clan/acmedns_test.go",
    "internal/clan/gateway_attach.go",
    "scripts/lib/rehearsal-droplet.sh"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/ ./internal/founding/",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "CGO_ENABLED=0 golangci-lint run ./internal/clan/...",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/lib/rehearsal-droplet.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Half 1: an ordered oneshot between acme-dns-register and caddy polls dig CNAME _acme-challenge.<apex> @1.1.1.1/@8.8.8.8 until it returns the acme-dns fulldomain": "internal/clan/acmedns.go renderAcmeDNSGate/acmednsGateScript: acme-dns-gate oneshot, after=acme-dns-register before=caddy wantedBy=caddy, polls `dig +short CNAME \"$challenge\" \"@$r\"` over resolvers 1.1.1.1 8.8.8.8, comparing to the published fulldomain fact. Verified by TestRenderAcmeDNS_GatesCaddyOnDelegationLive.",
    "Half 1: bounded ~5 min, FAIL-OPEN with a loud journal line": "acmednsGateScript loops `seq 1 60` x sleep 5 (~5min); every path exits 0 (converged / spent-budget 'never resolved' loud line / absent fact); no exit 1. Verified by TestRenderAcmeDNS_GateIsFailOpen and out-of-band execution of all three paths (never-live/live/no-fact all exit 0).",
    "Half 1: seam test on the rendered unit graph + the poll script's fail-open": "internal/clan/acmedns_test.go TestRenderAcmeDNS_GatesCaddyOnDelegationLive (unit graph + ordering + dig/resolvers/fulldomain), TestRenderAcmeDNS_CaddyOrdersAfterTheGate (caddy after acme-dns-gate), TestRenderAcmeDNS_GateIsFailOpen (no exit 1, bounded, loud), TestRenderAcmeDNS_GateResolversFollowConfig.",
    "Half 2: harvest the Caddy store on ANY drive that has one, not green-only": "scripts/lib/rehearsal-droplet.sh oc_droplet_harvest_certs: removed the `[[ drive_rc == 0 ]] || return 0` green gate; the existing `*.crt` guard now decides seedability regardless of red/green, so a red-after-issuance drive (234251Z class) is harvested and feeds the next same-slug #532 seed."
  },
  "summary": "Gate Caddy's first start on the ACME delegation being live (fail-open acme-dns-gate oneshot) and harvest the Caddy store on any drive that holds a cert, not green-only.",
  "blockers": []
}
**close-report** for #554 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 554, "status": "success", "commits": [ "ca4ae10bd7eb1aaf080518229c7587fc79763a45" ], "changed_files": [ "STATUS.md", "internal/clan/acmedns.go", "internal/clan/acmedns_attach.go", "internal/clan/acmedns_test.go", "internal/clan/gateway_attach.go", "scripts/lib/rehearsal-droplet.sh" ], "tests": [ { "command": "go test ./internal/clan/ ./internal/founding/", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "CGO_ENABLED=0 golangci-lint run ./internal/clan/...", "exit_code": 0 }, { "command": "bash -n scripts/lib/rehearsal-droplet.sh", "exit_code": 0 } ], "criteria": { "Half 1: an ordered oneshot between acme-dns-register and caddy polls dig CNAME _acme-challenge.<apex> @1.1.1.1/@8.8.8.8 until it returns the acme-dns fulldomain": "internal/clan/acmedns.go renderAcmeDNSGate/acmednsGateScript: acme-dns-gate oneshot, after=acme-dns-register before=caddy wantedBy=caddy, polls `dig +short CNAME \"$challenge\" \"@$r\"` over resolvers 1.1.1.1 8.8.8.8, comparing to the published fulldomain fact. Verified by TestRenderAcmeDNS_GatesCaddyOnDelegationLive.", "Half 1: bounded ~5 min, FAIL-OPEN with a loud journal line": "acmednsGateScript loops `seq 1 60` x sleep 5 (~5min); every path exits 0 (converged / spent-budget 'never resolved' loud line / absent fact); no exit 1. Verified by TestRenderAcmeDNS_GateIsFailOpen and out-of-band execution of all three paths (never-live/live/no-fact all exit 0).", "Half 1: seam test on the rendered unit graph + the poll script's fail-open": "internal/clan/acmedns_test.go TestRenderAcmeDNS_GatesCaddyOnDelegationLive (unit graph + ordering + dig/resolvers/fulldomain), TestRenderAcmeDNS_CaddyOrdersAfterTheGate (caddy after acme-dns-gate), TestRenderAcmeDNS_GateIsFailOpen (no exit 1, bounded, loud), TestRenderAcmeDNS_GateResolversFollowConfig.", "Half 2: harvest the Caddy store on ANY drive that has one, not green-only": "scripts/lib/rehearsal-droplet.sh oc_droplet_harvest_certs: removed the `[[ drive_rc == 0 ]] || return 0` green gate; the existing `*.crt` guard now decides seedability regardless of red/green, so a red-after-issuance drive (234251Z class) is harvested and feeds the next same-slug #532 seed." }, "summary": "Gate Caddy's first start on the ACME delegation being live (fail-open acme-dns-gate oneshot) and harvest the Caddy store on any drive that holds a cert, not green-only.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-15 01:09:33 +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#554
No description provided.