Unable to Connect to Atlas

mongo “mongodb://mflix-shard-00-00-qribg.mongodb.net:27017,mflix-shard-00-01-qribg.mongodb.net:27017,mflix-shard-00-02-qribg.mongodb.net:27017/test?replicaSet=mflix-shard-0” --ssl --authenticationDatabase admin --username m220student --password m220password

MongoDB shell version v3.4.0

connecting to: mongodb://mflix-shard-00-00-qribg.mongodb.net:27017,mflix-shard-00-01-qribg.mongodb.net:27017,mflix-shard-00-02-qribg.mongodb.net:27017/test?replicaSet=mflix-shard-0

2019-03-17T13:03:51.252+0530 I NETWORK [main] Starting new replica set monitor for mflix-shard-0/mflix-shard-00-00-qribg.mongodb.net:27017,mflix-shard-00-01-qribg.mongodb.net:27017,mflix-shard-00-02-qribg.mongodb.net:27017

2019-03-17T13:03:56.390+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] Failed to connect to 34.198.123.77:27017 after 5000 milliseconds, giving up.

2019-03-17T13:03:56.560+0530 W NETWORK [main] Failed to connect to 34.232.87.138:27017 after 5000 milliseconds, giving up.

2019-03-17T13:04:01.753+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] Failed to connect to 52.70.176.34:27017 after 5000 milliseconds, giving up.

2019-03-17T13:04:01.753+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] No primary detected for set mflix-shard-0

2019-03-17T13:04:01.753+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] All nodes for set mflix-shard-0 are down. This has happened for 1 checks in a row.

2019-03-17T13:04:07.264+0530 W NETWORK [main] Failed to connect to 34.232.87.138:27017 after 5000 milliseconds, giving up.

2019-03-17T13:04:12.267+0530 W NETWORK [main] Failed to connect to 34.198.123.77:27017 after 5000 milliseconds, giving up.

2019-03-17T13:04:17.272+0530 W NETWORK [main] Failed to connect to 52.70.176.34:27017 after 5000 milliseconds, giving up.

2019-03-17T13:04:17.272+0530 W NETWORK [main] No primary detected for set mflix-shard-0

2019-03-17T13:04:17.272+0530 I NETWORK [main] All nodes for set mflix-shard-0 are down. This has happened for 2 checks in a row.

2019-03-17T13:04:17.273+0530 E QUERY [main] Error: connect failed to replica set mflix-shard-0/mflix-shard-00-00-qribg.mongodb.net:27017,mflix-shard-00-01-qribg.mongodb.net:27017,mflix-shard-00-02-qribg.mongodb.net:27017 :

connect@src/mongo/shell/mongo.js:234:13

@(connect):1:6

exception: connect failed

Are you trying from vagrant box or windows?
Can you ping that server

c:\rrt>ping mflix-shard-00-00-qribg.mongodb.net

Pinging ec2-52-70-176-34.compute-1.amazonaws.com [52.70.176.34] with 32 bytes of data:
Reply from 52.70.176.34: bytes=32 time=284ms TTL=36
Reply from 52.70.176.34: bytes=32 time=276ms TTL=36

I can connect from both windows as well as vagrant
May be some firewall/security settings preventing your connection

MongoDB Enterprise mflix-shard-0:PRIMARY> db
test

MongoDB Enterprise mflix-shard-0:PRIMARY> show dbs
admin 0.000GB
local 3.320GB

1 Like

Hello, I’m also having a problem connecting. This is my shell:

~$ mongo “mongodb+srv://m220student:m220password@mflix-wbree.mongodb.net/test?retryWrites=true&w=majority”
MongoDB shell version v4.0.13
connecting to: mongodb://mflix-shard-00-02-wbree.mongodb.net.:27017,mflix-shard-00-01-wbree.mongodb.net.:27017,mflix-shard-00-00-wbree.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=mflix-shard-0&retryWrites=true&ssl=true&w=majority
2019-11-24T22:59:15.702+0100 I NETWORK [js] Starting new replica set monitor for mflix-shard-0/mflix-shard-00-02-wbree.mongodb.net.:27017,mflix-shard-00-01-wbree.mongodb.net.:27017,mflix-shard-00-00-wbree.mongodb.net.:27017
2019-11-24T22:59:15.857+0100 I NETWORK [js] Successfully connected to mflix-shard-00-01-wbree.mongodb.net.:27017 (1 connections now open to mflix-shard-00-01-wbree.mongodb.net.:27017 with a 5 second timeout)
2019-11-24T22:59:15.867+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to mflix-shard-00-00-wbree.mongodb.net.:27017 (1 connections now open to mflix-shard-00-00-wbree.mongodb.net.:27017 with a 5 second timeout)
2019-11-24T22:59:15.894+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] changing hosts to mflix-shard-0/mflix-shard-00-00-wbree.mongodb.net:27017,mflix-shard-00-01-wbree.mongodb.net:27017,mflix-shard-00-02-wbree.mongodb.net:27017 from mflix-shard-0/mflix-shard-00-00-wbree.mongodb.net.:27017,mflix-shard-00-01-wbree.mongodb.net.:27017,mflix-shard-00-02-wbree.mongodb.net.:27017
2019-11-24T22:59:15.972+0100 I NETWORK [js] Successfully connected to mflix-shard-00-00-wbree.mongodb.net:27017 (1 connections now open to mflix-shard-00-00-wbree.mongodb.net:27017 with a 5 second timeout)
2019-11-24T22:59:15.984+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to mflix-shard-00-01-wbree.mongodb.net:27017 (1 connections now open to mflix-shard-00-01-wbree.mongodb.net:27017 with a 5 second timeout)
2019-11-24T22:59:16.133+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to mflix-shard-00-02-wbree.mongodb.net:27017 (1 connections now open to mflix-shard-00-02-wbree.mongodb.net:27017 with a 5 second timeout)
Implicit session: session { “id” : UUID(“9fd7ff19-a037-42c9-8efd-62b9db4a7ba6”) }
MongoDB server version: 4.0.13
Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]
MongoDB Enterprise mflix-shard-0:PRIMARY>

I also tried:
~$ mongo “mongodb+srv://mflix-wbree.mongodb.net/test” --username m220student

and then entered the password. Same thing shows up… Is this error relevant? Since I do not see the tick on ‘Connect’ I am not sure if I’m connected… how can I find out?

Edit: if i type ‘show dbs’ and all db do show up, so I assume I am connected?
@Ramachandra_37567 maybe you can answer me this?

Thank you for your time.

Yes you are connected successfully
Please ignore the warning messages and continue with your work

1 Like