Can't connect to cluster - Step 8 in Lecture: README

Hi,

When I typed the following in the “bin” folder of Mongodb downloaded from the mongodb download center link, I got an error message (please see below) :-

mongo “mongodb+srv://m220student:m220password@mflix-xxxxx.mongodb.net/test?retryWrites=true”

I got the above “mongodb+srv://m220student:m220password@mflix-xxxxx.mongodb.net/test?retryWrites=true” from Connect Your Application in Atlas. I also tried the standard URL message as well but still not working

Not sure what am I missing?

Thanks

Below is the error message:-

2018-11-19T08:10:03.732-0800 I NETWORK [js] Starting new replica set monitor fo
r mflix-shard-0/mflix-shard-00-01-xxxxx.mongodb.net.:27017,mflix-shard-00-02-xxxxx.mongodb.net.:27017,mflix-shard-00-00-xxxxx.mongodb.net.:27017
2018-11-19T08:10:13.809-0800 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable
to reach primary for set mflix-shard-0
2018-11-19T08:10:13.810-0800 I NETWORK [ReplicaSetMonitor-TaskExecutor] Cannot
reach any nodes for set mflix-shard-0. Please check network connectivity and the
status of the set. This has happened for 1 checks in a row.
2018-11-19T08:10:29.319-0800 W NETWORK [js] Unable to reach primary for set mfl
ix-shard-0
2018-11-19T08:10:29.319-0800 I NETWORK [js] Cannot reach any nodes for set mfli
x-shard-0. Please check network connectivity and the status of the set. This has
happened for 2 checks in a row.
2018-11-19T08:10:29.323-0800 E QUERY [js] Error: connect failed to replica se
t mflix-shard-0/mflix-shard-00-01-7xxxxx.mongodb.net.:27017,mflix-shard-00-02-xxxxx.mongodb.net.:27017,mflix-shard-00-00-xxxxx.mongodb.net.:27017 :
connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6
exception: connect failed

Have you set up the IP filter to allow your own IP address? Atlas provides additional security by allowing you to define allowed source IPs. By default NO connections are allowed (for security).

I set up the allow access from anywhere for the IP filter.
Let me try again when I am home to see if it works.
Thanks

That is not a safe, or smart idea. I seriously suggest you add limits.

OHO! That could be it :smiley:

Are you at work, at school or somewhere like that? On a network that’s not yours?

I think I’ve found it :smiley:

I just copy/pasted your hostname+port to make a command and I noticed this:

mflix-shard-00-02-xxxxx.mongodb.net.:27017

Look closer.

.net.:27017

See it? :smiley:

That sneaky little dot?

There’s no dot supposed to be at the end of a hostname. Try this on for size:

mflix-shard-0/mflix-shard-00-01-xxxxx.mongodb.net:27017,mflix-shard-00-02-xxxxx.mongodb.net:27017,mflix-shard-00-00-xxxxx.mongodb.net:27017

What about checking/modifying your hidden “.in.” file?

When I tried again at home, it worked! Thanks much.
However, at the end, there was an error (Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.] but I think that should be fine? as I had no problem with mongorestore and I saw 6 collections uploaded in Atlas.

Thanks

Yes, that warning message is 100% fine.

Got it, Thank you so much!