Incident Library
  • Root cause
  • Component
  • Symptom
  • Contributing factor
  • Case

Cases3 cases

1 to 3 of 3

  1. Symptoms

    At 15:57 UTC on 10 March 2026, Clerk's alerting reported increased latency and elevated 5xx errors across its APIs, and the incident was declared. Monitoring showed increased lock contention in the database, which had started about a minute earlier.

    Trigger

    A routine live migration of the Google Cloud SQL virtual machine that hosts Clerk's Postgres database, done without advance notice to Clerk, did not work as intended.

    Root cause
    Component
    Contributing factor
    Detection

    Alerting reported increased latency and elevated 5xx errors across the APIs at 15:57 UTC, and monitoring showed lock contention in the database that had begun about a minute earlier.

    Remediation
    • Enabled Origin Outage Mode to keep session management working
    • Opened a ticket with GCP after seeing elevated IO wait on reads
    • Disabled Origin Outage Mode after the live migration completed and the system stabilised
    Action items
    • Ask Google to pin the database again to stop further live migrations
    • Use replica promotion instead of live migrations for all Postgres database maintenance
    • Move to another database provider or run Postgres in-house unless Google offers a way to disable live migrations permanently
    • Return 500 instead of the internal service's 429 so applications can tell the state of Clerk's systems from the error code
    • Shift most of the engineering team to reliability-focused projects
    Lessons

    Clerk concludes that Cloud SQL live migrations are still unsafe after months of joint work with Google, and that they are opaque, leaving Clerk to trust Google's word. Clerk prefers traditional replica promotion for all Postgres maintenance, an automated process it had already used without incident for a Postgres major version upgrade on January 17, 2026.

  2. Symptoms

    At 8:11 AM PST (16:11 UTC) on 19 February 2026, Clerk's database performance dropped at once. Slow database queries made request handlers queue, and over 95% of traffic was answered with 429 without being handled; the small share of requests that reached the database returned 200, but extremely slowly.

    Trigger

    A routine automatic ANALYZE on one table sampled only NULL values in a column, and the Postgres planner switched a frequently run query to an inefficient plan.

    Root cause
    Component
    Contributing factor
    Detection

    The incident was reported and escalated internally at 16:15 UTC, and the team started a group call.

    Remediation
    • Enabled a new failover that generates session tokens outside the core Session API
    • Re-ran ANALYZE manually on the affected table, which put the query back on its earlier plan
    • Disabled the failover once the database was back to healthy levels
    • Increased the statistics target on the table so the planner samples more rows
    • Refactored the query so the planner could plan it deterministically
    Action items
    • Add dedicated alerting for database query plan flips
    • Train the reliability team to enable the new session token failover and add automatic triggers for it
    • Audit all queries for others at risk of inefficient plans from unstable statistics
    • Name a dedicated communications lead during incidents
    • Post status page updates at a regular cadence even when nothing has changed
    • Make status page severity labels match the impact on customers
    • Cross-post incident updates to social channels
    Lessons

    Clerk says a query plan flip can cause sudden, severe degradation and needs to be detected directly instead of through downstream symptoms; relying on those symptoms led the team to blame a customer's traffic pattern. Customers also told Clerk that status page updates came too rarely, the first update came too late and the initial severity label did not match the impact.

  3. Symptoms

    At 13:08 UTC on 15 September 2025, Clerk's internal monitoring alerted on significant request failures and increased latency. Over the following days the request failures and latency spikes kept coming back while the Postgres database stayed unhealthy, with repeated spikes in database load.

    Trigger

    At 05:30 UTC on 14 September 2025 the cloud provider automatically upgraded Clerk's Postgres database to a new minor version, which changed how Postgres handled connection locks.

    Root cause
    Component
    Contributing factor
    Detection

    Internal monitoring alerted on significant request failures and increased latency at 13:08 UTC on 15 September. Shortly after the upgrade on 14 September it had already shown an increased but still acceptable database load.

    Remediation
    • Optimised several expensive queries, refined critical indexes and re-indexed the database
    • Blocked abusive traffic more aggressively for a time
    • Performed a manual minor version upgrade and increased database capacity
    • Added jitter to the connection pooling configuration so connections no longer recycled in step
    Action items
    • Evaluate other database providers that give more control over upgrades and downgrades
    • Isolate more services from each other, for example Sign Up and Sign In infrastructure from the rest of the system
    • Keep optimising the most costly database queries
    • Evaluate sharding and multi-tenant infrastructure to isolate one application from others
    Lessons

    Clerk's review found that connection metrics sampled every 60 seconds could not show a recycling pattern that lasted seconds and repeated every 15 minutes, that an attack and background jobs with similar periods pulled attention away from the database layer, that the Backend API looked healthy only because it manages far fewer connections, and that the release freeze removed the staggering of connection creation that normal deploys provide.

Check your cluster for this

These 3 cases involve Database and Database proxy and connection pooler. kubegap audits a Kubernetes cluster for gaps like these, read-only, from Claude Code or Codex; its checks cite public reports like the ones in this library.

By root cause3