No primary node detected when im connecting[SOLVED]

i cant connect to my own cluster the console shows this

[thread1] No primary detected for set Cluster0-shard-0

after executing the connection line to my cluster

mongo “mongodb://cluster0-shard-00-00-x38xe.mongodb.net:27017,cluster0-shard-00-01-x38xe.mongodb.net:27017,cluster0-shard-00-02-x38xe.mongodb.net:27017/test?replicaSet=Cluster0-shard-0” --ssl --authenticationDatabase admin --username m001-student --password m001-student-basics

Is your userid/pwd correct?
What you pasted may not be full error
I am getting this with your command

2019-04-10T09:16:39.000+0530 I NETWORK [js] Successfully connected to cluster0-shard-00-01-x38xe.mongodb.net:27017 (1 connections now open to cluster0-shard-00-01-x38xe.mongodb.net:27017 with a 0 second timeout)
2019-04-10T09:16:39.555+0530 I NETWORK [js] Marking host cluster0-shard-00-01-x38xe.mongodb.net:27017 as failed :: caused by :: Location8000: can’t authenticate against replica set node cluster0-shard-00-01-x38xe.mongodb.net:27017 :: caused by :: bad auth Authentication failed.
2019-04-10T09:16:41.459+0530 I NETWORK [js] Marking host cluster0-shard-00-00-x38xe.mongodb.net:27017 as failed :: caused by :: Location40659: can’t connect to new replica set master [cluster0-shard-00-00-x38xe.mongodb.net:27017], err: Location8000: bad auth Authentication failed.
2019-04-10T09:16:41.470+0530 E QUERY [js] Error: can’t authenticate against replica set node cluster0-shard-00-00-x38xe.mongodb.net:27017 :: caused by :: can’t connect to new replica set master [cluster0-shard-00-00-x38xe.mongodb.net:27017], err: Location8000: bad auth Authentication failed. :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

2 Likes

I have the same issue even , i can confirm that user credentials are correct and i am able to ping the hosts as well.
According to Atlas Cluster i have primary:

1 Like

Problem solved, you have to have a 3.4 version to avoid this, check the shell version with mongo --nodb at the prompt

Thank you So much for the Answer.