Description of problem: today i was running into a situation that when i inserted a record into mongodb, although that record inserted correctly, i got a 500 internal error, it complained about 'OperationFailure: need to login', but it works well in my local box, i googled a lot and find this https://jira.mongodb.org/browse/PYTHON-371 , checked pymongo version in openshift, it was 2.1.1, the workaround of this is specify the version in setup.py ps: https://openshift.redhat.com/community/forums/openshift/use-pymongo-23-instead-of-211
Adam Miller has graciously added python-pymongo 2.3 to our repo. Reproducing this issue now.
Fixed in devenv_2564+, which contains python-pymongo-2.3-6.el6_3.x86_64. Tested using the scenario outlined in https://jira.mongodb.org/browse/PYTHON-371, seems to be working well.
Verified on devenv_2577 python-pymongo-gridfs-2.3-6.el6_3.x86_64 python-pymongo-2.3-6.el6_3.x86_64 Steps: 1. Create python app and embed mongodb-2.2 2. ssh into gear, test using scenario outlined in https://jira.mongodb.org/browse/PYTHON-371 >>> import pymongo >>> c = pymongo.Connection("127.0.250.129:27017") >>> c.py1.authenticate('admin', '9AFwjDmTqJ2n') True >>> c.py1.foo.insert({'foo': 'bar'}) ObjectId('50c54a5c066f7158bcca2fb7') >>> c.py1.foo.insert({'foo': 'bar'}, safe=True) ObjectId('50c54a62066f7158bcca2fb8') >>> c.py1.foo.find() <pymongo.cursor.Cursor object at 0x7fcbddda4590> >>> c.py1.foo.find_one() {u'_id': ObjectId('50c54a5c066f7158bcca2fb7'), u'foo': u'bar'