Unable to reach primary for set Cluster0-shard-0 but Successfully connected to cluster0-shard-00-00-jxeqq.mongodb.net:27017

C:\Users\sashikiran.vadlamuri>mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
MongoDB shell version v4.0.6
connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0
2019-04-10T11:40:18.621+0530 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-04-10T11:40:19.499+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to cluster0-shard-00-00-jxeqq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-00-jxeqq.mongodb.net:27017 with a 5 second timeout)
2019-04-10T11:40:24.708+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set Cluster0-shard-0
2019-04-10T11:40:25.797+0530 I NETWORK [js] Successfully connected to cluster0-shard-00-00-jxeqq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-00-jxeqq.mongodb.net:27017 with a 0 second timeout)
2019-04-10T11:40:36.809+0530 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2019-04-10T11:40:47.525+0530 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2019-04-10T11:40:47.526+0530 E QUERY [js] Error: Could not find host matching read preference { mode: “primary”, tags: [ {} ] } for set Cluster0-shard-0 :
connect@src/mongo/shell/mongo.js:343:13
@(connect):1:6
exception: connect failed

Make sure your internet connectivity is good and please check this post: Compass Connection [Solution]

Let me know if does not work for you.

Kanika

My company firewall allowed now able to connect

1 Like