Details
-
Bug
-
Resolution: Cannot Reproduce
-
Major - P3
-
None
-
1.9, 1.9.1, 1.9.2
-
Windows 7
Description
I have enabled auth on MongoDB and created an admin user using:
db.createUser(
|
{
|
user: "admin",
|
pwd: "***",
|
roles:
|
[
|
{ role: "root", db: "admin" },
|
{ role: "dbAdminAnyDatabase", db: "admin" },
|
{ role: "readWriteAnyDatabase", db: "admin" },
|
{ role: "readWrite", db: "deadline7db" },
|
{ role: "dbOwner", db: "deadline7db" },
|
{ role: "dbAdmin", db: "deadline7db" },
|
{ role: "readWrite", db: "admin" },
|
{ role: "dbOwner", db: "deadline7db_Jobs" },
|
{ role: "dbOwner", db: "deadline7db_Tasks" },
|
{ role: "dbAdmin", db: "deadline7db_Jobs" },
|
]
|
}
|
)
|
When I am trying to connect my application to this database using this user and password, it is connecting fine but throwing an error when trying to create index on deadline7db_Jobs.Job collection.
Below is the error:
Command 'createIndexes' failed: not authorized on deadline7db_Jobs to execute command { createIndexes: "Jobs", indexes: [ { ns: "deadline7db_Jobs.Jobs", name: "Stat_1_Props.Pool_1_Props.Grp_1_IsSub_1", key: { Stat: 1, Props.Pool: 1, Props.Grp: 1, IsSub: 1 } } ] } (response: { "ok" : 0.0, "errmsg" : "not authorized on deadline7db_Jobs to execute command { createIndexes: \"Jobs\", indexes: [ { ns: \"deadline7db_Jobs.Jobs\", name: \"Stat_1_Props.Pool_1_Props.Grp_1_IsSub_1\", key: { Stat: 1, Props.Pool: 1, Props.Grp: 1, IsSub: 1 } } ] }", "code" : 13 }).
|
I can create index from Mongo shell.