Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodb is not connecting #7

Open
utshomomen opened this issue Dec 13, 2019 · 7 comments
Open

mongodb is not connecting #7

utshomomen opened this issue Dec 13, 2019 · 7 comments

Comments

@utshomomen
Copy link

No description provided.

@bmnidhin
Copy link

please share some details

@utshomomen
Copy link
Author

utshomomen commented Dec 17, 2019

please share some details
mongodb atlas is not connecting. I tired everything.I didn't find anything that can solve this problem even there is nothing in stackoverflow

@oonqt
Copy link

oonqt commented Dec 22, 2019

"Not connecting" is not enough. Do you have any errors in the console? Did you get any output at all?

@bmnidhin
Copy link

Are you whitelisted the current IP address?

@pclade
Copy link

pclade commented Mar 7, 2020

I have the same Problem. I can connect to MongoDB with compass (same user, same password, same host machine, with the same IP). But it's not possible to connect with the server.js:

const uri = process.env.ATLAS_URI;
mongoose.connect(uri, { useNewUrlParser: true, useCreateIndex: true });

ATLAS_URI is filled in .env file in the same directory as server.js

ATLAS_URI=mongodb+srv://-----:[email protected]/test?retryWrites=true&w=majority

Of course with the same user name and passwort as in compass.

I get the following messages:
Server is running on port: 5000
(node:1920) UnhandledPromiseRejectionWarning: Error: querySrv ETIMEOUT _mongodb._tcp.cluster0-lpfdv.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:206:19)
(node:1920) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1920) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I whitelisted my WAN IP and any IP: 0.0.0.0/0 (includes your current IP address)

I realy want to learn with this tutorial, but I'm a little bit frustrated.

Can anyone help?

@sohilmomin
Copy link

I have the same Problem. I can connect to MongoDB with compass (same user, same password, same host machine, with the same IP). But it's not possible to connect with the server.js:

const uri = process.env.ATLAS_URI;
mongoose.connect(uri, { useNewUrlParser: true, useCreateIndex: true });

ATLAS_URI is filled in .env file in the same directory as server.js

ATLAS_URI=mongodb+srv://-----:[email protected]/test?retryWrites=true&w=majority

Of course with the same user name and passwort as in compass.

I get the following messages:
Server is running on port: 5000
(node:1920) UnhandledPromiseRejectionWarning: Error: querySrv ETIMEOUT _mongodb._tcp.cluster0-lpfdv.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:206:19)
(node:1920) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1920) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I whitelisted my WAN IP and any IP: 0.0.0.0/0 (includes your current IP address)

I realy want to learn with this tutorial, but I'm a little bit frustrated.

Can anyone help?
i got the same error. i understand your frustration. How you solved it ???

@er-nitin-keshaw
Copy link

I have the same Problem. I can connect to MongoDB with compass (same user, same password, same host machine, with the same IP). But it's not possible to connect with the server.js:

const uri = process.env.ATLAS_URI;
mongoose.connect(uri, { useNewUrlParser: true, useCreateIndex: true });

ATLAS_URI is filled in .env file in the same directory as server.js

ATLAS_URI=mongodb+srv://-----:[email protected]/test?retryWrites=true&w=majority

Of course with the same user name and passwort as in compass.

I get the following messages:
Server is running on port: 5000
(node:1920) UnhandledPromiseRejectionWarning: Error: querySrv ETIMEOUT _mongodb._tcp.cluster0-lpfdv.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:206:19)
(node:1920) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1920) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I whitelisted my WAN IP and any IP: 0.0.0.0/0 (includes your current IP address)

I realy want to learn with this tutorial, but I'm a little bit frustrated.

Can anyone help?

I had similar issue, I installed mongodb in my system (ubuntu) using sudo apt-get install mongodb
also try killing server manually using - sudo lsof -i :5000 and then kill -9 PID.

above two solutions worked form me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants