Skip to content

orb_broker_unavailable: /v1/orb/token mints on every call (no cache) → GitHub throttles to 16-20s → reviews blocked #1633

Description

@JSONbored

Problem

The brokered token endpoint POST /v1/orb/token (brokerOrbToken) mints a fresh GitHub installation token on every call — no server-side cache. GitHub installation tokens are valid ~1h, so minting that often throttles GitHub's token-creation endpoint. Measured live from the VPS: /v1/orb/token takes 16-20s (3rd sequential mint timed out), while /health is 0.57s and the secret/relay are valid.

The engine aborts the broker call at 10s (BROKER_TIMEOUT_MS), so it can never complete a throttled mint → orb_broker_degraded_serving_cached_token (cache hit) or, once the cache lapses (container restart), orb_broker_unavailable — which blocks reviews. A vicious cycle: each timeout → retry → another mint → harder throttle.

Fix

  1. Server-side token cache on the enrollment row (cached_token_json, encrypted at rest), so GitHub is minted at most once per install per ~hour and the cache survives engine restarts.
  2. Timeout headroom so the one cold transition mint completes and populates the cache.

Fixed in the linked PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions