litellm - 💡(How to fix) Fix [Bug]: Multiple db exception errors

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

  1. PrismaWrapper._safe_refresh_token holds self._reconnection_lock (litellm/proxy/db/prisma_client.py:443) and calls recreate_prisma_client (prisma_client.py:446), which SIGTERMs the running engine via _kill_engine_process (prisma_client.py:152) and spawns a new engine.
  2. PrismaClient (litellm/proxy/utils.py) starts an engine death watcher (_start_engine_watcher, line 4431) — typically the waitpid thread path — that on death calls attempt_db_reconnect(reason="engine_process_death", force=True) (utils.py:4324). This acquires a different lock (self._db_reconnect_lock, line 2865) and calls recreate_prisma_client AGAIN (utils.py:4523), killing the engine that the IAM refresh just spawned. In addition, in-flight DB calls during the brief restart window fail with httpx.ConnectError / httpx.ReadError, are classified by PrismaDBExceptionHandler.is_database_transport_error as transport failures, and trigger their own attempt_db_reconnect via call_with_db_reconnect_retry (litellm/proxy/db/exception_handler.py:242). Each successful retry also reenters recreate_prisma_client.

Steps to Reproduce

  1. Setup IAM refresh connection for RDS

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.86.2

Twitter / LinkedIn details

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING