Next.js Discord

Discord Forum

Prisma + Postgres hosted on Vercel: "Timed out fetching a new connection from the connection pool"

Answered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
Hello. I have a Postgres database hosted on Vercel. It's status is "Available". I'm pretty sure my connection details are correct in .env, snippet copied from Vercel quickstart. But I get this error:

Unhandled Runtime Error Error: Invalid prisma.category.findMany() invocation: 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: 17)

Does it ring a bell for someone? How to troubleshoot this? Thanks!
Answered by Sun bear
You can try to disble the timeout:

datasource db {
  provider = "postgresql"
  url      = "postgresql://johndoe:mypassword@localhost:5432/mydb?connection_limit=5&pool_timeout=0"
}


https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool#disabling-the-connection-pool-timeout
View full answer

2 Replies

Sun bear
You can try to disble the timeout:

datasource db {
  provider = "postgresql"
  url      = "postgresql://johndoe:mypassword@localhost:5432/mydb?connection_limit=5&pool_timeout=0"
}


https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool#disabling-the-connection-pool-timeout
Answer
Cape lionOP
Thanks, works now!