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.

Error that hasn't been happening before (started 2 days ago)

See original GitHub issue

I’ve been having this error pop up on me recently :

MongooseError: Operation importantids.findOne() buffering timed out after 10000ms at Timeout.<anonymous> (/root/disgo/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:198:23) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7)

I successfully connect to the database and interact with it in my app, but recently, it keeps doing that error at random times and will not stop until I restart the app.

Mongoose version : 5.13.7 (won’t update using npm update)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vkarpov15commented, Feb 20, 2022

I took a closer look and I don’t see anything to indicate this is anything other than a case of replica set hostname inconsistency, which is documented and expected behavior in the MongoDB Node driver. You need to make sure that the self-reported hostname on the machine that’s hosting your MongoDB server is resolvable from your application server.

1reaction
fakelagcommented, Jan 11, 2022

Can second this. For me the issue seems to be that the new mongoose version (we are using 6.1.6) tries to resolve the replica set hostname by itself and throws getaddrinfo ENOTFOUND mongod-0 (mongod-0 is resolvable from the mongodb server, but not from connecting client). However previous versions and mongosh connects fine. It can not connect and so buffered operations fail with timeout.

Fixed by setting directConnection: true in mongoose connection options like so. It feels like previous versions potentially had the connection default to direct connect or something similar?

    const connectionPromise = mongoose.connect(mongoUrl, {
        directConnection: true,
    });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Common IRS Where's My Refund Questions and Errors
If you have EITC or ACTC, it didn't even start processing until after 2/15. If you were missing documents (or the IRS was),...
Read more >
‎CARE CODE: 205.2 [LU003] Error keeps happening on my ...
A previous post a response said the issue was corrected. It hasn't been corrected. Is the only resolution changing my password?
Read more >
How to Fix Meta Facebook Pixel Errors and Test Your Events
The Meta Facebook Pixel is a piece of code that you can install on your website to track the different kinds of actions...
Read more >
iCloud for Mac is stuck on "waiting to upload" - Apple Developer
To work around problem, I noticed that any edit (to the file that fails to upload) will solve the problem.
Read more >
Directory synchronization to Azure Active Directory stops or ...
Describes a performance problem in Azure Active Directory Sync Tool. The tool either stops syncing or reports that sync hasn't run in more ......
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