PyMongo 3.7.0 Released

241 views
Skip to first unread message

shane....@10gen.com

unread,
Jun 27, 2018, 3:22:41 PM6/27/18
to mongodb-user
Version 3.7.0 of the MongoDB Python driver has been released. Highlights include support for MongoDB 4.0 - including transactions, change stream enhancements, wire protocol compression, SCRAM-SHA-256 authentication and a whole lot more.

To see the full list of resolved issues in this release, check out our release notes in Jira: 
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=19287 

Docs - https://api.mongodb.org/python/3.7.0/
Changelog - https://api.mongodb.org/python/3.7.0/changelog.html

Thank you to everyone who contributed to this release!

- The PyMongo dev team

yar...@sureapp.com

unread,
Jun 27, 2018, 8:24:40 PM6/27/18
to mongodb-user
Bug report:
(I dislike jira)

Python Version: 3.5.2
pymongo 3.7.0


Traceback:  

File "/usr/local/lib/python3.5/dist-packages/pymongo/database.py" in authenticate
  1274.             connect=True)

File "/usr/local/lib/python3.5/dist-packages/pymongo/mongo_client.py" in _cache_credentials
  604.             raise OperationFailure('Another user is already authenticated '

Exception Type: OperationFailure
Exception Value: Another user is already authenticated to this database. You must logout first.


This does not happen on pymongo 3.6.1

shane....@10gen.com

unread,
Jun 28, 2018, 11:17:35 AM6/28/18
to mongodb-user
Hi Yarden, 

The exception that you're seeing is raised by PyMongo when you attempt to authenticate two users against the same database. For example:

>>> import pymongo
>>> c = pymongo.MongoClient()
>>> c.admin.add_user('admin', 'pass')
>>> c.admin.authenticate('admin', 'pass')
True
>>> c.admin.add_user('other_admin', 'pass')
>>> c.admin.authenticate('other_admin', 'pass')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pymongo/database.py", line 1274, in authenticate
    connect=True)
  File "pymongo/mongo_client.py", line 604, in _cache_credentials
    raise OperationFailure('Another user is already authenticated '
pymongo.errors.OperationFailure: Another user is already authenticated to this database. You must logout first.

So there's not enough information for me to diagnose why you're seeing this error only on 3.7.0 and not 3.6.1. Could you please provide your MongoDB version, how you are calling Database.authenticate (please redact usernames/passwords but please include the mechanism you're using), and what databases you are authenticating to?

Thank you,
Shane

Edward Atkins

unread,
Jul 7, 2018, 2:29:28 AM7/7/18
to mongodb-user
Hi,

I just thought I would raise that I was also experiencing this issue, using the 'mongoengine' library. I was only able to resolve the issue, by forcing mongoengine to use pymongo 3.6.1 under the hood.
I have only one database user, and I was connecting like so:


from mongoengine import connect
connect
(
mongodb://<dbuser>:<dbpassword>@xxxxxx-xx.xxxx.xxx.mlab.com:35597,xxxxxx-xx.xxxxx.xxxxx.mlab.com:35597/<dbname>?replicaSet=xx-xxxxx7&ssl=true)

MongoDB version 3.6.5 FYI

Nguyen Thanh

unread,
Jul 8, 2018, 6:18:05 PM7/8/18
to mongodb-user
You saved my day!

Thanks!

a...@princeton.edu

unread,
Jul 8, 2018, 6:18:05 PM7/8/18
to mongodb-user

shane....@10gen.com

unread,
Jul 9, 2018, 2:21:59 PM7/9/18
to mongodb-user
Thank you all! We're working on a fix for this issue. Feel free to follow along here: https://jira.mongodb.org/browse/PYTHON-1609.

Bernie Hackett

unread,
Jul 9, 2018, 6:43:32 PM7/9/18
to mongodb-user
A fix has been committed to the master branch for this issue. Please try it and let us know if it resolves your issue. We'll do a 3.7.1 release with this fix backported.
Reply all
Reply to author
Forward
0 new messages