Skip to content

Conversation

@joackobengochea
Copy link

Fixes issue #133

@dcrosta
Copy link
Contributor

dcrosta commented Sep 6, 2019

Can you show code that reproduces the error here? The description in #133 doesn't explain how or why that lifetime argument is being used. (It doesn't appear within flask-pymongo code at all)

@joackobengochea
Copy link
Author

Sorry, looking a bit deeper we found out it's a bug in pymongo 3.9, I'll make a PR there

@joackobengochea
Copy link
Author

@7i11
Copy link

7i11 commented Sep 6, 2019

to clarify, in the mongodb driver, a tag(3.9.0) was pushed where the lifetime is removed, but in the srv_resolver,this kwarg(lifetime) is still passed, so, if you use a connection string mongodb+srv://, use this srv_resolver which ends in an exception.
tag commit here
here, the file that need to be changed

@dcrosta
Copy link
Contributor

dcrosta commented Sep 7, 2019

OK -- that seems like it's on the MongoDB folks to fix. If you think that there's more we should do here, please re-open this PR or let me know, but for now I'm closing this.

@ghost
Copy link

ghost commented Jun 25, 2020

This issue still exists for me, I still get the error:

Trying to connect
db = MongoClient('mongodb+srv://:kicapstone.14opf.mongodb.net/').capstone

Gives me
pymongo.errors.ConfigurationError: query() got an unexpected keyword argument 'lifetime'

I tried using the SRVResolver as mentioned by 7i11, which just gives me another error:
db = MongoClient(SRVResolver.resolve('mongodb+srv://:kicapstone.14opf.mongodb.net/')).capstone

Gives me
dns.resolver.NXDOMAIN: None of DNS query names exist:
mongodb+srv://user:pw@kicapstone.14opf.mongodb.net/.,
mongodb+srv://user:pw@kicapstone.14opf.mongodb.net/.home.

Does anyone have any idea how to solve this?

@ghost
Copy link

ghost commented Jul 5, 2020

This issue still exists for me, I still get the error:

Trying to connect
db = MongoClient('mongodb+srv://:kicapstone.14opf.mongodb.net/').capstone

Gives me
pymongo.errors.ConfigurationError: query() got an unexpected keyword argument 'lifetime'

I tried using the SRVResolver as mentioned by 7i11, which just gives me another error:
db = MongoClient(SRVResolver.resolve('mongodb+srv://:kicapstone.14opf.mongodb.net/')).capstone

Gives me
dns.resolver.NXDOMAIN: None of DNS query names exist:
mongodb+srv://user:pw@kicapstone.14opf.mongodb.net/.,
mongodb+srv://user:pw@kicapstone.14opf.mongodb.net/.home.

Does anyone have any idea how to solve this?

Actually, moving through the other issues linked to this, I was able to fix the problem. The problem was with dnspython, as I had installed dnspython 1.15. Version 1.16 solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants