Skip to content

fix(oidc): start without the OIDC provider and retry discovery - #1866

Open
stalingino wants to merge 2 commits into
parseablehq:mainfrom
stalingino:fix/oidc-discovery-retry
Open

stalingino wants to merge 2 commits into
parseablehq:mainfrom
stalingino:fix/oidc-discovery-retry

Conversation

@stalingino

@stalingino stalingino commented Nov 19, 2026 •

Copy link
Copy Markdown

Fixes #1863.

Description

ParseableServer::start awaited OIDC discovery with ?, so an unreachable provider at startup made Parseable exit. Starting Parseable before its provider, or a provider outage, kept Parseable down entirely, including ingestion and basic-auth logins that don't need OIDC.

Now:

  • a failed discovery at startup is logged, and Parseable starts;
  • a background task retries discovery with capped exponential backoff (1s, doubling, max 60s) and installs the client as soon as the provider answers, with no restart;
  • while discovery is pending, /api/v1/o/login returns 503 with a clear message instead of redirecting as if OIDC were not configured (new OIDCError::ProviderUnavailable, tracked by an OIDC_PENDING flag).

Testing

Ran the patched binary (local-store) with P_OIDC_ISSUER pointing at a port with nothing listening:

  • process stays up; /api/v1/liveness 200; basic-auth API 200;
  • /api/v1/o/login → 503 The OIDC provider is not reachable yet; try again shortly;
  • started Dex on that port: about 7s later the log shows OIDC provider discovered; OIDC login is enabled, and /api/v1/o/login now returns 307 to Dex's /auth.

Also in a docker compose stack (Parseable + Dex): restarted Parseable with Dex stopped → it stayed up (no crash loop), API 200, login 503; started Dex → login redirected to Dex without restarting Parseable.

cargo clippy --lib -- -D warnings and cargo fmt --check are clean.


This PR has:

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Parseable can start when OIDC discovery fails and enable OIDC login once the provider recovers.

  • Parseable keeps starting and retries OIDC discovery in the background.
  • OIDC login gives a retry response while provider discovery is pending.

No new actionable issues found.

Reviews (7) · Last reviewed commit: "fix(oidc): read the pending flag before ..." · Reviewed by Greptile

ParseableServer::start awaited OIDC discovery with `?`, so an unreachable
identity provider at startup made Parseable exit. Starting Parseable before
its provider (common with docker compose and Kubernetes) or a provider outage
kept Parseable down entirely, including ingestion and basic-auth logins that
do not need OIDC, and crash-looped it under a restart policy.

A failed discovery is now logged and retried in the background with capped
exponential backoff (1s doubling to 60s). Everything except OIDC login works
meanwhile. Login answers 503 with a clear message while discovery is pending,
instead of redirecting as if OIDC were not configured, and starts working as
soon as the provider answers, with no restart.
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

Comment thread src/handlers/http/oidc.rs Resolved
The retry task installs the client before clearing OIDC_PENDING. Reading the
flag first means a login racing with recovery sees either the installed client
or "pending", never a false "OIDC not configured" redirect.
@stalingino

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parseable exits at startup when the OIDC provider is unreachable

1 participant