Enabled Auth / Unable To Do Anything

235 views
Skip to first unread message

cachedrive

unread,
May 30, 2016, 4:26:12 PM5/30/16
to mongodb-user
I was told by my manager our MongoDB replicaSet requires authentication so this weekend I deployed a new 3.2 single instance deployment and created my role w/ the "userAdminAnyDatabase" role. I then restarted my mongod service w/ the --auth parameter and now I'm getting:

> show collections
2016-05-30T20:03:09.108+0000 E QUERY    [thread1] Error: listCollections failed: {
       
"ok" : 0,
       
"errmsg" : "not authorized on healthCatalog to execute command { listCollections: 1.0, filter: {} }",
       
"code" : 13
} :
_getErrorWithCode@src
/mongo/shell/utils.js:25:13
DB
.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:773:1
DB
.prototype.getCollectionInfos@src/mongo/shell/db.js:785:19
DB
.prototype.getCollectionNames@src/mongo/shell/db.js:796:16
shellHelper
.show@src/mongo/shell/utils.js:753:9
shellHelper@src
/mongo/shell/utils.js:650:15
@(shellhelp2):1:1


Anyone know why I am getting the above after authenticating with my user? Did I not apply the correct role to my login?

Kevin Adistambha

unread,
Jun 7, 2016, 1:26:39 AM6/7/16
to mongodb-user

Hi

I was told by my manager our MongoDB replicaSet requires authentication so this weekend I deployed a new 3.2 single instance deployment and created my role w/ the “userAdminAnyDatabase” role. I then restarted my mongod service w/ the —auth parameter and now I’m getting:

show collections
2016-05-30T20:03:09.108+0000 E QUERY [thread1] Error: listCollections failed: {

To be able to list collections, you need the listCollections privilege enabled. This privilege is provided by the dbAdmin role (also by the dbAdminAnyDatabase role, or the superuser root role).

The ‘userAdminAnyDatabase’ role allows the account to create and modify roles and users on any database. However it does not include the listCollections privilege.

Please see the Built-In Roles page for more detail regarding user roles and privileges.

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages