Re: [mongodb-user] Authorization needed on config db after update from 2.0.2 to 2.2.3

305 views
Skip to first unread message

Jorge Puente Sarrín

unread,
Feb 16, 2013, 12:49:57 AM2/16/13
to mongod...@googlegroups.com

Hello Ivan.

What PyMongo version are you using?

El 16/02/2013 00:45, "Ivan Filimonov" <sunri...@gmail.com> escribió:
Hi.

Today i've updated my system from 2.0.2 version to 2.2.3. After update i'm receiving various authorisation error on mongos instances. Here are some examples:

mongos> show dbs
Sat Feb 16 05:03:09 uncaught exception: listDatabases failed:{
"errmsg" : "exception: runCommand ({ listDatabases: 1 }) on shard (magic_0) failed : { errmsg: \"need to login\", ok: 0.0 }",
"code" : 13136,
"ok" : 0
}

mongos> sh.status();
Sat Feb 16 05:03:30 uncaught exception: group command failed: {
"assertion" : "unauthorized db:config ns:config.\u0003cond lock type:0 client:95.x.x.212",
"assertionCode" : 10057,
"errmsg" : "db assertion failure",
"ok" : 0
}

mongos> db.settings.update( { _id: "balancer" }, { $set : { stopped: true } } , true );
Sat Feb 16 05:04:16 uncaught exception: getlasterror failed: {
"singleShard" : "magic_0/62.x.x.210:27017,mp.xxx.com:27018,vp-backup.xxx.com:27018",
"errmsg" : "need to login",
"ok" : 0
}

mongos> sh.stopBalancer();
Waiting for active hosts...
Waiting for active host C010.local:27018 to recognize new settings... (ping : Fri Oct 12 2012 01:52:39 GMT+0000 (UTC))
Waited for active ping to change for host PRWC010.local:27018, a migration may be in progress or the host may be down.
Waiting for active host C013.local:27017 to recognize new settings... (ping : Sat Feb 16 2013 03:33:24 GMT+0000 (UTC))
Waited for active ping to change for host PRWC013.local:27017, a migration may be in progress or the host may be down.
Waiting for active host C011.wyse:27027 to recognize new settings... (ping : Sat Feb 16 2013 03:32:18 GMT+0000 (UTC))
Waited for active ping to change for host PRWC011.wyse:27027, a migration may be in progress or the host may be down.
Waiting for the balancer lock...
Waiting again for active hosts after balancer is off...
Waiting for active host C010.local:27018 to recognize new settings... (ping : Fri Oct 12 2012 01:52:39 GMT+0000 (UTC))
Waited for active ping to change for host PRWC010.local:27018, a migration may be in progress or the host may be down.
Waiting for active host C013.local:27017 to recognize new settings... (ping : Sat Feb 16 2013 03:33:24 GMT+0000 (UTC))
Waited for active ping to change for host PRWC013.local:27017, a migration may be in progress or the host may be down.
Waiting for active host C011.wyse:27027 to recognize new settings... (ping : Sat Feb 16 2013 03:32:18 GMT+0000 (UTC))
Waited for active ping to change for host PRWC011.wyse:27027, a migration may be in progress or the host may be down.
Warning : host PRWC010.local:27018 seems to have been offline since Fri Oct 12 2012 01:52:39 GMT+0000 (UTC)
Warning : host PRWC013.local:27017 seems to have been offline since Sat Feb 16 2013 03:33:24 GMT+0000 (UTC)
Warning : host PRWC011.wyse:27027 seems to have been offline since Sat Feb 16 2013 03:32:18 GMT+0000 (UTC)
Sat Feb 16 05:06:06 uncaught exception: getlasterror failed: {
"singleShard" : "mp.xxx.com:27019,85.x.x.217:27018,62.x.x.210:27018",
"errmsg" : "need to login",
"ok" : 0
}

And some from python:
  File "/usr/home/vp/python/lib/python2.7/site-packages/pymongo/collection.py", line 913, in ensure_index
    raise OperationFailure(msg % errmsg)
pymongo.errors.OperationFailure: need to login
    return self.create_index(key_or_list, cache_for, **kwargs)
  File "/usr/home/vp/python/lib/python2.7/site-packages/pymongo/collection.py", line 821, in create_index
    **self._get_wc_override())
  File "/usr/home/vp/python/lib/python2.7/site-packages/pymongo/collection.py", line 359, in insert
    continue_on_error, self.__uuid_subtype), safe)
  File "/usr/home/vp/python/lib/python2.7/site-packages/pymongo/mongo_client.py", line 844, in _send_message
    rv = self.__check_response_to_last_error(response)
  File "/usr/home/vp/python/lib/python2.7/site-packages/pymongo/mongo_client.py", line 765, in __check_response_to_last_error
    helpers._check_command_response(error, self.disconnect)
  File "/usr/home/vp/python/lib/python2.7/site-packages/pymongo/helpers.py", line 147, in _check_command_response
    raise OperationFailure(msg % errmsg)
pymongo.errors.OperationFailure: need to login

During update procedure i've forgotten to stop balancer. I'm not using user based authorization, just keyfiles. Keyfiles are the same on all machines. 
The system worked on production before update without any db-related problems. There are two shards each of them is replica set made from 3 replicas. Please, help.



--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ivan Filimonov

unread,
Feb 16, 2013, 1:03:46 AM2/16/13
to mongod...@googlegroups.com
>>> import pymongo
>>> pymongo.version     
'2.4.2'

Jorge Puente Sarrín

unread,
Feb 16, 2013, 1:18:37 AM2/16/13
to mongod...@googlegroups.com

It's strange. I had similar problems 5 months ago, I was using PyMongo 2.2 with MongoDB 2.1.
With the help from Bernie and Jesse, I can understand that the solution was to update PyMongo's version.

Look this Jira case:
https://jira.mongodb.org/browse/PYTHON-371

Ivan Filimonov

unread,
Feb 16, 2013, 1:51:00 AM2/16/13
to mongod...@googlegroups.com
With 2.0.3 version it also didn't work. As far as i discovered already, there is no 100% reproduce for this problem. Many users reported that they just restarted some nodes in the system and it's ok... I'm not so lucky, yet.

Ivan Filimonov

unread,
Feb 16, 2013, 3:44:54 AM2/16/13
to mongod...@googlegroups.com
And the most sad thing of all:

Sat Feb 16 08:43:30 ERROR: output of listDatabases isn't what we expected, no 'databases' field:
{ errmsg: "exception: runCommand ({ listDatabases: 1 }) on shard (magic_0) failed : { errmsg: "need to login", ok: 0.0 }", code: 13136, ok: 0.0 }

Bernie Hackett

unread,
Feb 16, 2013, 11:01:12 AM2/16/13
to mongod...@googlegroups.com
> I'm not using user based authorization, just keyfiles. Keyfiles are the same on all machines.

Are you saying you don't have any user credentials in any database,
including the 'admin' database? Once you enable authentication using
the 'keyFile' option, any non-localhost clients will have to
authenticate to the database they are trying to access. Once you add a
user to the 'admin' database all localhost clients will also have to
authenticate. You can read more about authentication here:

http://docs.mongodb.org/manual/administration/security/#authentication

You may also be hitting this bug if you don't have any user
credentials: https://jira.mongodb.org/browse/SERVER-6591
Reply all
Reply to author
Forward
0 new messages