Pymongo 3.9.0 and srv string compatibility

Hi,

I am have an issue connecting to the m-flix database using the srv string provided. It worked before, and I was able to go through the course tickets, however because I am trying to understand the (custom) server selector functionality, I upgraded pymongo from the required 3.7.2 to 3.9.0, and apparently it broke the connection. is pymongo 3.9.0 known not to play nice with the srv string, or there is anything that needs to be done differently?

note: I can connect to the cluster with the given srv using mongo though.

This is what the server logs look like (I am not passing any kwarg called lifetime)

This is how the test fail

and this is how my .ini file look like (without the usernane:password )

[PROD]
SECRET_KEY = thisismechangingthesecretkeytoseeifitworks
MFLIX_DB_URI = mongodb+srv://xxxxxx:xxxxxx@mflix-mnssa.mongodb.net/test?ssl=true&ssl_cert_reqs=CERT_NONE&retryWrites=true&w=majority
MFLIX_NS = sample_mflix

[TEST]
SECRET_KEY = thisismechangingthesecretkeytoseeifitworks
MFLIX_DB_URI = mongodb+srv://xxxxxx:xxxxxxx@mflix-mnssa.mongodb.net/test?ssl=true&ssl_cert_reqs=CERT_NONE&retryWrites=true&w=majority
MFLIX_NS = sample_mflix

These requirements are strict and if you want to successfully complete this course without much hiccup, it’s best to stick to them. See here.

You can try upgrading dnspython but the better solution is to downgrade back to 3.7.2 as per requirements.

Hi @Euclides_04014,

Let me know if you are still facing the issue.

Kanika

Hi @kanikasingla,

Thank you for checking.

It resolved, and I was able to finish the course.

regards

Thank you @007_jb for the useful information.