question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prisma MongoDB - Connection timeout problem.

See original GitHub issue

Bug description

Hi, I’m using Prisma with MongoDB Atlas. I deployed my project with Heroku and if someone didn’t visit my website for a while. My prisma apollo queries causes a problem because of prisma mongodb query inside of it.

For example: I visited the website and I saw error, I refresh the page and then error gone. After a few hours I revisited the website again I saw error after refresh the page the error gone.

A image while try to login:

https://i.ibb.co/dgXrWsb/IMG-2387.jpg

My connection url:

DATABASE_URL=“mongodb+srv://<user>:<pass>@serverlessinstance0.mongodb.net/<dbName>”

How to reproduce

Expected behavior

Connection shouldn’t be closed even though no one request any query. At least they shouldn’t see a error page.

Prisma information

Environment & setup

  • OS:
  • Database:
  • Node.js version:

Prisma Version

prisma: 3.13.0

@prisma/client: 3.13.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Oct 23, 2022

The query you are trying to execute probably just takes longer than these 10s (including the creation of the database connection). I suggest you open a new discussion in this repository so we can discuss this and ask all teh questions - in an existing and closed issue that is not really appropriate as it notifies all the previous participants of the discussion on each comment.

1reaction
dikyargacommented, Sep 25, 2022

hey @casperibo, I also experience this issue while using Prisma 3 (3.15.2 precisely), also using MongoDB Atlas

I just upgraded it to the latest version (4.3.1), which seems to resolve the issue 🤞

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connection to database timed out - Prisma
The error Connection your database timed out appears when you use Data Browser or Query Console. Cause. When you use Data Browser or...
Read more >
MongoDB connection error: MongoTimeoutError: Server ...
just go to mongodb atlas admin panel.Go in security tab>Network Access> Then whitelist your IP by adding it.
Read more >
Server selection error: server selection timeout, current topology
I'm trying to connect to via my code in golang. I am using the mongo-driver module. I am able to connect to instance: ......
Read more >
Prisma 3.12.0 Release - GitClear
test: use 1_000 notation for timeout + fix db pull timeout for CI ... For newcomers to Prisma with MongoDB, we recommend you...
Read more >
any suggestions about what to do with this error Transaction
I'm using 3.14.0 I increased timeouts and these queries generally take ... all existing connections with database, and on the subsequent request prisma...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found