own-VPS gateway never carries OURCLOUD_CLAIM_SECRET — acme-dns challenge CNAME never publishes, DNS-01 times out forever (finish, sig 8d0cd71d20a2) #505

Closed
opened 2026-08-13 04:44:11 +00:00 by ben · 4 comments
Owner

Failure

Drive 20260813T041900Z reds at finish with the S11 deploy-failed screen ("There is no old operating system to roll back to"), same UI-level signature 8d0cd71d20a2 as drive 20260813T035722Z — but the underlying defect is now different from the one healed in 1592d04 (the {env.VAR}→{$VAR} acme-dns substitution bug). That fix is confirmed working this run: acme-dns-register completes and Caddy starts cleanly.

The new failure: Caddy's DNS-01 wildcard obtain times out waiting for the challenge record to propagate, and retries forever (max_duration: 2592000):

test-results/drive-droplet/20260813T041900Z/logs/droplet-journal.txt:1615
caddy: could not get certificate from issuer ... "[*.rehearsal.idss.nz] solving challenges: waiting for solver certmagic.solverWrapper to be ready: timed out waiting for record to fully propagate; verify DNS provider configuration is correct"

The app's own 10-minute cold-start budget (120 probes × 5s, internal/founding/deploy.go:786) expires, public-entry never rests done, and the deploy-outcome screen renders the generic "no rollback" fault (founding-state.log:632-655).

Root cause

The _acme-challenge.rehearsal.idss.nz CNAME that the broker needs to delegate to acme-dns's fresh per-boot fulldomain is never published, so there is nothing for public resolvers to ever see — this is not a slow-propagation flake, it's a permanently-missing record.

Trace:

  1. The own-VPS journey points the community name before install, with an intentionally empty acme challenge — internal/founding/ownvpspath.go:442-447, comment: "the gateway's heartbeat re-points with the challenge once it is up (ADR 0136)".
  2. But the address heartbeat never runs a real re-point this drive: droplet-journal.txt:1471 — "address heartbeat resting: no OURCLOUD_CLAIM_SECRET — the broker refuses a re-point without the claim secret (ADR 0135)".
  3. OURCLOUD_CLAIM_SECRET is only exported into the gateway's environment when clan.GatewayFacts.ClaimSecret is true (internal/clan/vmguest.go:995-997, gated the same way as SMTPSubmission).
  4. The own-VPS gateway's GatewayFacts literal — internal/founding/ownvpspath.go:488-507 — never sets ClaimSecret: true. Grepping the whole tree (grep -rn "ClaimSecret" --include="*.go"), no production code path anywhere sets it true — only internal/clan/vmguest_test.go:228 does, in a unit test. The private path (internal/founding/privatepath.go:883-903) correctly leaves it false (its .internal apex is architecturally outside the heartbeat's loop, ADR 0136) — but the own-VPS path, which DOES need it, leaves it false too, seemingly by omission.

So for every own-VPS (and likely rented) community on the <slug>.idss.nz subdomain-broker path, the acme-dns DNS-01 challenge delegation can never be published post-boot, and wildcard cert issuance can never succeed — Caddy retries silently forever with no external signal beyond its own log.

What plugging it needs

At minimum, internal/founding/ownvpspath.go's installOwnVPS needs to set ClaimSecret: true on the clan.GatewayFacts it builds, gated the same way pointOwnVPSName already gates on d.Address.Kind == AddressSubdomain (ownvpspath.go:436) — own-domain communities have no claim secret to carry and the heartbeat already rests for them independently (control-plane/cmd/control-plane/main.go:488-491).

But flipping the bool alone is likely not sufficient: gatewayEnvExports (internal/clan/vmguest.go:985-988) says the claim secret "dereferences its sealed clan-var .path (the mail.go DKIM pattern) — never a literal: the values are secrets the seed leg fed", the same way SMTPSubmission's credentials are seeded. Need to confirm whether o.seedCommunityConfig (ownvpspath.go:341) already seeds the ClaimSecretGenerator (internal/clan/vmguest.go:83) with d.Address.Secret's value, or whether that generator-feed is also missing — if so this is two wiring gaps, not one.

Suggested plugging work:

  • Confirm/build the seed-leg feed of ClaimSecretGenerator from d.Address.Secret (mirror the SMTP submission credential pattern in the same seed leg).
  • Set ClaimSecret: true in ownvpspath.go's GatewayFacts construction when d.Address.Kind == AddressSubdomain.
  • Add/extend a seam test (internal/founding/ownvpspath_test.go or internal/clan/gateway_attach_test.go) proving an own-VPS subdomain deploy exports OURCLOUD_CLAIM_SECRET and a live-drive proving the heartbeat's first tick actually re-points with a non-empty acme-dns challenge even when the observed IP matches the seeded OURCLOUD_GATEWAY_IP (worth double-checking internal/heartbeat/heartbeat.go's WithKnownIP-seeded first-tick no-op doesn't ALSO suppress the challenge-only-changed case once the secret is wired — TestTick_UnchangedAddressIsSilentNoOp currently locks in IP-only comparison).
  • Check whether the rented-VPS path (standuprented.go) has the same gap.

This is secret-provisioning + DNS wiring across founding/clan/control-plane — outside what the rehearsal healer self-fixes.

drive 20260813T041900Z 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/…/20260813T041900Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)

## Failure Drive `20260813T041900Z` reds at `finish` with the S11 deploy-failed screen ("There is no old operating system to roll back to"), same UI-level signature `8d0cd71d20a2` as drive `20260813T035722Z` — but the underlying defect is now **different** from the one healed in `1592d04` (the `{env.VAR}`→`{$VAR}` acme-dns substitution bug). That fix is confirmed working this run: `acme-dns-register` completes and Caddy starts cleanly. The new failure: Caddy's DNS-01 wildcard obtain times out waiting for the challenge record to propagate, and retries forever (`max_duration: 2592000`): ``` test-results/drive-droplet/20260813T041900Z/logs/droplet-journal.txt:1615 caddy: could not get certificate from issuer ... "[*.rehearsal.idss.nz] solving challenges: waiting for solver certmagic.solverWrapper to be ready: timed out waiting for record to fully propagate; verify DNS provider configuration is correct" ``` The app's own 10-minute cold-start budget (120 probes × 5s, `internal/founding/deploy.go:786`) expires, `public-entry` never rests done, and the deploy-outcome screen renders the generic "no rollback" fault (`founding-state.log:632-655`). ## Root cause The `_acme-challenge.rehearsal.idss.nz` CNAME that the broker needs to delegate to acme-dns's fresh per-boot `fulldomain` is **never published**, so there is nothing for public resolvers to ever see — this is not a slow-propagation flake, it's a permanently-missing record. Trace: 1. The own-VPS journey points the community name **before install**, with an intentionally empty acme challenge — `internal/founding/ownvpspath.go:442-447`, comment: "the gateway's heartbeat re-points with the challenge once it is up (ADR 0136)". 2. But the address heartbeat never runs a real re-point this drive: `droplet-journal.txt:1471` — `"address heartbeat resting: no OURCLOUD_CLAIM_SECRET — the broker refuses a re-point without the claim secret (ADR 0135)"`. 3. `OURCLOUD_CLAIM_SECRET` is only exported into the gateway's environment when `clan.GatewayFacts.ClaimSecret` is `true` (`internal/clan/vmguest.go:995-997`, gated the same way as `SMTPSubmission`). 4. The own-VPS gateway's `GatewayFacts` literal — `internal/founding/ownvpspath.go:488-507` — never sets `ClaimSecret: true`. Grepping the whole tree (`grep -rn "ClaimSecret" --include="*.go"`), **no production code path anywhere sets it true** — only `internal/clan/vmguest_test.go:228` does, in a unit test. The private path (`internal/founding/privatepath.go:883-903`) correctly leaves it false (its `.internal` apex is architecturally outside the heartbeat's loop, ADR 0136) — but the own-VPS path, which DOES need it, leaves it false too, seemingly by omission. So for every own-VPS (and likely rented) community on the `<slug>.idss.nz` subdomain-broker path, the acme-dns DNS-01 challenge delegation can never be published post-boot, and wildcard cert issuance can never succeed — Caddy retries silently forever with no external signal beyond its own log. ## What plugging it needs At minimum, `internal/founding/ownvpspath.go`'s `installOwnVPS` needs to set `ClaimSecret: true` on the `clan.GatewayFacts` it builds, gated the same way `pointOwnVPSName` already gates on `d.Address.Kind == AddressSubdomain` (`ownvpspath.go:436`) — own-domain communities have no claim secret to carry and the heartbeat already rests for them independently (`control-plane/cmd/control-plane/main.go:488-491`). But flipping the bool alone is likely not sufficient: `gatewayEnvExports` (`internal/clan/vmguest.go:985-988`) says the claim secret "dereferences its sealed clan-var .path (the mail.go DKIM pattern) — never a literal: the values are secrets the seed leg fed", the same way `SMTPSubmission`'s credentials are seeded. Need to confirm whether `o.seedCommunityConfig` (`ownvpspath.go:341`) already seeds the `ClaimSecretGenerator` (`internal/clan/vmguest.go:83`) with `d.Address.Secret`'s value, or whether that generator-feed is *also* missing — if so this is two wiring gaps, not one. Suggested plugging work: - Confirm/build the seed-leg feed of `ClaimSecretGenerator` from `d.Address.Secret` (mirror the SMTP submission credential pattern in the same seed leg). - Set `ClaimSecret: true` in `ownvpspath.go`'s `GatewayFacts` construction when `d.Address.Kind == AddressSubdomain`. - Add/extend a seam test (`internal/founding/ownvpspath_test.go` or `internal/clan/gateway_attach_test.go`) proving an own-VPS subdomain deploy exports `OURCLOUD_CLAIM_SECRET` and a live-drive proving the heartbeat's first tick actually re-points with a non-empty acme-dns challenge even when the observed IP matches the seeded `OURCLOUD_GATEWAY_IP` (worth double-checking `internal/heartbeat/heartbeat.go`'s `WithKnownIP`-seeded first-tick no-op doesn't ALSO suppress the challenge-only-changed case once the secret is wired — `TestTick_UnchangedAddressIsSilentNoOp` currently locks in IP-only comparison). - Check whether the rented-VPS path (`standuprented.go`) has the same gap. This is secret-provisioning + DNS wiring across founding/clan/control-plane — outside what the rehearsal healer self-fixes. drive `20260813T041900Z` 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/…/20260813T041900Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) <!-- rehearsal-sig: 8d0cd71d20a2 -->
Author
Owner

Ben's ruling (2026-08-13, live): YES — the box holds the key

The gateway carries the claim secret, per the original ADR 0135/0136 intent: renewal is forever (~60-day cycles), acme-dns's fulldomain changes per boot, and the founder's laptop cannot be the renewal path — so the box must be able to authenticate its own re-points. The box already holds the community's whole life (kanidm DB, files); the name's key is not a meaningful widening. A NARROWER broker credential (signpost-only, cannot re-point/offboard the name itself) was noted as a possible hardening follow-up — explicitly NOT this fix, and not yet ticketed.

Fix direction (swarm-landable; next drive verifies)

  1. The fact: own-VPS GatewayFacts sets ClaimSecret: true (internal/founding/ownvpspath.go — the literal this ticket's trace found never sets it). The private path stays false (its .internal apex is outside the heartbeat loop by design, ADR 0136).
  2. The value: founding holds the claim secret from the S5 broker claim — seed it into the ourcloud-claim-secret clan var (clan.ClaimSecretGenerator, vmguest.go:83) during the own-VPS seed leg, the same sops-encrypted vars pattern every other seeded secret rides. Today NOTHING writes that generator's value (grep confirms: the name + the gated export exist; the value pipeline does not).
  3. The export: varSecretExport("OURCLOUD_CLAIM_SECRET", ClaimSecretGenerator) is already gated on the fact (vmguest.go:995) — mind the DUAL-RENDER hazard (GOTCHAS: whatever is declared in renderGatewayGuest must exist in the full-install front-door render too, and vice versa): the own-VPS box runs the FULL-INSTALL render, so make sure the fact-gated export exists there, with a seam test pinning it in BOTH renders.

AC: on a fresh own-VPS drive, the journal no longer shows address heartbeat resting: no OURCLOUD_CLAIM_SECRET; the heartbeat re-point publishes _acme-challenge.<apex> at the broker; Caddy's DNS-01 wildcard obtain succeeds; the #499 door probe rests public-entry done. Seam/unit tests pin the fact, the var seed, and the export; the #420 golden-render lint stays green (the secret's VALUE never appears in the config repo — only the sops var reference).

## Ben's ruling (2026-08-13, live): YES — the box holds the key The gateway carries the claim secret, per the original ADR 0135/0136 intent: renewal is forever (~60-day cycles), acme-dns's fulldomain changes per boot, and the founder's laptop cannot be the renewal path — so the box must be able to authenticate its own re-points. The box already holds the community's whole life (kanidm DB, files); the name's key is not a meaningful widening. A NARROWER broker credential (signpost-only, cannot re-point/offboard the name itself) was noted as a possible hardening follow-up — explicitly NOT this fix, and not yet ticketed. ## Fix direction (swarm-landable; next drive verifies) 1. **The fact:** own-VPS `GatewayFacts` sets `ClaimSecret: true` (`internal/founding/ownvpspath.go` — the literal this ticket's trace found never sets it). The private path stays `false` (its `.internal` apex is outside the heartbeat loop by design, ADR 0136). 2. **The value:** founding holds the claim secret from the S5 broker claim — seed it into the `ourcloud-claim-secret` clan var (`clan.ClaimSecretGenerator`, vmguest.go:83) during the own-VPS seed leg, the same sops-encrypted vars pattern every other seeded secret rides. Today NOTHING writes that generator's value (grep confirms: the name + the gated export exist; the value pipeline does not). 3. **The export:** `varSecretExport("OURCLOUD_CLAIM_SECRET", ClaimSecretGenerator)` is already gated on the fact (vmguest.go:995) — mind the DUAL-RENDER hazard (GOTCHAS: whatever is declared in `renderGatewayGuest` must exist in the full-install front-door render too, and vice versa): the own-VPS box runs the FULL-INSTALL render, so make sure the fact-gated export exists there, with a seam test pinning it in BOTH renders. **AC:** on a fresh own-VPS drive, the journal no longer shows `address heartbeat resting: no OURCLOUD_CLAIM_SECRET`; the heartbeat re-point publishes `_acme-challenge.<apex>` at the broker; Caddy's DNS-01 wildcard obtain succeeds; the #499 door probe rests `public-entry` done. Seam/unit tests pin the fact, the var seed, and the export; the #420 golden-render lint stays green (the secret's VALUE never appears in the config repo — only the sops var reference).
Author
Owner

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

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

CORRECTION to the ruling comment (worker: read before landing): the direction said the SMTP seed-leg feed is the pattern to copy — that pattern is DESIGN-INTENT ONLY, not landed code (verified with a peer session: SMTPSubmission is set true nowhere, the ourcloud-smtp-* generators are never declared or fed; clan.go:378 is a doc comment describing a future). You are building the FIRST app-held-secret→clan-var feed. The real primitives to build from: SetVarSpec (internal/clan/config.go:163 — used live by placeCrownJewels, internal/founding/seed.go:342) to declare the var + recipients on the gateway node, and the pinned CLI wrapper's headless vars set <node> <generator>/<prompt> stdin-as-data path (internal/clan/vars.go:60-64, persist=true constraint noted there) to land the value. Everything else in the ruling stands unchanged (fact flip, both-renders export, AC). Your helper becomes the pattern the future SMTP feed (#386's split-off) will copy — keep it generic enough to name that.

CORRECTION to the ruling comment (worker: read before landing): the direction said the SMTP seed-leg feed is the pattern to copy — that pattern is DESIGN-INTENT ONLY, not landed code (verified with a peer session: SMTPSubmission is set true nowhere, the ourcloud-smtp-* generators are never declared or fed; clan.go:378 is a doc comment describing a future). You are building the FIRST app-held-secret→clan-var feed. The real primitives to build from: SetVarSpec (internal/clan/config.go:163 — used live by placeCrownJewels, internal/founding/seed.go:342) to declare the var + recipients on the gateway node, and the pinned CLI wrapper's headless `vars set <node> <generator>/<prompt>` stdin-as-data path (internal/clan/vars.go:60-64, persist=true constraint noted there) to land the value. Everything else in the ruling stands unchanged (fact flip, both-renders export, AC). Your helper becomes the pattern the future SMTP feed (#386's split-off) will copy — keep it generic enough to name that.
Author
Owner

close-report for #505 — status success

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

envelope
{
  "issue": 505,
  "status": "success",
  "commits": [
    "782ecbb"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "internal/clan/enrollment.go",
    "internal/clan/enrollment_test.go",
    "internal/clan/vmguest.go",
    "internal/clan/vmguest_test.go",
    "internal/founding/ownvpspath.go",
    "internal/founding/ownvpspath_internal_test.go",
    "internal/founding/ownvpspath_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/... ./internal/founding/... ./control-plane/cmd/control-plane/... ./internal/heartbeat/...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/... ./internal/founding/... ./control-plane/cmd/control-plane/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "journal no longer shows 'address heartbeat resting: no OURCLOUD_CLAIM_SECRET'": "installOwnVPS sets GatewayFacts.ClaimSecret=true for a subdomain draft (internal/founding/ownvpspath.go), so gatewayEnvExports emits OURCLOUD_CLAIM_SECRET in the control-plane unit — pinned by TestGatewayRenders_ClaimSecretGeneratorRidesBothRenders and the own-VPS journey enroll-request assertion (Gateway.ClaimSecret true) in ownvpspath_test.go",
    "the heartbeat re-point publishes _acme-challenge.<apex> at the broker": "with OURCLOUD_CLAIM_SECRET present the heartbeat wires (productionAddressHeartbeat) rather than rests; OURCLOUD_GATEWAY_IP is not exported so no WithKnownIP seed → lastIP empty each boot → first Tick always Repoints, publishing the acme-challenge (readAcmeChallenge); reasoned in GOTCHAS #27, heartbeat tests green",
    "Caddy's DNS-01 wildcard obtain succeeds / #499 door probe rests public-entry done": "next own-VPS drive verifies live (Ben's ruling: swarm-landable, next drive verifies); config now declares+exports+feeds the claim secret so the re-point can publish the real per-boot challenge",
    "seam/unit tests pin the fact, the var seed, and the export": "TestGatewayRenders_ClaimSecretGeneratorRidesBothRenders + …NoClaimSecretDeclaresNoGenerator (declaration+export, both renders); TestEnroll_FeedsKnownAnswerBeforeGenerate (the value seed via vars set before generate); TestClaimSecretAnswers + own-VPS journey enroll-request assertions (the fact + fed value)",
    "#420 golden-render lint stays green (the secret VALUE never in the config repo)": "the value is stdin-fed via `vars set` (Invocation.Stdin, never argv); the render carries only the sops var reference; TestEnroll_FeedsKnownAnswerBeforeGenerate asserts the secret never appears in an argv nor the persisted snapshot; internal/clan secretlint tests pass"
  },
  "summary": "Wired the own-VPS gateway's S5 claim secret as a fact+declaration+value so the address heartbeat can re-point <slug>.idss.nz with its per-boot acme-dns challenge, unblocking DNS-01 wildcard issuance (#505).",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #505 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 505, "status": "success", "commits": [ "782ecbb" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "internal/clan/enrollment.go", "internal/clan/enrollment_test.go", "internal/clan/vmguest.go", "internal/clan/vmguest_test.go", "internal/founding/ownvpspath.go", "internal/founding/ownvpspath_internal_test.go", "internal/founding/ownvpspath_test.go" ], "tests": [ { "command": "go test ./internal/clan/... ./internal/founding/... ./control-plane/cmd/control-plane/... ./internal/heartbeat/...", "exit_code": 0 }, { "command": "go vet ./internal/clan/... ./internal/founding/... ./control-plane/cmd/control-plane/...", "exit_code": 0 } ], "criteria": { "journal no longer shows 'address heartbeat resting: no OURCLOUD_CLAIM_SECRET'": "installOwnVPS sets GatewayFacts.ClaimSecret=true for a subdomain draft (internal/founding/ownvpspath.go), so gatewayEnvExports emits OURCLOUD_CLAIM_SECRET in the control-plane unit — pinned by TestGatewayRenders_ClaimSecretGeneratorRidesBothRenders and the own-VPS journey enroll-request assertion (Gateway.ClaimSecret true) in ownvpspath_test.go", "the heartbeat re-point publishes _acme-challenge.<apex> at the broker": "with OURCLOUD_CLAIM_SECRET present the heartbeat wires (productionAddressHeartbeat) rather than rests; OURCLOUD_GATEWAY_IP is not exported so no WithKnownIP seed → lastIP empty each boot → first Tick always Repoints, publishing the acme-challenge (readAcmeChallenge); reasoned in GOTCHAS #27, heartbeat tests green", "Caddy's DNS-01 wildcard obtain succeeds / #499 door probe rests public-entry done": "next own-VPS drive verifies live (Ben's ruling: swarm-landable, next drive verifies); config now declares+exports+feeds the claim secret so the re-point can publish the real per-boot challenge", "seam/unit tests pin the fact, the var seed, and the export": "TestGatewayRenders_ClaimSecretGeneratorRidesBothRenders + …NoClaimSecretDeclaresNoGenerator (declaration+export, both renders); TestEnroll_FeedsKnownAnswerBeforeGenerate (the value seed via vars set before generate); TestClaimSecretAnswers + own-VPS journey enroll-request assertions (the fact + fed value)", "#420 golden-render lint stays green (the secret VALUE never in the config repo)": "the value is stdin-fed via `vars set` (Invocation.Stdin, never argv); the render carries only the sops var reference; TestEnroll_FeedsKnownAnswerBeforeGenerate asserts the secret never appears in an argv nor the persisted snapshot; internal/clan secretlint tests pass" }, "summary": "Wired the own-VPS gateway's S5 claim secret as a fact+declaration+value so the address heartbeat can re-point <slug>.idss.nz with its per-boot acme-dns challenge, unblocking DNS-01 wildcard issuance (#505).", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
ben closed this issue 2026-08-14 03:40:54 +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#505
No description provided.