The DNS Operation timed out after xxxxxx seconds. Followed all the steps in READ.ME but not able to resolve the errors. This happened when i did pytest -m connection Please help

Please check the connection string in .ini file. Also, don’t forget to whitelist the IP from atlas.


Connection string is correct. Whitelisted the IP address too. But still I am getting error message.

Due to this I will not be able to complete my assignments on time. Whom should I contact to request for the extended time to submit assignments.?


Are you working on your office system? Then firewall might be the issue.

Please share the contents of the .ini file and a screenshot of the error.

Unfortunately we cannot do that. But you can still access the course content or can register for the next offering which starts every Tuesday. :slight_smile: My suggestion would be register for the next offering after this issue is fixed.



Ticket: Connection

Rename this file to .ini after filling in your MFLIX_DB_URI and your SECRET_KEY

Do not surround the URI with quotes

SECRET_KEY = super_secret_key_you_should_change
MFLIX_DB_URI = mongodb+srv://
MFLIX_NS = sample_mflix

SECRET_KEY = super_secret_testing_key
MFLIX_DB_URI = mongodb+srv://
MFLIX_NS = sample_mflix

This is my .ini file. what should be the secret_key?. It is not mentioned anywhere in the course about secret key.

No. I am not using office system.


I can’t tell you… it’s secret :wink:

I was able to connect to your Atlas Cluster using the SRV connection strings you provided. Try and connect via a terminal:
mongo "mongodb+srv://"

As for the secret key, you can create one yourself. It’s not mandatory, it’s there for extra internal “security”.

Is it a kind of password ?. Please check my screen shot for the error message I am getting.

But I am not able to connect. You could have seen my error messages for test

Yes, you can see it as some kind of password.

The error I’m seeing is when you run it through pytest. Because it’s a DNS error, what I’m asking you to try is to connect to your Atlas Cluster using the mongo shell:

  1. Open command prompt or your OS terminal
  2. Paste and run the following:
    mongo "mongodb+srv://"

What is the result?

1 Like


Your connection from shell seems to be ok
Are you able to run from your config file?
Did you get details on generating secret_key
Please check this link

Where to take value for SECRET_KEY?