Not able to connect m001 MongoDB Basics Chapter 1 Lab

Hi
I have tried so many times and also gone through one of the post but all waste of time. I have successfully connected through the local client on my machine, but I am not able to connect through the IDE. PLease help to resolve this issue…

Command I used is mentioned in the text editor.
Error message after hitting Enter button:

Even if I directly click on the Run Test, then also getting error

Please help how can I resolve it…

It is working the same. So whatever command you use on your local client it should work in the IDE.

The error failed to load: m001-student makes me suspect that you cut-n-paste a partial command or a command with a newline (non visible) character. Hand type the whole command. Note that there is no newline between –username and m001-student.

1 Like

there is no new line between –username and m001-student. I am using the same command but it is not working…

Hi @Susheel_K_Thakur,

Can you share your connection string here.
So, we can check on our end.

Regards,
Kushagra

mongo “mongodb+srv://sandbox.qd3lt.mongodb.net/myFirstDatabase” --username m001-student

Hi @Susheel_K_Thakur,

I was successfully able to connect to your Atlas cluster with the above-provided connection string. :point_down:

Password I used: m001-mongodb-basics

Mkae sure you use parallel double quotes " "

Thanks,
Kushagra

I am still getting error-

user@M001# mongo “mongodb+srv://sandbox.qd3lt.mongodb.net/myFirstDatabase”–username m001-student

error mesage-

WARNING: shell and server versions do not match
2021-06-24T09:32:47.782+0000 E - [main] file [m001-student] doesn’t exist
failed to load: m001-student

I am using double quotes but it is not working

I have typed every character and using double quotes. there is no new line in the command. Did each and everything told in the tutorial but still it is not working…
don’t know what to do???

Hi @Susheel_K_Thakur,

We are sorry for the inconvenience caused to you.

We tried to reproduce the same on IDE, here is the output we got:

    user@M001# mongo "mongodb+srv://sandbox.qd3lt.mongodb.net/myFirstDatabase" --username m001-student
    MongoDB shell version v4.0.5
    Enter password: 
    connecting to: mongodb://sandbox-shard-00-01.qd3lt.mongodb.net.:27017,sandbox-shard-00-02.qd3lt.mongodb.net.:27017,sandbox-shard-00-00.qd3lt.mongodb.net.:27017/myFirstDatabase?authSource=admin&gssapiServiceName=mongodb&replicaSet=atlas-2wlf26-shard-0&ssl=true
    2021-06-24T09:59:24.515+0000 I NETWORK  [js] Starting new replica set monitor for atlas-2wlf26-shard-0/sandbox-shard-00-01.qd3lt.mongodb.net.:27017,sandbox-shard-00-02.qd3lt.mongodb.net.:27017,sandbox-shard-00-00.qd3lt.mongodb.net.:27017
    2021-06-24T09:59:24.552+0000 I NETWORK  [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-01.qd3lt.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-01.qd3lt.mongodb.net.:27017 with a 5 second timeout)
    2021-06-24T09:59:24.552+0000 I NETWORK  [js] Successfully connected to sandbox-shard-00-00.qd3lt.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-00.qd3lt.mongodb.net.:27017 with a 5 second timeout)
    2021-06-24T09:59:24.567+0000 I NETWORK  [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-02.qd3lt.mongodb.net:27017 (1 connections now open to sandbox-shard-00-02.qd3lt.mongodb.net:27017 with a 5 second timeout)
    2021-06-24T09:59:24.568+0000 I NETWORK  [ReplicaSetMonitor-TaskExecutor] changing hosts to atlas-2wlf26-shard-0/sandbox-shard-00-00.qd3lt.mongodb.net:27017,sandbox-shard-00-01.qd3lt.mongodb.net:27017,sandbox-shard-00-02.qd3lt.mongodb.net:27017 from atlas-2wlf26-shard-0/sandbox-shard-00-00.qd3lt.mongodb.net.:27017,sandbox-shard-00-01.qd3lt.mongodb.net.:27017,sandbox-shard-00-02.qd3lt.mongodb.net.:27017
    2021-06-24T09:59:24.577+0000 I NETWORK  [js] Successfully connected to sandbox-shard-00-02.qd3lt.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-02.qd3lt.mongodb.net.:27017 with a 5 second timeout)
    2021-06-24T09:59:24.605+0000 I NETWORK  [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-01.qd3lt.mongodb.net:27017 (1 connections now open to sandbox-shard-00-01.qd3lt.mongodb.net:27017 with a 5 second timeout)
    2021-06-24T09:59:24.606+0000 I NETWORK  [js] Marking host sandbox-shard-00-02.qd3lt.mongodb.net:27017 as failed :: caused by :: SocketException: can't authenticate against replica set node sandbox-shard-00-02.qd3lt.mongodb.net:27017 :: caused by :: socket exception [CONNECT_ERROR] server [sandbox-shard-00-02.qd3lt.mongodb.net:27017] connection pool error: network error while attempting to run command 'isMaster' on host 'sandbox-shard-00-02.qd3lt.mongodb.net:27017' 
    2021-06-24T09:59:24.608+0000 I NETWORK  [js] Marking host sandbox-shard-00-01.qd3lt.mongodb.net:27017 as failed :: caused by :: SocketException: can't authenticate against replica set node sandbox-shard-00-01.qd3lt.mongodb.net:27017 :: caused by :: socket exception [CONNECT_ERROR] server [sandbox-shard-00-01.qd3lt.mongodb.net:27017] connection pool error: network error while attempting to run command 'isMaster' on host 'sandbox-shard-00-01.qd3lt.mongodb.net:27017' 
    2021-06-24T09:59:24.621+0000 I NETWORK  [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-00.qd3lt.mongodb.net:27017 (1 connections now open to sandbox-shard-00-00.qd3lt.mongodb.net:27017 with a 5 second timeout)
    2021-06-24T09:59:24.624+0000 I NETWORK  [js] Marking host sandbox-shard-00-00.qd3lt.mongodb.net:27017 as failed :: caused by :: SocketException: can't authenticate against replica set node sandbox-shard-00-00.qd3lt.mongodb.net:27017 :: caused by :: socket exception [CONNECT_ERROR] server [sandbox-shard-00-00.qd3lt.mongodb.net:27017] connection pool error: network error while attempting to run command 'isMaster' on host 'sandbox-shard-00-00.qd3lt.mongodb.net:27017' 
    Implicit session: session { "id" : UUID("2ec78af5-ede3-4504-8f65-3f6f1ee4150e") }
    MongoDB server version: 4.4.6
    WARNING: shell and server versions do not match
    Welcome to the MongoDB shell.
    For interactive help, type "help".
    For more comprehensive documentation, see
            http://docs.mongodb.org/
    Questions? Try the support group
            http://groups.google.com/group/mongodb-user
    MongoDB Enterprise atlas-2wlf26-shard-0:PRIMARY> show dbs
    admin               0.000GB
    local               7.602GB
    sample_airbnb       0.055GB
    sample_analytics    0.009GB
    sample_geospatial   0.001GB
    sample_mflix        0.040GB
    sample_restaurants  0.006GB
    sample_supplies     0.001GB
    sample_training     0.041GB
    sample_weatherdata  0.002GB
    MongoDB Enterprise atlas-2wlf26-shard-0:PRIMARY> 

Kindly copy the connection string from the above message and try on IDE with the correct password.!!

Thanks,
Kushagra

Thanks… its working now

The issue with the command

is that you are missing a space before the –username argument flag.

1 Like

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