Uncategorized

Error when trying to run Python / Django project on Docker: “Server Do53:127.0.0.11@53 answered The DNS operation timed out.”


I am attempting to run a Python / Django project within Docker.

After running docker compose up, things start off alright but then crash out:

...
web-1  | [2024-01-09 14:45:03 +0000] [158] [INFO] Booting worker with pid: 158
web-1  | [2024-01-09 14:45:03 +0000] [159] [INFO] Booting worker with pid: 159
web-1  | [2024-01-09 14:45:07 +0000] [133] [ERROR] Exception in worker process
web-1  | Traceback (most recent call last):
web-1  |   File "/usr/local/lib/python3.9/site-packages/eventlet/support/greendns.py", line 491, in getaliases
web-1  |     return resolver.getaliases(host)
web-1  |   File "/usr/local/lib/python3.9/site-packages/eventlet/support/greendns.py", line 422, in getaliases
web-1  |     ans = self._resolver.query(hostname, dns.rdatatype.CNAME)
web-1  |   File "/usr/local/lib/python3.9/site-packages/dns/resolver.py", line 1364, in query
web-1  |     return self.resolve(
web-1  |   File "/usr/local/lib/python3.9/site-packages/dns/resolver.py", line 1321, in resolve
web-1  |     timeout = self._compute_timeout(start, lifetime, resolution.errors)
web-1  |   File "/usr/local/lib/python3.9/site-packages/dns/resolver.py", line 1075, in _compute_timeout
web-1  |     raise LifetimeTimeout(timeout=duration, errors=errors)
web-1  | dns.resolver.LifetimeTimeout: The resolution lifetime expired after 5.402 seconds: Server Do53:127.0.0.11@53 answered The DNS operation timed out.; Server Do53:127.0.0.11@53 answered The DNS operation timed out.; Server Do53:127.0.0.11@53 answered The DNS operation timed out.

I do not understand the meaning of the final error:

dns.resolver.LifetimeTimeout: The resolution lifetime expired after 5.402 seconds: Server Do53:127.0.0.11@53 answered The DNS operation timed out.

I am running Docker v24.0.7 on Windows with the WSL 2 backend.

Others running the same project with seemingly the same Docker set up have not encountered the same issue.

Are there any suggestions for things that I can try to help resolve this?

Please let me know if there is other useful diagnostic information that I can provide. I am relatively new to both Python and Docker, so do not know how to isolate the issue to one area or the other.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *