pymongo.errors.ConfigurationError

I can run the MFLIX application before. But after I shut down my computer and start it again, I got below error when I run the MFLIX application. Could someone got the same error or someone who know how to fix it? Thanks
C:\root\learn\mongodbPython\mflix-python\mflix_venv\Scripts\python.exe C:/root/learn/mongodbPython/mflix-python/run.py
_ * Serving Flask app “mflix.factory” (lazy loading)_
_ * Environment: production_
_ WARNING: Do not use the development server in a production environment._
_ Use a production WSGI server instead._
_ * Debug mode: on_
_ * Restarting with stat_
_ * Debugger is active!_
_ * Debugger PIN: 209-401-764_
_ * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)_
127.0.0.1 - - [21/Feb/2019 19:51:59] “GET / HTTP/1.1” 200 -
127.0.0.1 - - [21/Feb/2019 19:52:00] “GET /static/css/main.d2c98b4b.chunk.css HTTP/1.1” 200 -
127.0.0.1 - - [21/Feb/2019 19:52:00] “GET /static/js/main.81b71a0a.chunk.js HTTP/1.1” 200 -
127.0.0.1 - - [21/Feb/2019 19:52:00] “GET /static/media/mongoleaf.0ebc1843.png HTTP/1.1” 200 -
127.0.0.1 - - [21/Feb/2019 19:52:01] “GET /api/v1/movies/ HTTP/1.1” 500 -
Traceback (most recent call last):
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask\app.py”, line 2309, in call_
_ return self.wsgi_app(environ, start_response)_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask\app.py”, line 2295, in wsgi_app_
_ response = self.handle_exception(e)_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask_cors\extension.py”, line 161, in wrapped_function_
_ return cors_after_request(app.make_response(f(*args, **kwargs)))_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask\app.py”, line 1741, in handle_exception_
_ reraise(exc_type, exc_value, tb)_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask_compat.py”, line 35, in reraise_
_ raise value_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask\app.py”, line 2292, in wsgi_app_
_ response = self.full_dispatch_request()_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask\app.py”, line 1815, in full_dispatch_request_
_ rv = self.handle_user_exception(e)_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask_cors\extension.py”, line 161, in wrapped_function_
_ return cors_after_request(app.make_response(f(args, **kwargs)))_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask\app.py”, line 1718, in handle_user_exception_
_ reraise(exc_type, exc_value, tb)_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask_compat.py”, line 35, in reraise_
_ raise value_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask\app.py”, line 1813, in full_dispatch_request_
_ rv = self.dispatch_request()_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\flask\app.py”, line 1799, in dispatch_request_
_ return self.view_functionsrule.endpoint_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix\api\movies.py”, line 26, in api_get_movies_
_ None, page=0, movies_per_page=MOVIES_PER_PAGE)_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix\db.py”, line 223, in get_movies_
_ cursor = db.movies.find(query).sort(sort).skip(page
movies_per_page)_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\werkzeug\local.py”, line 347, in getattr_
_ return getattr(self.get_current_object(), name)
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\werkzeug\local.py”, line 306, in get_current_object
_ return self.local()
_ File “C:\root\learn\mongodbPython\mflix-python\mflix\db.py”, line 46, in get_db

_ MFLIX_DB_URI,_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\pymongo\mongo_client.py”, line 494, in init_
_ res = uri_parser.parse_uri(entity, port, warn=True)_
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\pymongo\uri_parser.py”, line 399, in parse_uri_
_ nodes = get_dns_srv_hosts(fqdn)
_ File “C:\root\learn\mongodbPython\mflix-python\mflix_venv\lib\site-packages\pymongo\uri_parser.py”, line 289, in get_dns_srv_hosts
_ raise ConfigurationError(str(exc))_
_pymongo.errors.ConfigurationError: The DNS response does not contain an answer to the question: _mongodb.tcp.mflix-zudw1.mongodb.net. IN SRV

Today, I can run it again. It’s very strange!

1 Like

Hahaha… Sometimes :crazy_face: