Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB Atlas Cluster Connection Problem with Authentication Error

I am not able to connect to the mongoDB Atlas cluster that I have made. I entered in the given line of code after I created the cluster and recieved the error:

I am not able to find any solution to this problem. Please help me.

MongoDB shell version v4.2.0
Enter password: Cannot get console mode 6
connecting to: mongodb://cluster0-shard-00-01-jigfx.mongodb.net:27017,cluster0-shard-00-02-jigfx.mongodb.net:27017,cluster0-shard-00-00-jigfx.mongodb.net:27017/test?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true
2019-09-03T17:07:19.299-0400 I  NETWORK  [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-01-jigfx.mongodb.net:27017,cluster0-shard-00-02-jigfx.mongodb.net:27017,cluster0-shard-00-00-jigfx.mongodb.net:27017
2019-09-03T17:07:19.300-0400 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-jigfx.mongodb.net:27017
2019-09-03T17:07:19.300-0400 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-jigfx.mongodb.net:27017
2019-09-03T17:07:19.300-0400 I  CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-jigfx.mongodb.net:27017
2019-09-03T17:07:20.099-0400 I  NETWORK  [ReplicaSetMonitor-TaskExecutor] 
Confirmed replica set for Cluster0-shard-0 is Cluster0-shard-0/cluster0-shard-00-00-jigfx.mongodb.net:27017,cluster0-shard-00-01-jigfx.mongodb.net:27017,cluster0-shard-00-02-jigfx.mongodb.net:27017
2019-09-03T17:07:20.719-0400 I  NETWORK  [js] Marking host cluster0-shard-00-00-jigfx.mongodb.net:27017 as failed :: caused by :: Location40659:can't connect to new replica set master [cluster0-shard-00-00-jigfx.mongodb.net:27017], err: AuthenticationFailed: Missing expected field "pwd"


*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.


2019-09-03T17:07:21.522-0400 E  QUERY    [js] Error: Missing expected field "pwd" :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2019-09-03T17:07:21.524-0400 F  -        [main] exception: connect failed
2019-09-03T17:07:21.524-0400 E  -        [main] exiting with code 1

The expected result is a prompt that asks me for the password to connect to the cluster, but the prompt instantly responds with Cannot get console mode 6

like image 992
Gary Zlobinskiy Avatar asked Sep 03 '19 21:09

Gary Zlobinskiy


People also ask

Why MongoDB Atlas is not connecting?

If you have created a user and are having trouble authenticating, try the following: Check that you are using the correct username and password for your database user, and that you are connecting to the correct database deployment. Check that you are specifying the correct authSource database in your connection string.

Why is my MongoDB not connecting?

Ensure that your MongoDB instance is running: Compass must connect to a running MongoDB instance. Also check you have installed MongoDB and have a running mongod process. You should also check that the port where MongoDB is running matches the port you provide in the compass connect.

Can't connect to MongoDB could not connect to any servers in your MongoDB Atlas cluster?

Could not connect to any servers in your MongoDB Atlas cluster. The IP address seen by Atlas is not necessarily the IP address of your workstations. If behind a router that does NAT or using VPN the address seen is the one of the router or the exit point of the VPN.


1 Answers

try adding --password **** to the end of command

like image 118
민철홍 Avatar answered Oct 01 '22 15:10

민철홍