The above error generally indicates credentials were entered incorrectly. You can try changing the password for user kunal in the Database Access section of the Atlas UI or create another temporary test user to verify that the credentials are being entered correctly.
You may find the following Atlas documentation for this useful as well:
I already tried changing my username and password many times but no luck.
I have created one new account (different email id) in Atlas and configured cluster but while connecting through mongo shell i am facing same issue with my new account too
Thanks for reply. I have replied to your comment earlier, this one is just to add information that i created new account, new database user but all are failing with same error message
Seems, there are some other issues which i am not able to figure out.
I have attached screenshots of my atlas configuration - Network Access, Database Access , Error Message
Thanks for getting back to me with that information and confirming you’ve tried different combination of credentials.
Wonder why ‘secondary server’ is picked up when connecting as below
Based off your screenshots, I can see the connection attempts are being made to 3 hosts with a few other options such as ssl=true . However, I cannot see the replicaSet value. For troubleshooting purposes, would you be able to try connecting using the standard connection string format? To get this, please follow the below steps:
Head over to your Clusters section in the Atlas UI
In addition to my previous comments, I have also noticed that no authentication database is being passed through when you are connecting with the DNS seed list format which explains this error now.
As a side note, when connecting using mongoshell and using the DNS seed list format, a DNS TXT Record look up should be performed as well in which the record should contain connection options, to be added as parameters to the dynamically constructed connecting string.
Since these were not being returned whilst you were using the DNS seed list format, it could indicate a possible DNS configuration issue.
One way of testing would be to perform a nslookup as shown in the below example using the cluster you provided in this post:
nslookup -q=TXT clusterone.qnrfp.mongodb.net
The output should contain the connection options (please note take note of the returned text value):
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
clusterone.qnrfp.mongodb.net text = "authSource=admin&replicaSet=atlas-11qgt0-shard-0"