P
Prisma•3d ago
Infamy

Issue with Prisma Pooling Timeout

Hello everyone, new poster here. I am pretty new to Prisma and have had no issues in recent months with it. Today my production server just started stating:
Rate limit check failed: Error [PrismaClientInitializationError]: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
at async n.checkRateLimit (.next/server/app/api/agents/create/route.js:1:4293)
at async Object.authorize (.next/server/app/api/agents/create/route.js:1:5366)
at async Object.c (.next/server/chunks/712.js:25:4504)
at async g (.next/server/chunks/712.js:1:105587)
at async a (.next/server/chunks/712.js:25:18496)
at async e.length.t (.next/server/chunks/712.js:25:19986) {
clientVersion: '6.1.0',
errorCode: 'P2024'
}
Rate limit check failed: Error [PrismaClientInitializationError]: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
at async n.checkRateLimit (.next/server/app/api/agents/create/route.js:1:4293)
at async Object.authorize (.next/server/app/api/agents/create/route.js:1:5366)
at async Object.c (.next/server/chunks/712.js:25:4504)
at async g (.next/server/chunks/712.js:1:105587)
at async a (.next/server/chunks/712.js:25:18496)
at async e.length.t (.next/server/chunks/712.js:25:19986) {
clientVersion: '6.1.0',
errorCode: 'P2024'
}
I have now tried what feels like 100 different options to fix this. To explain the same setup locally does not experience this issue. I have changed the server instance to one with more memory as I noticed issues with metrics but now that it has more overhead it does not seem to be the issue. I have tried changing my connection string and adding connection_limits, enabling and removing pgbouncer which my serverless DB provider states in the connection string. I am really struggling now to work out what the issue is, It works fine locally as I have said but on the production server it has just stopped working within the last couple days... Anyone have any idea or advice on what to go on here?
3 Replies
Prisma AI Help
Prisma AI Help•3d ago
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Infamy
InfamyOP•2d ago
I have also just updated prod to the latest version of prisma to see if this had any change:
Rate limit check failed: Error [PrismaClientInitializationError]: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
at async n.checkRateLimit (.next/server/app/api/agents/create/route.js:1:4293)
at async Object.authorize (.next/server/app/api/agents/create/route.js:1:5366)
at async Object.c (.next/server/chunks/712.js:25:4504)
at async g (.next/server/chunks/712.js:1:105587)
at async a (.next/server/chunks/712.js:25:18496)
at async e.length.t (.next/server/chunks/712.js:25:19986) {
clientVersion: '6.3.0',
errorCode: 'P2024'
}
Rate limit check failed: Error [PrismaClientInitializationError]: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
at async n.checkRateLimit (.next/server/app/api/agents/create/route.js:1:4293)
at async Object.authorize (.next/server/app/api/agents/create/route.js:1:5366)
at async Object.c (.next/server/chunks/712.js:25:4504)
at async g (.next/server/chunks/712.js:1:105587)
at async a (.next/server/chunks/712.js:25:18496)
at async e.length.t (.next/server/chunks/712.js:25:19986) {
clientVersion: '6.3.0',
errorCode: 'P2024'
}
I have also optimised the rate limiter on the login screen where this is all occurring and still no joy. Losing my mind a little over here! Lastly for DATABASE_URL this is the params passed into the connection string advised by the server provider: ?sslmode=require&pgbouncer=true&connect_timeout=10 I have also tried turning off pgbouncer and removing it entirely from connection string and still no joy @Prisma AI Help Bump
Nurul
Nurul•19h ago
Hey 👋 Which database provider are you using? How many maximum connections does it support? Did you try disabling pool timeout and check if you still get the same error? https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool#disabling-the-connection-pool-timeout
Connection pool | Prisma Documentation
Prisma ORM's query engine creates a connection pool to store and manage database connections.

Did you find this page helpful?