the rented cert store counts leaves, not identifiers, so a wildcard-only harvest seeds as complete and the apex is re-ordered into Let's Encrypt's wall every drive #988

Closed
opened 2026-08-29 13:46:11 +00:00 by matou-build-agent · 2 comments

Drive 20260829T131523Z (device target, commit 739861da) red at standing and activation, signature 25304f657c24, after ~24 min and one rented droplet.

Failure

artifacts/legs.json — 15 green, 2 red; both reds carry the same line:

the gateway deploy failed — The gateway deploy failed — Let's Encrypt is rate-limiting new certificates for this domain.

The classifier is doing its job here (that naming is a55351d5's fix, internal/clan/errors.go:26 FailRateLimit). The fault underneath it is real and unfixed.

Evidence

The apex is walled; the wildcard is not. logs/gateway-caddy.txt — five obtain attempts, 13:29:59 → 13:40:28, all on one identifier:

"identifier":"rehearsal-d.idss.nz" … HTTP 429 urn:ietf:params:acme:error:rateLimited -
too many certificates (5) already issued for this exact set of identifiers in the last
168h0m0s, retry after 2026-08-30 01:30:07 UTC

No 429 for *.rehearsal-d.idss.nz — that one obtained at 13:30:06. The wall stands until 2026-08-30 01:30:07 UTC, ~12h past this drive.

Why the quota was burned. The DEVICE target never armed the cert-persistence worker until baa3fe7a (HEAD~1). None of the three prior device drives has a logs/cert-rented.txt at all (20260829T105554Z, 20260829T113721Z, 20260829T114921Z); this drive is the first that does. Every prior same-slug device drive therefore ordered a fresh apex from cold, and GOTCHAS #32's 5-per-168h wall closed (docs/GOTCHAS.md:843-857).

The harvested store cannot prevent the next order. logs/cert-rented.txt:

rented certs: no seedable store held for 'rehearsal-d' — Caddy orders fresh this drive (#532/#724)
rented certs: harvested the gateway's Caddy store for 'rehearsal-d' … The next same-slug rented
  drive seeds this store and orders zero new certificates (#724, GOTCHAS #32)
rented-cert-harvest: done

That last promise is false. test-results/cert-store/rehearsal-d/ (written 13:29:58–13:30:08) holds:

  • certificates/…/wildcard_.rehearsal-d.idss.nz/*.{crt,key,json} — the wildcard only;
  • no certificates/…/rehearsal-d.idss.nz/ — no apex leaf;
  • locks/issue_cert_rehearsal-d.idss.nz.lock = {"created":"2026-08-29T13:29:58Z","updated":"2026-08-29T13:30:08Z"} — a live-looking lock captured mid-obtain.

For contrast, test-results/cert-store/rehearsal-c/ (from a drive that got both) holds apex and wildcard.

And the partial store is judged seedable:

$ CGO_ENABLED=0 go run ./cmd/rehearsal-certstore decide …/cert-store/rehearsal-d
seed: 1 harvested leaf cert(s) valid and outside the renewal window   # exit 0

Suspected layer

The seed/harvest completeness contract. Both halves gate on any one certificate, never on the identifier set the gateway actually serves:

  • internal/certpersist/decide.go:92-98 — if leaves == 0 → SkipAbsent, otherwise Seed. One valid leaf makes the whole store seedable.
  • scripts/lib/rehearsal-droplet.sh:175 — the harvest swaps the held store in when find "$tmp" -name '*.crt' -print -quit is non-empty. One cert means "a store was captured".
  • scripts/lib/rehearsal-droplet.sh:1067 — the phase-C readiness probe is that same any-one-cert find … -print -quit, so the harvest fires the moment the first certificate lands, racing an apex obtain still in flight.
  • scripts/lib/rehearsal-droplet.sh:1101 — prints the zero-new-orders promise regardless.

The gateway needs two identifier sets, <slug>.idss.nz and *.<slug>.idss.nz (docs/GOTCHAS.md:853-855). A store holding one is seeded as if it held both, so the apex is ordered fresh every drive — which is exactly the asymmetry this run shows: wildcard fine, apex exhausted.

Next drive, unchanged: the held store decides seed, seeds the wildcard, Caddy orders the apex, 429 again until 2026-08-30 01:30:07 UTC. Identical red, identical signature, one more paid droplet.

What plugging it needs

  1. Make completeness identifier-aware, not leaf-count-aware. certpersist.Decide (and the phase-C readiness probe at rehearsal-droplet.sh:1067 + the harvest swap gate at :175) should take the required identifier set for the slug — apex + wildcard — and only call a store complete/seedable when every required leaf is present and fresh. A partial store must say so loudly and must not print the zero-orders promise at :1101.
  2. Do not harvest mid-obtain. Phase C should wait for the full set (or a settled Caddy) rather than the first *.crt, and the harvest should drop locks/ instead of capturing a live lock file.
  3. Pre-flight wall gate. internal/founding/deploy.go:1230 (caddyRateLimit) already parses the retry-after and :1219 (leRetryAfterRE) extracts the instant. A drive should persist the last known retry-after per slug and refuse to rent — skip, not red — while the wall stands, instead of spending a droplet and 24 minutes rediscovering it. This is the cost control the last two reds at this signature both lacked.
  4. Sequencing note for whoever takes this: fixing (1) alone makes things worse in the short term — an identifier-aware Decide flips the held rehearsal-d store to skip, so the next drive orders the wildcard fresh too and burns a second identifier set into the same wall. (1) must land with (3).

Operator unblock for the queue

Either wait past 2026-08-30 01:30:07 UTC, or rotate the slug — GOTCHAS #32's own Rule (docs/GOTCHAS.md:859-861): REHEARSAL_SLUG is env-tunable and a rateLimited 429 means rotate. rehearsal-c → rehearsal-d was rotated this way on 2026-08-28 (test-results/slug-claims/, standing-rented.retired-rehearsal-c-20260828). A fresh apex has an unwalled identifier set.

drive 20260829T131523Z red at standing: the gateway deploy failed — The gateway deploy failed — Let's Encrypt is rate-limiting new certificates for this domain. [There is no old operating system to roll back to — this server was rente
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260829T131523Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

Drive `20260829T131523Z` (device target, commit `739861da`) red at `standing` and `activation`, signature `25304f657c24`, after ~24 min and one rented droplet. ## Failure `artifacts/legs.json` — 15 green, 2 red; both reds carry the same line: > the gateway deploy failed — The gateway deploy failed — Let's Encrypt is rate-limiting new certificates for this domain. The classifier is doing its job here (that naming is `a55351d5`'s fix, `internal/clan/errors.go:26` `FailRateLimit`). The fault underneath it is real and unfixed. ## Evidence **The apex is walled; the wildcard is not.** `logs/gateway-caddy.txt` — five obtain attempts, 13:29:59 → 13:40:28, all on one identifier: ``` "identifier":"rehearsal-d.idss.nz" … HTTP 429 urn:ietf:params:acme:error:rateLimited - too many certificates (5) already issued for this exact set of identifiers in the last 168h0m0s, retry after 2026-08-30 01:30:07 UTC ``` No 429 for `*.rehearsal-d.idss.nz` — that one obtained at 13:30:06. The wall stands until **2026-08-30 01:30:07 UTC**, ~12h past this drive. **Why the quota was burned.** The DEVICE target never armed the cert-persistence worker until `baa3fe7a` (HEAD~1). None of the three prior device drives has a `logs/cert-rented.txt` at all (`20260829T105554Z`, `20260829T113721Z`, `20260829T114921Z`); this drive is the first that does. Every prior same-slug device drive therefore ordered a fresh apex from cold, and GOTCHAS #32's 5-per-168h wall closed (`docs/GOTCHAS.md:843-857`). **The harvested store cannot prevent the next order.** `logs/cert-rented.txt`: ``` rented certs: no seedable store held for 'rehearsal-d' — Caddy orders fresh this drive (#532/#724) rented certs: harvested the gateway's Caddy store for 'rehearsal-d' … The next same-slug rented drive seeds this store and orders zero new certificates (#724, GOTCHAS #32) rented-cert-harvest: done ``` That last promise is false. `test-results/cert-store/rehearsal-d/` (written 13:29:58–13:30:08) holds: - `certificates/…/wildcard_.rehearsal-d.idss.nz/*.{crt,key,json}` — the wildcard only; - **no** `certificates/…/rehearsal-d.idss.nz/` — no apex leaf; - `locks/issue_cert_rehearsal-d.idss.nz.lock` = `{"created":"2026-08-29T13:29:58Z","updated":"2026-08-29T13:30:08Z"}` — a live-looking lock captured mid-obtain. For contrast, `test-results/cert-store/rehearsal-c/` (from a drive that got both) holds apex **and** wildcard. And the partial store is judged seedable: ``` $ CGO_ENABLED=0 go run ./cmd/rehearsal-certstore decide …/cert-store/rehearsal-d seed: 1 harvested leaf cert(s) valid and outside the renewal window # exit 0 ``` ## Suspected layer The seed/harvest completeness contract. Both halves gate on **any one certificate**, never on the identifier set the gateway actually serves: - `internal/certpersist/decide.go:92-98` — `if leaves == 0 → SkipAbsent`, otherwise `Seed`. One valid leaf makes the whole store seedable. - `scripts/lib/rehearsal-droplet.sh:175` — the harvest swaps the held store in when `find "$tmp" -name '*.crt' -print -quit` is non-empty. One cert means "a store was captured". - `scripts/lib/rehearsal-droplet.sh:1067` — the phase-C readiness probe is that same any-one-cert `find … -print -quit`, so the harvest fires the moment the **first** certificate lands, racing an apex obtain still in flight. - `scripts/lib/rehearsal-droplet.sh:1101` — prints the zero-new-orders promise regardless. The gateway needs two identifier sets, `<slug>.idss.nz` and `*.<slug>.idss.nz` (`docs/GOTCHAS.md:853-855`). A store holding one is seeded as if it held both, so the apex is ordered fresh every drive — which is exactly the asymmetry this run shows: wildcard fine, apex exhausted. **Next drive, unchanged:** the held store decides `seed`, seeds the wildcard, Caddy orders the apex, 429 again until 2026-08-30 01:30:07 UTC. Identical red, identical signature, one more paid droplet. ## What plugging it needs 1. **Make completeness identifier-aware, not leaf-count-aware.** `certpersist.Decide` (and the phase-C readiness probe at `rehearsal-droplet.sh:1067` + the harvest swap gate at `:175`) should take the required identifier set for the slug — apex + wildcard — and only call a store complete/seedable when every required leaf is present and fresh. A partial store must say so loudly and must not print the zero-orders promise at `:1101`. 2. **Do not harvest mid-obtain.** Phase C should wait for the full set (or a settled Caddy) rather than the first `*.crt`, and the harvest should drop `locks/` instead of capturing a live lock file. 3. **Pre-flight wall gate.** `internal/founding/deploy.go:1230` (`caddyRateLimit`) already parses the retry-after and `:1219` (`leRetryAfterRE`) extracts the instant. A drive should persist the last known retry-after per slug and **refuse to rent** — skip, not red — while the wall stands, instead of spending a droplet and 24 minutes rediscovering it. This is the cost control the last two reds at this signature both lacked. 4. **Sequencing note for whoever takes this:** fixing (1) alone makes things worse in the short term — an identifier-aware `Decide` flips the held `rehearsal-d` store to skip, so the next drive orders the **wildcard** fresh too and burns a second identifier set into the same wall. (1) must land with (3). ## Operator unblock for the queue Either wait past 2026-08-30 01:30:07 UTC, or **rotate the slug** — GOTCHAS #32's own Rule (`docs/GOTCHAS.md:859-861`): `REHEARSAL_SLUG` is env-tunable and a `rateLimited` 429 means rotate. `rehearsal-c → rehearsal-d` was rotated this way on 2026-08-28 (`test-results/slug-claims/`, `standing-rented.retired-rehearsal-c-20260828`). A fresh apex has an unwalled identifier set. drive `20260829T131523Z` red at `standing`: `the gateway deploy failed — The gateway deploy failed — Let's Encrypt is rate-limiting new certificates for this domain. [There is no old operating system to roll back to — this server was rente` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260829T131523Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 25304f657c24 -->
Author
Member

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

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

close-report for #988 — status success

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

envelope
{
  "issue": 988,
  "status": "success",
  "commits": [
    "42df7631ee1dc4d76a95e5c8cbb9128d5bf19531"
  ],
  "changed_files": [
    "STATUS.md",
    "cmd/rehearsal-certstore/main.go",
    "cmd/rehearsal-certstore/main_test.go",
    "docs/GOTCHAS.md",
    "internal/certpersist/coverage.go",
    "internal/certpersist/coverage_test.go",
    "scripts/lib/rehearsal-droplet.sh",
    "scripts/tests/helpers/mint-cert-store.sh",
    "scripts/tests/rehearsal-cert-harvest-test.sh",
    "scripts/tests/rehearsal-rented-certs-test.sh"
  ],
  "tests": [
    {
      "command": "go test ./internal/certpersist/... ./cmd/rehearsal-certstore/...",
      "exit_code": 0
    },
    {
      "command": "go build ./... && go vet ./... && go test ./... && golangci-lint run ./...",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-cert-harvest-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-rented-certs-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-cert-wall-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Make completeness identifier-aware, not leaf-count-aware (harvest side)": "certpersist.Complete/Coverage (internal/certpersist/coverage.go) require the slug's full apex+wildcard identifier set; oc_cert_harvest_store gates the swap on `rehearsal-certstore complete <dir> <slug>` (scripts/lib/rehearsal-droplet.sh). Note: the Decide-side identifier-awareness and the pre-flight wall gate (asks 1,3,4) landed with the duplicate #989/commit d6897f9; this ticket closes ask (2). Proven: internal/certpersist/coverage_test.go, cmd/rehearsal-certstore/main_test.go.",
    "Do not harvest mid-obtain; wait for the full set rather than the first *.crt": "oc_cert_harvest_store returns rc 2 (present-but-partial) on a wildcard-only capture and NEVER supersedes the held store; Phase C keeps polling for the apex, narrated once (scripts/lib/rehearsal-droplet.sh). Proven: scripts/tests/rehearsal-cert-harvest-test.sh (wildcard-only refused rc 2 + held store untouched).",
    "The harvest should drop locks/ instead of capturing a live lock file": "oc_cert_harvest_store now runs `find \"$tmp\" -type d -name locks -prune -exec rm -rf {} +` before the completeness check (scripts/lib/rehearsal-droplet.sh). Proven: scripts/tests/rehearsal-cert-harvest-test.sh (asserts no locks/ dir and no *.lock in the swapped-in store).",
    "A partial store must say so loudly and must not print the zero-orders promise": "Phase C and the fallback print an honest PARTIAL narration and NEVER the 'orders zero new certificates' done line unless the full set landed (scripts/lib/rehearsal-droplet.sh). Proven by the harvest test's gate-wiring checks."
  },
  "summary": "The rented cert harvest now captures only a complete apex+wildcard store and drops certmagic's live locks/, closing ask (2) of #988 (the remaining half after the duplicate #989 landed asks 1/3/4).",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #988 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 988, "status": "success", "commits": [ "42df7631ee1dc4d76a95e5c8cbb9128d5bf19531" ], "changed_files": [ "STATUS.md", "cmd/rehearsal-certstore/main.go", "cmd/rehearsal-certstore/main_test.go", "docs/GOTCHAS.md", "internal/certpersist/coverage.go", "internal/certpersist/coverage_test.go", "scripts/lib/rehearsal-droplet.sh", "scripts/tests/helpers/mint-cert-store.sh", "scripts/tests/rehearsal-cert-harvest-test.sh", "scripts/tests/rehearsal-rented-certs-test.sh" ], "tests": [ { "command": "go test ./internal/certpersist/... ./cmd/rehearsal-certstore/...", "exit_code": 0 }, { "command": "go build ./... && go vet ./... && go test ./... && golangci-lint run ./...", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-cert-harvest-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-rented-certs-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-cert-wall-test.sh", "exit_code": 0 } ], "criteria": { "Make completeness identifier-aware, not leaf-count-aware (harvest side)": "certpersist.Complete/Coverage (internal/certpersist/coverage.go) require the slug's full apex+wildcard identifier set; oc_cert_harvest_store gates the swap on `rehearsal-certstore complete <dir> <slug>` (scripts/lib/rehearsal-droplet.sh). Note: the Decide-side identifier-awareness and the pre-flight wall gate (asks 1,3,4) landed with the duplicate #989/commit d6897f9; this ticket closes ask (2). Proven: internal/certpersist/coverage_test.go, cmd/rehearsal-certstore/main_test.go.", "Do not harvest mid-obtain; wait for the full set rather than the first *.crt": "oc_cert_harvest_store returns rc 2 (present-but-partial) on a wildcard-only capture and NEVER supersedes the held store; Phase C keeps polling for the apex, narrated once (scripts/lib/rehearsal-droplet.sh). Proven: scripts/tests/rehearsal-cert-harvest-test.sh (wildcard-only refused rc 2 + held store untouched).", "The harvest should drop locks/ instead of capturing a live lock file": "oc_cert_harvest_store now runs `find \"$tmp\" -type d -name locks -prune -exec rm -rf {} +` before the completeness check (scripts/lib/rehearsal-droplet.sh). Proven: scripts/tests/rehearsal-cert-harvest-test.sh (asserts no locks/ dir and no *.lock in the swapped-in store).", "A partial store must say so loudly and must not print the zero-orders promise": "Phase C and the fallback print an honest PARTIAL narration and NEVER the 'orders zero new certificates' done line unless the full set landed (scripts/lib/rehearsal-droplet.sh). Proven by the harvest test's gate-wiring checks." }, "summary": "The rented cert harvest now captures only a complete apex+wildcard store and drops certmagic's live locks/, closing ask (2) of #988 (the remaining half after the duplicate #989 landed asks 1/3/4).", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
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#988
No description provided.