Prisma Client hangs and eventually panics when there is no MongoDB server to connect to #6431
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: mongodb
Milestone
(MongoDB is not publicly available yet. This issue is for the development build.)
Problem
A mongodb connection string that doesn't have a mongodb server listening hangs and eventually panics after 1 minute.
I first noticed this when I accidentally shutdown my mongodb server and ran my script. The script seemed frozen, but it said it was connected. Then I realized that I had no server listening.
Steps to Reproduce
Given the following Prisma Schema
And the following script
Make sure your MongoDB server isn't running
Now if you run that script, you get the following:
Suggested solution
Two confusing things:
After 1 minute (see the +1m in debug logs) it crashes with:
The text was updated successfully, but these errors were encountered: