[SERVER-1899]  db.runCommand({serverStatus : 1, repl : 2}) FAILS with authentication Created: 06/Oct/10  Updated: 12/Jul/16  Resolved: 13/Jan/11

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 1.6.3
Fix Version/s: 1.7.5

Type: Bug Priority: Blocker - P1
Reporter: Chas Wareing Assignee: Kristina Chodorow (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongo-stable-20100930-mongodb_1, mongo-stable-server-20100930-mongodb_1, Centos 5.3 x86_64,


Operating System: Linux
Participants:

 Description   

We're trying to get lagSeconds out of
db.runCommand(

{serverStatus : 1, repl : 2}

)
or
db._adminCommand(

{serverStatus:1,repl:2}

)
or
(python)
serverStatus = db.command(bson.son.SON([('serverStatus', 1), ('repl', 2)]))

getting the following error in the master's log
assertion 10057 unauthorized db:local lock type:-1

and this message is on the slave object (notice it doesn't list the sources at all)

"repl" :

{ "ismaster" : false, "sources" : [ ] }

,
"assertion" : "nextSafe():

{ $err: \"unauthorized db:local lock type:-1 client:10.0.0.27\", code: 10057 }

",
"assertionCode" : 13106,
"errmsg" : "db assertion failure",
"ok" : 0

I'm authenticating as the repl user, which exists on both master and slave, in the local db
db.auth("repl", "...");

I'm working on a authenticated nagios monitoring plugin..



 Comments   
Comment by auto [ 13/Jan/11 ]

Author:

{u'login': u'kchodorow', u'name': u'Kristina', u'email': u'kristina@10gen.com'}

Message: auth context if necessary SERVER-1899
https://github.com/mongodb/mongo/commit/71f257f2c5275b62521422ad8a960b4c0b104a2a

Comment by Byron Albert [ 04/Jan/11 ]

I just saw this same issue on 1.6.5, found if i do a db.runCommand(

{serverStatus : 1, repl : 1}

) it works and i get the data i need.

Byron

Generated at Thu Feb 08 02:58:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.