Open sebruiz opened 1 year ago
Official response from Neon:
Hi Sebastian,
I am on the DevRel team over here at Neon. Thank you for reaching out.
This is indeed related to the cold start. This is something we're aware of and are actively working on. To address this issue, you can increase the maximum number of seconds to wait for a new connection to be opened or disable the timeout behavior for Prisma.
To do that, adjust your Neon connection string by adding a
connect_timeout
parameter. You can set this parameter to a high value or 0 to disable the timeout behaviorThe connection string will have the following format DATABASE_URL= postgres://
: @ep-yellow-lab-282559-pooler.us-east-2.aws.neon.tech/neondb?pgbouncer=true&pool_timeout=20&connect_timeout=10 This should fix the error you're running into. I'll make sure that this fix is reflected in the docs. Thank you for reporting!
Occasionally we see errors like this in Vercel:
This might be from a "cold start" where Neon is set Idle instead of Active after a period of a no use. See:
https://neon.tech/docs/guides/prisma#connection-timeouts
Our connection string at time of this writing:
postgres://<USER>:<PASS>@ep-yellow-lab-282559-pooler.us-east-2.aws.neon.tech/neondb?pgbouncer=true&pool_timeout=20