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.

MongoDB MongoServerSelectionError: getaddrinfo ENOTFOUND

See original GitHub issue

Issue Description

When I try to make a normal mongodb connection with typerom@0.2.29 version I get this error:

MongoDB MongoServerSelectionError: getaddrinfo ENOTFOUND [Mongodb Server IP]

but when I try to make a normal mongodb connection with typerom@0.2.25 version it works.

Expected Behavior

Must connect to mongodb server

Actual Behavior

throws this error:

MongoDB MongoServerSelectionError: getaddrinfo ENOTFOUND [Mongodb Server IP]

Steps to Reproduce

  1. install typeorm@0.2.29
  2. connect to a mongodb server with default options
typeorm.createConnection({
            type: "mongodb",
            url: CONFIG.MONGODB_URI,
            synchronize: true,
            logger: "debug",
            useUnifiedTopology: true,
            useNewUrlParser: true,
            autoLoadEntities: true,
        })

My Environment

Dependency Version
Operating System Windows10
Node.js version v15.0.1
Typescript version v3.7.4
TypeORM version v0.2.29

Additional Context

Relevant Database Driver(s)

  • mysql
  • aurora-data-api
  • aurora-data-api-pg
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don’t know how to start. I would need guidance.
  • No, I don’t have the time, although I believe I could do it if I had the time…
  • No, I don’t have the time and I wouldn’t even know how to start.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:14
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
pleerockcommented, Dec 22, 2020

Fix was merged and will be in v0.2.30 later this week.

9reactions
JumpLinkcommented, Nov 3, 2020

Same here, works with v0.2.28 but not with v0.2.29, connect url is mongodb+srv://<hidden>:<hidden>@cluster0.fbbdh.mongodb.net/<hidden>?retryWrites=true&w=majority"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mongodb remote database connectivity error - getaddrinfo ...
I am getting following error: getaddrinfo ENOTFOUND mycluster-u8ha7.mongodb.net. Can someone pls guide me how to troubleshoot and make this ...
Read more >
mongodb - MongoError: getaddrinfo ENOTFOUND undefined ...
getaddrinfo ENOTFOUND means client was not able to connect to the given address. Please try with the above address. I hope this helps....
Read more >
[COMPASS-4534] Unable to connect with v1.24.1 - Error
Successful connection. Actual Results. Error: getaddrinfo ENOTFOUND mongodb. Observations. When I enter a connection string into *Compass v1.
Read more >
Lumber update - getaddrinfo ENOTFOUND mongodb-01
... connect to the database due to the following error: > MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb-01 mongodb-01:27017.
Read more >
Meteor 2.6-beta.4 was released today and we need your ...
MongoServerSelectionError : getaddrinfo ENOTFOUND 07e6d85eafb8. The 07e6d85eafb8 is our MongoDB docker container name and we are not sure why ...
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