Eventlet 0.20.0 breaks dns resolution in nameko
See original GitHub issueI seem to have hit a very strange bug running nameko inside of docker-compose At this point, i’m able to get around the issue, but I would like to know if eventlet or docker is doing something wrong.
Docker: Version 1.12.3 (13776) Channel: Stable 583d1b8ffe
nameko version 2.3.1
Traceback from inside the container.
[root@ba50a39f5dbb app]# nameko run --config ./cfg/nameko.yaml blah.blah.service:blahService
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/eventlet-0.20.0-py2.7.egg/eventlet/hubs/poll.py", line 115, in wait
listener.cb(fileno)
File "/usr/lib/python2.7/site-packages/eventlet-0.20.0-py2.7.egg/eventlet/greenthread.py", line 214, in main
result = function(*args, **kwargs)
File "build/bdist.linux-x86_64/egg/nameko/utils.py", line 175, in call
return getattr(item, name)(*args, **kwargs)
File "build/bdist.linux-x86_64/egg/nameko/messaging.py", line 191, in setup
verify_amqp_uri(self.amqp_uri)
File "build/bdist.linux-x86_64/egg/nameko/amqp.py", line 43, in verify_amqp_uri
with transport.establish_connection():
File "/usr/lib/python2.7/site-packages/kombu-4.0.2-py2.7.egg/kombu/transport/pyamqp.py", line 130, in establish_connection
conn.connect()
File "/usr/lib/python2.7/site-packages/amqp-2.1.4-py2.7.egg/amqp/connection.py", line 294, in connect
self.transport.connect()
File "/usr/lib/python2.7/site-packages/amqp-2.1.4-py2.7.egg/amqp/transport.py", line 120, in connect
self._connect(self.host, self.port, self.connect_timeout)
File "/usr/lib/python2.7/site-packages/amqp-2.1.4-py2.7.egg/amqp/transport.py", line 150, in _connect
host, port, 0, socket.SOCK_STREAM, SOL_TCP,
File "/usr/lib/python2.7/site-packages/eventlet-0.20.0-py2.7.egg/eventlet/support/greendns.py", line 464, in getaddrinfo
raise socket.gaierror(socket.EAI_NONAME, 'No address found')
gaierror: [Errno -2] No address found
The host dns resolves with a non authoritive response, but all dns functions work correctly from the container itself.
Pinning the version of eventlet to 0.16.1 seems to stop the issue from occurring.
Is the eventlet dns client implementation known to have issues?
thanks in advance! 😃 Rob
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (10 by maintainers)
Top Results From Across the Web
Django Celery Eventlet - Getting "No address found" error
If you're using Eventlet 0.20.0, it looks like that might break DNS resolution. See: https://github.com/nameko/nameko/issues/392.
Read more >Django Celery Eventlet - Getting "No address found" error- ...
"No address found" looks like an error with DNS resolution. If you can resolve the address of your rabbitmq server, the problem may...
Read more >DNS resolution through eventlet contact nameservers ...
When trying to resolve a hostname on a node with no nameservers configured and only one entry is present for it in /etc/hosts...
Read more >1651716 – python-eventlet is missing requires on dns ...
Description of problem: After 0.24.0, eventlet is not longer bundling dns, monotonic and six and they have been added as dependencies in ...
Read more >Eventlet's sublib dnspython version 2.0.0 is breaking all release ...
Eventlet's sublib dnspython version 2.0.0 is breaking all release of nameko connecting to ... Trying to run nameko service like nameko run gateway.service....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There are a couple of threads of conversation happening here now. Let me try to summarise:
Kombu 4.0 requires eventlet 0.2.0, but nameko pins kombu to 3.0.37, so this is irrelevant. #378 is not related.
Eventlet 0.2.0 bundles dnspython and seems to use it to monkeypatch the
socket
library’s DNS functions. Unfortunately dnspython doesn’t have exactly the same behaviour – in particular, it won’t resolve a fully qualified domain name without a.
at the end if there’s a search domain specified. From what I understand about DNS that’s the correct behaviour, but the fact thatsocket.getaddrinfo
behaves differently suggests there’s bug is in eventlet’s assumption that they’re equivalent.Hi @manfred-chebli & @rgardam have you docker “linked” your
broker
container to your service container? Or do you just rely on Docker embedded DNS server by simply using the name (broker
in your case) of the container?Once we’ve upgraded to master version of Eventlet (before they cut 0.20 release, we needed it to use a fix to HTTPS body parsing https://github.com/eventlet/eventlet/blob/master/NEWS#L8) we noticed that Docker embedded DNS name resolution does not work any more.
Since
eventlet
vendoreddnspython
I’ve opened issue directly withdnspython
here https://github.com/rthalley/dnspython/issues/219 but they said this is expected behaviour. There is a gist to reproduce the issue.The workaround we’ve employed for now is to trick
dnspython
into thinking that our container names are fully qualified domains by adding period.
to the url. In your case it would beamqp://user:pass@broker.:5672
I think by using
dnspython
for dns resolutioneventlet
broke some functionality.