Reproduce with the following:
adminDb = db.getSiblingDB("admin") testDb = db.getSiblingDB("testdb") adminDb.addUser({user:'admin',pwd:'password',roles:['userAdminAnyDatabase']}) adminDb.auth('admin','password') testDb.addUser({user:'readUser',pwd:'password',roles:['read']})
When run against mongod --auth, version 2.4.0-rc0:
Fri Feb 8 17:23:28.298 [conn1] insert testdb.system.users keyUpdates:0 exception: not authorized to create index on testdb.system.users code:16548 locks(micros) w:578348 578ms
The above failure occurs because user admin does not have readWrite on testdb, and the insert into testdb.system.users fails during the index creation step.