litellm - 💡(How to fix) Fix [Bug]: Prisma query engine crashes immediately on first query on Windows (pip install) - LiteLLM 1.82.x / 1.83.0 [1 participants]

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…
GitHub stats
BerriAI/litellm#25260Fetched 2026-04-08 03:02:26
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Error Message

LiteLLM Proxy:ERROR: proxy_server.py - litellm.proxy_server.py::add_deployment() - Error getting new models from DB - LiteLLM Proxy:ERROR: utils.py - LiteLLM Prisma Client Exception get_generic_data: All connection attempts failed LiteLLM Proxy:ERROR: utils.py - LiteLLM Prisma Client Exception get_generic_data: All connection attempts failed LiteLLM Proxy:ERROR: proxy_server.py - ProxyConfig:add_deployment - All connection attempts failed

Root Cause

What happened? After upgrading from LiteLLM 1.81.x to any 1.82.x or 1.83.0 release via pip on Windows, the Prisma query engine crashes immediately on the first database query after startup. LiteLLM becomes completely unable to read from or write to the PostgreSQL database. The Prisma migrations run successfully. The query engine binary is found and its PID is logged. However the very first query LiteLLM makes after startup returns httpcore.ReadError, indicating the engine process crashes mid-response. All subsequent queries fail with httpcore.ConnectError: All connection attempts failed because the engine process is dead. Critically: The Prisma engine works perfectly fine in isolation. A standalone Python test script connecting to the same database with the same DATABASE_URL succeeds without any issues: pythonimport asyncio from prisma import Prisma

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?

Environment

OS: Windows 10/11 x64 Python: 3.12.x (pythoncore-3.12-64) LiteLLM versions affected: 1.82.0, 1.82.3, 1.83.0 LiteLLM last working version: 1.81.16 Installation method: pip (not Docker) prisma-client-py: 0.15.0 Prisma CLI: 5.17.0 Node.js: v20.19.1 (also reproduced with v24.14.1) PostgreSQL: 15.x at 127.0.0.1:5432 Virtual environment: Python venv at C:\LiteLLM\venv

What happened? After upgrading from LiteLLM 1.81.x to any 1.82.x or 1.83.0 release via pip on Windows, the Prisma query engine crashes immediately on the first database query after startup. LiteLLM becomes completely unable to read from or write to the PostgreSQL database. The Prisma migrations run successfully. The query engine binary is found and its PID is logged. However the very first query LiteLLM makes after startup returns httpcore.ReadError, indicating the engine process crashes mid-response. All subsequent queries fail with httpcore.ConnectError: All connection attempts failed because the engine process is dead. Critically: The Prisma engine works perfectly fine in isolation. A standalone Python test script connecting to the same database with the same DATABASE_URL succeeds without any issues: pythonimport asyncio from prisma import Prisma

async def test(): db = Prisma() await db.connect() print('SUCCESS - connected!') await db.disconnect()

asyncio.run(test())

Output: query-engine 393aa359c9ad4a4bb28630fb5613f9c281cde053

SUCCESS - connected!

This confirms the issue is in how LiteLLM 1.82.x/1.83.0 initializes or interacts with the Prisma client internally — not in Prisma, the binary, the database, or the network.

Relevant log output (with --debug) query-engine 393aa359c9ad4a4bb28630fb5613f9c281cde053 LiteLLM Proxy:INFO: utils.py - Started Prisma DB health watchdog LiteLLM Proxy:INFO: utils.py - Found prisma-query-engine at PID 29404. LiteLLM Proxy:INFO: utils.py - Watching engine PID 29404 via os.kill polling.

LiteLLM Proxy:ERROR: proxy_server.py - litellm.proxy_server.py::add_deployment() - Error getting new models from DB - File "prisma/engine/_http.py", line 217, in request httpcore.ReadError <-- engine crashes on FIRST query

LiteLLM Proxy:ERROR: utils.py - LiteLLM Prisma Client Exception get_generic_data: All connection attempts failed LiteLLM Proxy:ERROR: utils.py - LiteLLM Prisma Client Exception get_generic_data: All connection attempts failed LiteLLM Proxy:ERROR: proxy_server.py - ProxyConfig:add_deployment - All connection attempts failed File "prisma/engine/_http.py", line 217, in request httpcore.ConnectError: All connection attempts failed <-- engine is dead, all subsequent queries fail

What I expected LiteLLM should connect to PostgreSQL via Prisma and start successfully, as it did in 1.81.16.

What actually happened The Prisma query engine process starts (PID is found and logged), but crashes on the very first query LiteLLM makes after startup (ReadError). All subsequent queries fail with ConnectError because the engine process is no longer running.

Steps to reproduce

Windows 10/11 x64, Python 3.12, pip install (not Docker) Create a fresh venv: python -m venv venv Install: pip install "litellm[proxy]==1.83.0" Install prisma separately (not pulled in automatically): pip install prisma Fetch binaries: cd venv/Lib/site-packages/litellm/proxy && prisma py fetch --force Generate client: prisma generate --schema schema.prisma Set DATABASE_URL environment variable to a valid PostgreSQL URL Run: litellm --config config.yaml --debug Observe ReadError on first query, then ConnectError on all subsequent queries

Additional investigation done The following were ruled out as causes:

✅ PostgreSQL is running and accessible — standalone Prisma test script connects successfully ✅ DATABASE_URL is correctly set — confirmed via python -c "import os; print(os.environ.get('DATABASE_URL'))" ✅ Prisma binary is downloaded — prisma version shows correct binary at cache path ✅ Node.js version — reproduced with both v20.19.1 (LTS) and v24.14.1 ✅ HTTP/HTTPS proxy vars — cleared $env:HTTP_PROXY, $env:HTTPS_PROXY, set $env:NO_PROXY=localhost,127.0.0.1 — no change ✅ Windows Defender — not blocking the binary (binary runs standalone) ✅ Fresh venv — reproduced on completely fresh virtual environment ✅ prisma py fetch --force — binaries downloaded successfully ✅ prisma generate --schema schema.prisma — client generated successfully ✅ Downgrading to litellm==1.81.16 — fixes the issue completely

Steps to Reproduce

Relevant log output

What part of LiteLLM is this about?

No response

What LiteLLM version are you on ?

v1.53.0

Twitter / LinkedIn details

No response

extent analysis

TL;DR

Downgrade to LiteLLM version 1.81.16 to resolve the issue with the Prisma query engine crashing on the first database query after startup.

Guidance

  • Verify that the Prisma binary is correctly downloaded and accessible by running prisma py fetch --force and checking the binary's cache path.
  • Confirm that the DATABASE_URL environment variable is correctly set by running python -c "import os; print(os.environ.get('DATABASE_URL'))".
  • Try downgrading to LiteLLM version 1.81.16 using pip install "litellm[proxy]==1.81.16" to see if the issue is resolved.
  • If downgrading is not feasible, investigate potential differences in how LiteLLM 1.82.x/1.83.0 initializes or interacts with the Prisma client compared to version 1.81.16.

Notes

The root cause of the issue appears to be related to changes in LiteLLM version 1.82.x/1.83.0, but the exact cause is unclear. Downgrading to version 1.81.16 is a reliable workaround.

Recommendation

Apply the workaround by downgrading to LiteLLM version 1.81.16, as this has been confirmed to resolve the issue.

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

litellm - 💡(How to fix) Fix [Bug]: Prisma query engine crashes immediately on first query on Windows (pip install) - LiteLLM 1.82.x / 1.83.0 [1 participants]