Prisma P2024: Timed out fetching a new connection from the connection pool
Prisma throws P2024 Timed out fetching a new connection from the connection pool? The pool Prisma is using did not hand out a connection before its timeout.
Reviewed October 21, 2026
What it means in plain English
Prisma's error reference defines P2024 as: Timed out fetching a new connection from the connection pool. The message includes the current connection pool timeout and the connection limit. In Prisma ORM v7, that page says pool size and timeout are configured per driver adapter.
The connection-pool guide says each serverless function manages its own PrismaClient and its own pool. The pool size cannot exceed what the database can support. For the pg adapter, the documented default pool size field is max, default 10. The documented connectionTimeoutMillis default is 0, which that table describes as no timeout.
Likely causes
- Every warm function is holding its own pool, and together they sit at the database's connection limit, so the next checkout waits until the timeout.
- The adapter's pool is smaller than the burst of queries from that one function.
- The database host cannot be opened at all. That is
P1001, a different code.
How to fix it, step by step
- Read the timeout and connection limit inside the P2024 message. Those are the pool settings for the process that failed.
- On Prisma ORM v7 with the
pgadapter, set the pool on the adapter. The connection-pool guide showsmaxfor pool size. Its example setsconnectionTimeoutMilliswhen you want a connect timeout. - Point serverless runtime traffic at an external pooler such as PgBouncer. The same guide says to do that so functions do not exhaust the database connection limit. For Supabase, the transaction pooler is the path in too many connections / remaining connection slots are reserved.
- If the error changes to
prepared statement "s0" already exists, the pooler accepted the connection. See Prisma: prepared statement "s0" already exists. - If the error is P1001, the server was not reached. See Prisma P1001: Can't reach database server.
How to check it worked
- The function log no longer prints P2024.
- Queries return during the same traffic that used to time out.
Sources
Related fixes
More Database connections fixes
Keep going on your own.
The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.