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 when trying to connect to db.

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title

Mongoose version

6.6.0

Node.js version

18.x

MongoDB version

5.0.12

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

10

Issue

So when I try to connect to my db I have an error

Error: querySrv ECONNREFUSED _mongodb._tcp.cluster0.0ltupff.mongodb.net
    at QueryReqWrap.onresolve [as oncomplete] (node:dns:303:19) {      
  errno: undefined,
  code: 'ECONNREFUSED',
  syscall: 'querySrv',
  hostname: '_mongodb._tcp.cluster0.0ltupff.mongodb.net'
}

link that I use to connect is

mongodb+srv://<username>:<password>@cluster0.0ltupff.mongodb.net/Cluster0?retryWrites=true&w=majority

And yes, I have a correct username and password. My IP is allowed too.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:29

github_iconTop GitHub Comments

2reactions
Jacob1Tmcommented, Sep 12, 2022

Funny thing, my friend logged in without trouble…

0reactions
Jacob1Tmcommented, Sep 12, 2022

I just moved my bot to server on digital ocean i still can’t Access db from my pc but anyways.

I hate autocorrect on phone…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Error Establishing a Database Connection Error
The error establishing a database connection error basically means that for some reason or another the PHP code was unable to connect to...
Read more >
How to Fix the Error Establishing a Database Connection in ...
The 'Error establishing a database connection' issue can be caused by incorrect database information in your WordPress settings, corrupt ...
Read more >
Error establishing a database connection
This error means that your website files (on the webserver) are not able to connect to your database (on the database server).
Read more >
5 Ways to Fix "Error Establishing a Database Connection" in ...
How To Fix “Error Establishing a Database Connection” · Step 1: Get In Touch With Your Web Host Provider · Step 2: Check...
Read more >
Error: 'Failed to connect to database' when attempting to ...
SOLUTION · A network firewall is preventing the connection to the SQL Server (when the network path to the SQL Server will traverse...
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