-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prisma client never recovers from P1001 #10240
Comments
This is likely the case for other error types as well. In one of our environments we get an error:
which I can only recover from by restarting. I'm not sure I can reproduce this error in a small script like before. |
I've also encountered such problems using Aurora Serverless Postgres and managed to use it with autopause with these connection url params: My service is long running, but disconnects the database after a few minutes without receiving a request. Otherwise the DB would never pause. |
@janpio Any update on this by any chance? This is unfortunately becoming more and more of an issue for us. It also has been mentioned by various users across a multitude of issues (see above) by now. Any chance the team could look into this shortly? |
@sreuter we will be looking at this soon. I can't promise when we will have a fix. But it is a focus for us. |
#12066 fixes this. You can test it out with |
With prisma version:
I ran the test again and I can confirm that it works! Great work! |
Awesome. Thanks for confirming |
@haggalin @garrensmith I am using prisma |
Most probably because your problem is slightly different from what is described here. Can you please open a new issue and then post the link to it here? Thanks. |
Bug description
Prisma client never recovers from
PrismaClientInitializationError
error code P1001, in a scenario where the database goes offline and then online again after some time. Haven't tested other error codes.We use a serverless aurora v1 from AWS which has a feature called "AutoPause" i.e. the database pauses when there's no activity and then resumes when activity begins again.
How to reproduce
node test.js
.Contents of
test.js
:Output:
Note: Changed to use
$connect()
instead of executing a query because the error thrown from the query doesn't have an error code See this issue.Expected behavior
Expected output from the test above:
Prisma client should be able to recover from this error.
Prisma information
No schema
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: