Replies: 13 comments 19 replies
|
I'm using Nextjs v14.1.4 + vercel postgres with mentioned versions of prisma and client (if it helps) |
|
Hi @Naeem-gg 👋 The error you're encountering, Serverless databases like Neon have two main states: Active and Idle. If there is no query activity for a certain period (like 5 minutes for Neon), the database goes into an idle state. When you try to connect to an idle compute from Prisma ORM, Neon automatically activates it. However, this activation can take a few seconds and added latency can result in a connection timeout. To address this issue, you can adjust your connection string by adding a A Another possible cause of connection timeouts is Prisma ORM's connection pool, which has a default timeout of 10 seconds. If you are still experiencing connection timeouts, you can try increasing this limit (in addition to the See this section of the documentation on resolving connection timeout with Neon. If this answers your question, it would be great if you could mark this Discussion as answered to indicate that it has been resolved. Otherwise please let us know how else we can help you further or close the Discussion if it was resolved in some other way 🙏 |
|
I am facing the same issue rn. |
|
I tried to connect prisma and neon db for ever but never succeeded, so I moved to some other managed postgresql service:
So I just use aiven instead of neon |
|
Hi there, To keep our discussions organized and focused on the most relevant topics, we’re reviewing and tidying up our backlog. As part of this process, we’re closing discussions that haven’t had any recent activity and appear to be outdated. If this discussion is still important to you or unresolved, we’d love to hear from you! Feel free to reopen it or start a new one with updated details. For more details about our priorities and vision for the future of Prisma ORM, check out our latest blog post: https://www.prisma.io/blog/prisma-orm-manifesto. Thank you for your understanding and being part of the community!; |
|
Removing the sslmode=require resolved the issue for me. |
|
The issue you are facing has to deal with the formatting of your DATABASE_URL value in your .env file. What you need to do is add a ? and a timeout command after your url update the value in your .env file like this
Forexample
|
|
I’ve run into this issue multiple times, and here’s what usually helps: ✅ 1️⃣ Increase the connection timeout — sometimes the default is too low, and bumping it up solves the problem. You can do it by adding ✅ 2️⃣ (This works ~70% of the time!) — it’s a network issue. |
|
On the off chance this helps someone else, I was running into the same issue for weeks on an EC2. I tried increasing the connect_timeout and it didn't work, but interestingly I could get it to work from my local machine. So I tried an nslookup on my EC2 and on my local machine to see if it was resolving the addresses differently. Which as it turns out, my EC2 had some suspicious looking IPv6 addresses, which my local machine did not. So I temporarily disabled the IPv6 stuff on my EC2 via And tried again with |
|
not working for me adding timeout |
|
increasing connection timeout doesnt work for me. what else i can do? |
|
Sometimes the wifi network is somehoe blocking the request. Try switching to some other network just to double check if it is realted to firewall issue. Otherwise use the connection_timeout solution |
|
For me it worked after VPN |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Bug description
Hi there! I think there's a problem with prisma with serverless postgresql, I tried this on vercel postgres, supabase, railway and Neon and found this issue with all of mentioned services where it shows the same error as you can see in uploaded image. It happens very less with vercel postgres compared to others. How it gets resolved? well you need to sign in to the service dashboard and do something with databse either view some records or edit it doesn't matter you just need to interact with it and then come back to terminal and run any prisma command it will work fine. I never encountered the same with drizzle. So that's clearly something wrong with prisma and cold start of serverless postgres
How to reproduce
There's no perticular way to reproduce it but It happens with Neon the most. So create a db with Neon and continue working on it (while all the browsers where neon is logged in are closed to make sure its not running in bg) and you'll get the exact same error when you fire prisma commands
db push/pullor evenmigrate devExpected behavior
No response
Prisma information
Environment & setup
prisma : 5.11.0
@prisma/client : 5.11.0
Computed binaryTarget : windows
Operating System : win32
Architecture : x64
Node.js : v20.9.0
Studio : 0.499.0
Prisma Version
All reactions