Connection Failed in Lab: Connect to your Atlas Cluster

user@M001# mongo “mongodb+srv://sandbox.qwnct.mongodb.net/myFirstDatabase” --username m001-student
MongoDB shell version v4.0.5
Enter password:
connecting to: mongodb://sandbox-shard-00-01.qwnct.mongodb.net.:27017,sandbox-shard-00-00.qwnct.mongodb.net.:27017,sandbox-shard-00-02.qwnct.mongodb.net.:27017/myFirstDatabase?authSource=admin&gssapiServiceName=mongodb&replicaSet=atlas-2jfu6n-shard-0&ssl=true
2021-11-16T15:09:36.918+0000 I NETWORK [js] Starting new replica set monitor for atlas-2jfu6n-shard-0/sandbox-shard-00-01.qwnct.mongodb.net.:27017,sandbox-shard-00-00.qwnct.mongodb.net.:27017,sandbox-shard-00-02.qwnct.mongodb.net.:27017
2021-11-16T15:09:37.557+0000 I NETWORK [js] Successfully connected to sandbox-shard-00-02.qwnct.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-02.qwnct.mongodb.net.:27017 with a 5 second timeout)
2021-11-16T15:09:37.557+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-00.qwnct.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-00.qwnct.mongodb.net.:27017 with a 5 second timeout)
2021-11-16T15:09:38.369+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-01.qwnct.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-01.qwnct.mongodb.net.:27017 with a 5 second timeout)
2021-11-16T15:09:38.381+0000 I NETWORK [js] Successfully connected to sandbox-shard-00-01.qwnct.mongodb.net:27017 (1 connections now open to sandbox-shard-00-01.qwnct.mongodb.net:27017 with a 5 second timeout)
2021-11-16T15:09:38.569+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor] changing hosts to atlas-2jfu6n-shard-0/sandbox-shard-00-00.qwnct.mongodb.net:27017,sandbox-shard-00-01.qwnct.mongodb.net:27017,sandbox-shard-00-02.qwnct.mongodb.net:27017 from atlas-2jfu6n-shard-0/sandbox-shard-00-00.qwnct.mongodb.net.:27017,sandbox-shard-00-01.qwnct.mongodb.net.:27017,sandbox-shard-00-02.qwnct.mongodb.net.:27017
2021-11-16T15:09:39.181+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-02.qwnct.mongodb.net:27017 (1 connections now open to sandbox-shard-00-02.qwnct.mongodb.net:27017 with a 5 second timeout)
2021-11-16T15:09:39.660+0000 I NETWORK [js] Marking host sandbox-shard-00-01.qwnct.mongodb.net:27017 as failed :: caused by :: Location40659: can’t connect to new replica set master [sandbox-shard-00-01.qwnct.mongodb.net:27017], err: Location8000: bad auth : Authentication failed.
2021-11-16T15:09:39.990+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-00.qwnct.mongodb.net:27017 (1 connections now open to sandbox-shard-00-00.qwnct.mongodb.net:27017 with a 5 second timeout)
2021-11-16T15:09:40.060+0000 I NETWORK [js] Marking host sandbox-shard-00-02.qwnct.mongodb.net:27017 as failed :: caused by :: SocketException: can’t authenticate against replica set node sandbox-shard-00-02.qwnct.mongodb.net:27017 :: caused by :: socket exception [CONNECT_ERROR] server [sandbox-shard-00-02.qwnct.mongodb.net:27017] connection pool error: network error while attempting to run command ‘isMaster’ on host ‘sandbox-shard-00-02.qwnct.mongodb.net:27017
2021-11-16T15:09:40.589+0000 I NETWORK [js] Marking host sandbox-shard-00-00.qwnct.mongodb.net:27017 as failed :: caused by :: SocketException: can’t authenticate against replica set node sandbox-shard-00-00.qwnct.mongodb.net:27017 :: caused by :: socket exception [CONNECT_ERROR] server [sandbox-shard-00-00.qwnct.mongodb.net:27017] connection pool error: network error while attempting to run command ‘isMaster’ on host ‘sandbox-shard-00-00.qwnct.mongodb.net:27017
2021-11-16T15:09:41.802+0000 I NETWORK [js] Marking host sandbox-shard-00-01.qwnct.mongodb.net:27017 as failed :: caused by :: Location40659: can’t connect to new replica set master [sandbox-shard-00-01.qwnct.mongodb.net:27017], err: Location8000: bad auth : Authentication failed.
2021-11-16T15:09:41.803+0000 E QUERY [js] Error: can’t authenticate against replica set node sandbox-shard-00-01.qwnct.mongodb.net:27017 :: caused by :: can’t connect to new replica set master [sandbox-shard-00-01.qwnct.mongodb.net:27017], err: Location8000: bad auth : Authentication failed. :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

I have added both the current IP and the 0.0.0.0 IP in Network Access, yet I don’t know how to solve it further. I also have used the link of 4.0 Mongo since MongoDB shell version v4.0.5.

Indicates that you have the wrong user name or password.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.