33

I want to connect to a remote database using Robomongo. I can connect to to database but an error says that:
Failed to load list of databases
enter image description here

What should I do?

ehsan shirzadi
  • 4,138
  • 12
  • 57
  • 99
  • 1
    having same problem. It was been working previously but now stopped. "Cannot connect to the MongoDB at xx.xx.xx.xx:443. Error: Failed to execute "listdatabases" command." – arvindwill Mar 07 '17 at 05:54
  • I've noticed this happens when I'm using certain versions of the official `mongo` docker images. Since this error is a permissions thing, it seems like there is some inconsistency with how their images are built when it comes to authentication. – heez Oct 29 '18 at 20:27
  • Had this issue when connecting to Mongo 4.1.6 in docker via Robo 3T. Worked fined with dockerized mongo 3.4.18 though. – Patrik Stas Dec 22 '18 at 12:38

13 Answers13

59

It took me 7 days to figure it out. When I have upgraded to Robo 3T version 1.3. it started working just fine. My previous version was 1.2.

Good to know if you are having this issue.

storagemode11
  • 760
  • 3
  • 8
9

In my experience, it is related to failed database user/password authentication. So probably your IP connection to server is successful but you failed to connect to db. I suggest to double check your database username/password and try again.

And better to show what is inside "Show error details".

Gokhan Simsek
  • 253
  • 1
  • 4
  • There is not any passwords available! Do I have to set a password? – ehsan shirzadi Oct 24 '16 at 09:08
  • Can you also share "Error Details", and which remote database are you using? For example for Mongo Atlas, you should define database user/password. – Gokhan Simsek Oct 31 '16 at 15:30
  • No details! only this error! the details says again the same error – ehsan shirzadi Oct 31 '16 at 20:34
  • There is error details, you are missing, you should click "Show error details" – Gokhan Simsek Nov 01 '16 at 08:53
  • 2
    did anyone solve this problem? cause i'm running into the same issue after setting up mongodb on a vps at digital ocean. I can connect remotely, i can connect through ssh tunnel too, but I can't connect normally. The authentication fails, and the details of the error is : "network error while attempting to run command 'buildInfo' ". I've tried everything.. – Radioreve Feb 10 '17 at 06:49
9

Go to Connection Settings -> Authentication - Provide Database name, username, password - Now test the connection I ran into the same issue, then I provided the above info which solved my issue

Refer: (Vaibhav's post) Point 3.Populate DB name and username and password How to connect Robomongo to MongoDB

Community
  • 1
  • 1
srk
  • 91
  • 1
  • 4
4

This is because whatever user you are connecting as does not have the privileges to list the databases.

https://docs.mongodb.com/manual/reference/built-in-roles/

Note that a user/role can connect and interact with a specific database/collection, but in order for Robomongo to list out the databases/collections, you need to let it connect to your database using a user that has listDatabases privileges.

check that your user has read/write & list all Databases privileges.

ofir_aghai
  • 2,223
  • 1
  • 28
  • 33
Jooeun Lee
  • 331
  • 4
  • 18
  • 2
    u can use this to grant privileges https://stackoverflow.com/questions/22638258/create-superuser-in-mongo – HMagdy Jan 15 '18 at 19:43
4

I have faced the same problem after updating the MongoDB version from 3.6 to 4.2 and previously I was using the Robo 3T version 1.2. So I just updated the Robo 3T version from 1.2 to 1.3 and it's started working again.

Keshav Lodhi
  • 1,010
  • 1
  • 8
  • 12
1

I had the same error ("failed to load a list of databases"). Due to some reason all my databases and collections got removed. Apparently, Robomongo couldn't handle the situation when there are no databases/collections available on the server.

To solve the issue, I connected to Mongo Shell, created a database, and created a collection there:

mongo (start mongo shell)
use local (create database named local)
db.createCollection("somename")

After that, I could connect to the Mongo server

Update: I've faced this issue again, and this time it has been caused by the fact that it was a new Mongo installation on a virtual machine, and connections from other hosts weren't allowed, so I had to modify bindIP from 127.0.0.1 to 0.0.0.0 in /etc/mongod.conf

net:
   bindIp: 0.0.0.0
   port: 27017

and restart mongo sudo service mongod restart

Zhenya
  • 4,863
  • 5
  • 29
  • 38
1

Got the same issue when using mongodb version v4.2.0, but the auth settings don't help. Keep getting the following logs when connecting from Robo 3T(i.e.mongoRobo).

2019-09-30T16:41:52.286-0400 I  NETWORK  [listener] connection accepted from 127.0.0.1:53862 #1 (1 connection now open)
2019-09-30T16:41:52.286-0400 I  NETWORK  [conn1] received client metadata from 127.0.0.1:53862 conn1: { application: { name: "robo3t" }, driver: { name: "MongoDB Internal Client", version: "3.4.3-10-g865d2fb" }, os: { type: "Darwin", name: "Mac OS X", architecture: "x86_64", version: "17.7.0" } }
2019-09-30T16:41:52.292-0400 E  -        [conn1] Assertion: Location34348: cannot translate opcode 2010 src/mongo/rpc/message.h 120
2019-09-30T16:41:52.292-0400 I  NETWORK  [conn1] DBException handling request, closing client connection: Location34348: cannot translate opcode 2010
2019-09-30T16:41:52.292-0400 I  NETWORK  [conn1] end connection 127.0.0.1:53862 (0 connections now open)

Finally resolved it by upgrading Robo 3T to v1.3(mac)

Evelyn
  • 11
  • 3
  • 1
    you can write your solution as an answer, if you have resolved it (and mark it as accepted solution), so that others can see the way to solve this problem. – Sourabh Bhagat Sep 30 '19 at 21:10
1

I just found out that I have to upgrade to the latest version that supports latest version of MongoDB. It worked without any authentication.

0

If you are using mongod --auth --dbpath /data/db1 command to start MongoDB, remove --auth and start it.

mongod --dbpath /data/db1

Now Robomongo will be able to connect without authentication. But starting without authentication is not safe. So take another terminal and create a user for your db using mongo command as described in this article.

use myDB
db.createUser(
  {
    user: "myUserAdmin",
    pwd: "abc123",
    roles: [ { role: "dbAdminAnyDatabase", db: "admin" } ]
  }
)

Now restart your MongoDB with --auth. Connect with Robomongo after configuring above authentication details in its connection settings.

mongod --auth --dbpath /data/db1

Vadakkumpadath
  • 1,265
  • 11
  • 21
0

I had the same problem (using Robomongo), then, I created an user with his password to connect to the database, and now It is working ok

Pablo Ezequiel Inchausti
  • 6,869
  • 4
  • 23
  • 37
0

In my case i changed the configurations of my connection:

You go to: Manager connection >> Edit >> authentication >> rename to database to: admin

when I loaded the my connection all databases appeared.

0

Start mongod process. Start mongo process.

On the mongo shell you have opened type first rs.status() then rs.initiate() then rs.status().

Justice Bringer
  • 597
  • 6
  • 19
0

My version is 1.4.3 Robo3T.

What worked for me is;

  1. Go to MongoDB Connections and edit related connection
  2. Go to Connection Settings
  3. Under Authentication tab check the "Manually Specify visible databases" and fill in the dbName you need to access.

It should fix.

Syscall
  • 16,959
  • 9
  • 22
  • 41
oguz
  • 161
  • 1
  • 6