NOTE: the zzzzz below is my redacted five-letter sandbox identifier.
For the M001 Chapter 1 “Lab: Connect to your Atlas Cluster” I’m trying to connect from the in-browser IDE terminal window using the command and connection string shown below:
user@M001# mongo "mongodb+srv://sandbox.zzzzz.mongodb.net/sample_airbnb" --username m001-student MongoDB shell version v4.0.5 Enter password:
After I type my password (which of course I swear I got right), I get the following:
connecting to: mongodb://sandbox-shard-00-00.zzzzz.mongodb.net.:27017,sandbox-shard-00-02.zzzzz.mongodb.net.:27017,sandbox-shard-00-01.zzzzz.mongodb.net.:27017/sample_airbnb?authSource=admin&gssapiServiceName=mongodb&replicaSet=atlas-bqf9mc-shard-0&ssl=true 2021-12-06T02:57:04.851+0000 I NETWORK [js] Starting new replica set monitor for atlas-bqf9mc-shard-0/sandbox-shard-00-00.zzzzz.mongodb.net.:27017,sandbox-shard-00-02.zzzzz.mongodb.net.:27017,sandbox-shard-00-01.zzzzz.mongodb.net.:27017 2021-12-06T02:57:06.887+0000 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set atlas-bqf9mc-shard-0 2021-12-06T02:57:06.888+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor] Cannot reach any nodes for set atlas-bqf9mc-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row. 2021-12-06T02:57:10.353+0000 W NETWORK [js] Unable to reach primary for set atlas-bqf9mc-shard-0 2021-12-06T02:57:10.353+0000 I NETWORK [js] Cannot reach any nodes for set atlas-bqf9mc-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row. <snip checks 3, 4 and 5> 2021-12-06T02:57:20.955+0000 E QUERY [js] Error: connect failed to replica set atlas-bqf9mc-shard-0/sandbox-shard-00-00.zzzzz.mongodb.net.:27017,sandbox-shard-00-02.zzzzz.mongodb.net.:27017,sandbox-shard-00-01.zzzzz.mongodb.net.:27017 : connect@src/mongo/shell/mongo.js:328:13 @(connect):1:6 exception: connect failed user@M001#
When I connect with Compass it works fine, and the replica set is the same as in the error messages above (atlas-bqf9mc-shard-0). The individual shards also have the same names (sandbox-shard-00-00.zzzzz.mongodb.net:27017, etc.). I use a slightly different connection string in Compass, embedding the username and password:
Connecting using the Browser IDE is a graded assignment so I’d like to complete it. According to another forum post one can use a different shell/IDE to complete the assignments, but that assertion wasn’t followed by an explanation so I’d prefer to use the in-browser IDE.
Thanks in advance. FWIW I’m a long-time RDBMS developer who’s dabbled in MongoDB using the C# and node.js clients, and I’m looking forward to learning it methodically through the MDBU classes. So far the M001 class has been excellent… until I hit this wall