forge: cold-boot fix — materializer defers, openbao-secrets-ready waits #130
No reviewers
Labels
No labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
key-store/key.store!130
Loading…
Reference in a new issue
No description provided.
Delete branch "forge/materializer-cold-boot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Cold-boot race seen on 3 reboots: materializer no longer fails when OpenBao is unreachable; new openbao-secrets-ready unit (after openbao) retries until all entries exist; OpenBao-only consumers ordered after it. Dry-activate green.
Three reboots on 2026-08-17 reproduced the same failure: Caddy waits for the materializer (transitional entries), OpenBao needs Authentik behind Caddy, and OpenBao-only entries have no file on a fresh /run — so the materializer's first pass timed out, exited 1 with 66 entries missing, and every renderer ordered after it (fleet-env, grafana-env, office-config, zulip-secrets, posthog-env, skynet-credentials, codex-login, redis-fleet, redmine, fleet-mysql-prepare) started and failed until restarted by hand. Split: the materializer installs fallbacks + fetches best-effort and exits 0 while OpenBao is unreachable ("deferred"; health wait 20 s instead of 60 s — on a cold boot OpenBao cannot be healthy before Caddy anyway); a new openbao-secrets-ready.service, ordered after openbao.service, re-runs the fetch every 10 s until every declared entry exists (readyTimeout, default 20min, then it gives up loudly). Consumers of at least one OpenBao-only entry are ordered after the ready unit; fallback consumers (Caddy, Authentik runtime, ...) only after the materializer. HQ (all fallback) is unaffected apart from the extra unit, which returns immediately. Verified: forge dry-activate green; closure ordering inspected (caddy- security-env → materializer only; fleet-env/grafana-env/zulip-secrets/ redmine → materializer + ready). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>