Connection error on command line

I am getting below error when trying to connect to mongodb on command line. How can I fix it?

C:\Users\Sid>mongo “mongodb+srv://sandbox-lnijc.mongodb.net/test” --username m001-student
MongoDB shell version v4.0.10
Enter password:
connecting to: mongodb://sandbox-shard-00-01-lnijc.mongodb.net.:27017,sandbox-shard-00-00-lnijc.mongodb.net.:27017,sandbox-shard-00-02-lnijc.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Sandbox-shard-0&ssl=true
2019-07-01T14:27:15.839-0500 I NETWORK [js] Starting new replica set monitor for Sandbox-shard-0/sandbox-shard-00-01-lnijc.mongodb.net.:27017,sandbox-shard-00-00-lnijc.mongodb.net.:27017,sandbox-shard-00-02-lnijc.mongodb.net.:27017
2019-07-01T14:27:16.774-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-02-lnijc.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-02-lnijc.mongodb.net.:27017 with a 5 second timeout)
2019-07-01T14:27:17.063-0500 I NETWORK [js] Successfully connected to sandbox-shard-00-01-lnijc.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-01-lnijc.mongodb.net.:27017 with a 5 second timeout)
2019-07-01T14:27:17.158-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-00-lnijc.mongodb.net:27017 (1 connections now open to sandbox-shard-00-00-lnijc.mongodb.net:27017 with a 5 second timeout)
2019-07-01T14:27:17.194-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] changing hosts to Sandbox-shard-0/sandbox-shard-00-00-lnijc.mongodb.net:27017,sandbox-shard-00-01-lnijc.mongodb.net:27017,sandbox-shard-00-02-lnijc.mongodb.net:27017 from Sandbox-shard-0/sandbox-shard-00-00-lnijc.mongodb.net.:27017,sandbox-shard-00-01-lnijc.mongodb.net.:27017,sandbox-shard-00-02-lnijc.mongodb.net.:27017
2019-07-01T14:27:17.300-0500 I NETWORK [js] Successfully connected to sandbox-shard-00-00-lnijc.mongodb.net.:27017 (1 connections now open to sandbox-shard-00-00-lnijc.mongodb.net.:27017 with a 5 second timeout)
2019-07-01T14:27:17.410-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-01-lnijc.mongodb.net:27017 (1 connections now open to sandbox-shard-00-01-lnijc.mongodb.net:27017 with a 5 second timeout)
2019-07-01T14:27:17.713-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to sandbox-shard-00-02-lnijc.mongodb.net:27017 (1 connections now open to sandbox-shard-00-02-lnijc.mongodb.net:27017 with a 5 second timeout)
2019-07-01T14:27:17.830-0500 I NETWORK [js] Successfully connected to sandbox-shard-00-00-lnijc.mongodb.net:27017 (1 connections now open to sandbox-shard-00-00-lnijc.mongodb.net:27017 with a 0 second timeout)
Implicit session: session { “id” : UUID(“0ff4cc1b-70c7-49fe-ba0c-b1a01d5d4959”) }
MongoDB server version: 4.0.10
Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]
MongoDB Enterprise Sandbox-shard-0:PRIMARY>

It is not an error
You are already connected to the mongodb
It is just a warning that user does not have privileges on admin DB
You can continue with your work
These warning messages can be suppressed by giving additional roles/privs to the user

1 Like

Thank you, I was able to work from command line.
The word “error” in the message threw me off.