The console serves nothing, not even the certificate ask, until Temporal and the identity provider are reachable #141
Closed
opened 2026-09-25 08:20:00 +00:00 by cgalo5758
·
3 comments
Labels
Clear labels
accessibility
area/billing
area/catalog
area/discourse
area/domains
area/entitlements
area/fedwiki
area/identity
area/integrations
area/licensing
area/member-ui
area/meta
area/operator-ui
area/ops
area/testing
duplicate
good-first-issue
invalid
privacy
security
upstream
wontfix
A barrier for people using assistive technology or a keyboard alone.
The Stripe mirror, checkout, subscriptions, invoices, fulfillment.
Products, prices, plan ladders, purchasability.
The Discourse integration.
The domains registry, claims, placements, the certificate ask.
Entitlement sets, rules, grants, pools, provisioning.
The Federated Wiki integration and farm sync.
Sign-in, sessions, persons, organizations, workspaces, roles.
The provider registry, outbox and webhooks in general.
Licenses, the contributor agreement, SPDX headers.
Member pages.
The repository itself, its contributing guide, CI, the tracker and the workflow.
Operator pages, forms, lists, the design system.
Deployment, configuration, migrations, workflows, instance settings.
The test stack, screens, lint, walkthroughs.
Closed because another issue already covers it.
Small, self-contained, and explained enough to be a first contribution.
Closed because it is not a ticket for this repository.
Touches what a person's data reveals.
Touches authentication, authorization, secrets or data exposure.
Waits on another repository or project before it can move.
Closed because it will not be done, with the reason in the last comment.
kind
bug
The software does something other than what it promises; closed when it again does what it promises.
kind
debt
Code, tests or tooling to clean up with nothing visible changing; closed when they are cleaner.
kind
design
A question to settle before work can be defined; closed when the decision is written down.
kind
docs
Documentation that is wrong or missing; closed when it says the right thing.
kind
enhancement
Something the software does not do yet; closed when it does.
priority
critical
Blocks the active milestone or harms members now.
priority
high
Next in line inside the active milestone.
priority
low
Inside the active milestone, when nothing else is left.
priority
medium
Inside the active milestone, after the high ones.
Milestone
No items
No Milestone
Public launch
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wiki-cafe/member-console#141
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
At boot the console opens its HTTP port only after two outside services answer. It connects to Temporal, first fetching an OAuth token from the identity provider when Temporal authorization is configured, and it reads the identity provider's discovery document. Until both succeed, no route is served. If Temporal is not reached within the connect budget, the process exits and the orchestrator restarts it into the same wait.
That includes
GET /domains/ask, the endpoint a TLS-terminating proxy calls before it issues or loads an on-demand certificate (the certificate ask). The ask needs only the database.When the identity provider's host is itself issued on demand by the same proxy, a proxy restart with an empty certificate cache deadlocks. The proxy will not present a certificate for the identity provider until the ask answers, and the console will not answer the ask until it has reached the identity provider through that proxy. Every on-demand host stays without TLS until an operator points the proxy's ask somewhere else.
What should happen
Routes whose only dependency is the database,
/domains/askfirst among them, are served as soon as migrations have run, whatever the state of Temporal and the identity provider. Routes that need either answer 503 until it is reachable, and the console keeps retrying in the background instead of exiting.Where
cmd/start.go(the Temporal connection beforeserver.Start),internal/auth/auth.go(oidc.NewProvider, called fromserver.Startbefore the listener opens),internal/server/domains.goSteps
/domains/ask, with the identity provider's host issued on demand.Temporal not ready yet, retryinguntil it exits, and restarts into the same state.Why it matters
A routine host restart can take every on-demand site offline, and the console, which exists to authorize those certificates, is what keeps them offline. Until this is fixed, a deployment avoids it by giving the identity provider's host an ordinary managed certificate, which the proxy loads at startup without asking.
The fix has to move one more thing off the Temporal path: the Stripe library's API key.
The key is set only in the Stripe integration's startup hook (
internal/integrations/stripe/stripe.go:212-214).cmd/start.goruns that hook inside the Temporal block (lines 259 and 313-317), before the server starts (line 482), so today the key is always set before the first request. Once the server starts ahead of the Temporal connection, requests arrive before the hook runs. Until Temporal answers:SDKKeyMode,stripe.go:298-300), which is empty. Every other page reads the environment boot derives from the configured key (cmd/start.go:126). The two disagree about which Stripe records are reachable.Setting the key at boot, beside the line that derives its environment, closes both. Checkout and the plan moves can then read the boot environment like every other page, and
SDKKeyModecan go.The same gap exists today in one configuration: a Stripe key with no Temporal host. The library never gets its key, and webhooks are stored but never processed. If that is not a configuration the console supports, boot can refuse it, as it refuses a key with an unknown prefix.
A host reboot hit this again: every on-demand host was without TLS until the proxy's ask was pointed elsewhere.
This time the loop also ran through the Temporal token.
temporal-oauth-token-urlnamed the identity provider's public host, so fetching the token went through the proxy whose ask was waiting on the console. Pointing the token URL at the identity provider's internal address takes the Temporal connect off the proxy, but it does not break the loop: before the listener opens,server.Startalso fetches the discovery document fromoidc-idp-issuer-url(internal/auth/auth.go:199), which has to be the public name the issuer matches. Until the fix here lands, the mitigation in the description, an ordinary managed certificate for the identity provider's host, is the one that holds.Temporal's own fetch of the identity provider's signing keys also goes through the proxy when Temporal is not on the identity provider's network. Once the console answers the ask without waiting on Temporal, that fetch recovers as soon as the proxy issues the certificate, and it needs no change here.
Fixed by
29520a81,6b57598d,d1151dd6,ed613ef9,3bfd0f67,bfc24e2c,2d71aa8dand67e69eed.The console now opens its port as soon as its database steps have run, and from then on it answers the certificate ask whatever Temporal, the identity provider and the session store are doing.
Retry-Afteruntil the identity provider publishes a usable discovery document. A loop in the background fetches the document, and sign-in starts working without a restart.temporal-connect-timeoutnow sets when the retry log turns from Warn to Error.temporal-hostno longer starts: settemporal-host, or leave the integration's keys empty.startexits non-zero when it cannot serve.Nobody is told yet when the console serves without one of these services; that is #253.