Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new monotonic broken on docker? #401

Open
davidszotten opened this issue Apr 7, 2017 · 57 comments · Fixed by AppScale/gts#2651
Open

new monotonic broken on docker? #401

davidszotten opened this issue Apr 7, 2017 · 57 comments · Fixed by AppScale/gts#2651
Milestone

Comments

@davidszotten
Copy link
Contributor

$ cat Dockerfile
FROM python:2.7
RUN pip install eventlet==0.21.0
CMD python -c 'import eventlet; eventlet.monkey_patch(); eventlet.listen(("localhost", 8000))'
$ docker build .
Sending build context to Docker daemon 3.584 kB
Step 1 : FROM python:2.7
 ---> 68caceba17ab
Step 2 : RUN pip install eventlet==0.21.0
 ---> Using cache
 ---> 59c6976d7a1a
Step 3 : RUN python -c 'import eventlet; eventlet.monkey_patch(); eventlet.listen(("localhost", 8000))'
 ---> Running in 1aab15c49d2b
Exception AttributeError: "'_SocketDuckForFd' object has no attribute '_closed'" in <bound method _SocketDuckForFd.__del__ of _SocketDuckForFd:8> ignored
Exception AttributeError: "'_SocketDuckForFd' object has no attribute '_closed'" in <bound method _SocketDuckForFd.__del__ of _SocketDuckForFd:9> ignored
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/eventlet/convenience.py", line 40, in listen
    sock = socket.socket(family, socket.SOCK_STREAM)
  File "/usr/local/lib/python2.7/site-packages/eventlet/greenio/base.py", line 137, in __init__
    notify_opened(fd.fileno())
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 189, in notify_opened
    hub = get_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 116, in get_hub
    use_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 70, in use_hub
    mod = get_default_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 38, in get_default_hub
    import eventlet.hubs.epolls
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/epolls.py", line 27, in <module>
    from eventlet.hubs.hub import BaseHub
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 23, in <module>
    from eventlet.support import greenlets as greenlet, clear_sys_exc_info, monotonic, six
  File "/usr/local/lib/python2.7/site-packages/eventlet/support/monotonic.py", line 167, in <module>
    raise RuntimeError('no suitable implementation for this system')
RuntimeError: no suitable implementation for this system
@mvdbertram
Copy link

same error happens also when running not within docker, but also on debian jessie

@temoto
Copy link
Member

temoto commented Apr 7, 2017

Thanks for reproduction script.

@temoto
Copy link
Member

temoto commented Apr 7, 2017

The real issue, of course, has nothing to do with monotonic. But it does false help by masking real exception. Real issue is import cycle.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/eventlet/convenience.py", line 40, in listen
    sock = socket.socket(family, socket.SOCK_STREAM)
  File "/usr/local/lib/python2.7/site-packages/eventlet/greenio/base.py", line 137, in __init__
    notify_opened(fd.fileno())
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 189, in notify_opened
    hub = get_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 116, in get_hub
    use_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 70, in use_hub
    mod = get_default_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 38, in get_default_hub
    import eventlet.hubs.epolls
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/epolls.py", line 27, in <module>
    from eventlet.hubs.hub import BaseHub
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 23, in <module>
    from eventlet.support import greenlets as greenlet, clear_sys_exc_info, monotonic, six
  File "/usr/local/lib/python2.7/site-packages/eventlet/support/monotonic.py", line 137, in <module>
    clock_gettime = ctypes.CDLL(ctypes.util.find_library('rt'),
  File "/usr/local/lib/python2.7/ctypes/util.py", line 274, in find_library
    return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
  File "/usr/local/lib/python2.7/ctypes/util.py", line 264, in _findSoname_ldconfig
    env=env)
  File "/usr/local/lib/python2.7/site-packages/eventlet/green/subprocess.py", line 55, in __init__
    subprocess_orig.Popen.__init__(self, args, 0, *argss, **kwds)
  File "/usr/local/lib/python2.7/subprocess.py", line 420, in __init__
    self.stdout = os.fdopen(c2pread, 'rb', bufsize)
  File "/usr/local/lib/python2.7/site-packages/eventlet/green/os.py", line 28, in fdopen
    return greenio.GreenPipe(fd, *args, **kw)
  File "/usr/local/lib/python2.7/site-packages/eventlet/greenio/py2.py", line 41, in __init__
    super(GreenPipe, self).__init__(_SocketDuckForFd(fileno), mode, bufsize)
  File "/usr/local/lib/python2.7/site-packages/eventlet/greenio/py2.py", line 128, in __init__
    notify_opened(fileno)
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 189, in notify_opened
    hub = get_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 116, in get_hub
    use_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 70, in use_hub
    mod = get_default_hub()
  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 39, in get_default_hub
    return eventlet.hubs.epolls
AttributeError: 'module' object has no attribute 'epolls'

@temoto
Copy link
Member

temoto commented Apr 7, 2017

Meanwhile, dirty workaround is eventlet.sleep() before monkey_patch().

import eventlet
+eventlet.sleep()
eventlet.monkey_patch()
eventlet.listen(("localhost", 8000))

@dabertram
Copy link

can this workaround be used for gunicorn eventlet class workers?
how would you fix those?

@dabertram
Copy link

although that's probably not really useful, I can confirm that this workaround also would fix gunicorn eventlet workers..

adding eventlet.sleep() directly after import eventlet in line 11 in https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/geventlet.py can integrate this workaround to the gunicorn worker spawn process..

anyway, that's not really applicable... this should be fixed in eventlet

@temoto
Copy link
Member

temoto commented Apr 8, 2017

Yeah should be fixed here.

@rburkholder
Copy link

rburkholder commented Apr 12, 2017

Just in case a further reference to this issue is needed, here is another re-creation, this using Ryu 4.13 on current Debian Stretch, and a code evaluation. Will the eventless.sleep() change work here? In which file is that change inserted?

Error message: AttributeError("'module' object has no attribute 'epolls'",)

Possible explanation:

urllib3 is intercepting select calls, and not providing epoll or epolls.

Question:

How to bypass this? My script worked a few months ago when testing, so I am trying to narrow down what changed.

In code in monotonic.py, I changed to get some debugging output (exception occurs on the statement between 'line d' and 'line g'), following code is starting around line 132 in montonic.py:

        else:
            print "line b"
            print sys.path
            print ctypes
            print ctypes.util
            try:
                print "line d"
                print ctypes.util.find_library('c')
                print "line g"
                clock_gettime = ctypes.CDLL(ctypes.util.find_library('c'),
                                            use_errno=True).clock_gettime
            except AttributeError as e:
                print( "line e ", e )
                clock_gettime = ctypes.CDLL(ctypes.util.find_library('rt'),
                                            use_errno=True).clock_gettime
                print "line f"

the ctypes.util.find_library('c') causes the error. Search for 'line e' in the following output to spot the module with problems.

root@edge:/home/vagrant# ryu run --observe-links /usr/local/lib/python2.7/dist-packages/ryu/app/gui_topology/gui_topology.py --install-lldp-flow
loading app /vagrant/test1.py
loading app ryu.topology.switches
loading app ryu.controller.dpset
loading app ryu.controller.ofp_handler
instantiating app ryu.controller.dpset of DPSet
instantiating app ryu.topology.switches of Switches
line a
line b
['/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl', '/usr/share/python-wheels/appdirs-1.4.0-py2.py3-none-any.whl', '/usr/share/python-wheels/chardet-2.3.0-py2.py3-none-any.whl', '/usr/share/python-wheels/colorama-0.3.7-py2.py3-none-any.whl', '/usr/share/python-wheels/distlib-0.2.4-py2.py3-none-any.whl', '/usr/share/python-wheels/distro-1.0.1-py2.py3-none-any.whl', '/usr/share/python-wheels/html5lib-0.999999999-py2.py3-none-any.whl', '/usr/share/python-wheels/ipaddress-0.0.0-py2.py3-none-any.whl', '/usr/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl', '/usr/share/python-wheels/packaging-16.8-py2.py3-none-any.whl', '/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl', '/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl', '/usr/share/python-wheels/progress-1.2-py2.py3-none-any.whl', '/usr/share/python-wheels/pyparsing-2.1.10-py2.py3-none-any.whl', '/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl', '/usr/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl', '/usr/share/python-wheels/setuptools-32.3.1-py2.py3-none-any.whl', '/usr/share/python-wheels/six-1.10.0-py2.py3-none-any.whl', '/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl', '/usr/share/python-wheels/webencodings-0.5-py2.py3-none-any.whl', '/usr/share/python-wheels/wheel-0.29.0-py2.py3-none-any.whl', '/usr/local/bin', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
<module 'ctypes' from '/usr/lib/python2.7/ctypes/init.pyc'>
<module 'ctypes.util' from '/usr/lib/python2.7/ctypes/util.pyc'>
line d
('line e ', AttributeError("'module' object has no attribute 'epolls'",))
Exception AttributeError: "'_SocketDuckForFd' object has no attribute '_closed'" in ignored
Exception AttributeError: "'_SocketDuckForFd' object has no attribute '_closed'" in ignored Traceback (most recent call last):

File "/usr/local/bin/ryu", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/ryu/cmd/ryu_base.py", line 74, in main
subcmd.run(base_conf.subcommand_args)
File "/usr/local/lib/python2.7/dist-packages/ryu/cmd/ryu_base.py", line 57, in run
self.entry(args=args, prog=prog)
File "/usr/local/lib/python2.7/dist-packages/ryu/cmd/manager.py", line 81, in main
services.extend(app_mgr.instantiate_apps(**contexts))
File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 509, in instantiate_apps
self._instantiate(app_name, cls, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 495, in _instantiate
app = cls(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ryu/topology/switches.py", line 532, in init
self.threads.append(hub.spawn(self.lldp_loop))
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 68, in spawn
return eventlet.spawn(_launch, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 50, in spawn
hub = hubs.get_hub()
File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/init.py", line 116, in get_hub
use_hub()
File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/init.py", line 70, in use_hub
mod = get_default_hub()
File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/init.py", line 38, in get_default_hub
import eventlet.hubs.epolls
File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/epolls.py", line 27, in
from eventlet.hubs.hub import BaseHub
File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 23, in
from eventlet.support import greenlets as greenlet, clear_sys_exc_info, monotonic, six
File "/usr/local/lib/python2.7/dist-packages/eventlet/support/monotonic.py", line 178, in
raise RuntimeError('no suitable implementation for this system')
RuntimeError: no suitable implementation for this system

@temoto
Copy link
Member

temoto commented Apr 12, 2017

@rburkholder

Will the eventless.sleep() change work here?

Try and see.

In which file is that change inserted?

Where import eventlet is executed first time.

@rburkholder
Copy link

Making the following change to /usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py eliminated the exception (add 'eventless.sleep()) to line 32 of the file after the import statement):

if HUB_TYPE == 'eventlet':
    import eventlet
    eventlet.sleep()
    import eventlet.event
    import eventlet.queue
    import eventlet.semaphore
    import eventlet.timeout
    import eventlet.wsgi

@dkavanagh
Copy link

Ran into this as well (via gunicorn on CentOS 7). Verified patch in geventlet.py, but would prefer eventlet release to fix this.

@enricobacis
Copy link

I confirm this also happens on kali linux (debian-testing based)

@j-ramirez-bi4group
Copy link

Any news?

@temoto
Copy link
Member

temoto commented May 3, 2017

Not yet.

@Barlog951
Copy link

This happens me in my docker instance of python 2.7.13 with nameko package

PLS fix this because ist very important for me

thanks

@LukeusMaximus
Copy link

I also get this inside of a Docker instance, specifically when running RYU.

iwaseyusuke added a commit to iwaseyusuke/ryu that referenced this issue May 8, 2017
This patch adopts the workaround which is discussing on the eventlet
team at the following:
 eventlet/eventlet#401
This workaround is suggested by Raymond Burkholder.

Suggested-by: Raymond Burkholder <ray@oneunified.net>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
scottcode added a commit to scottcode/moves that referenced this issue May 8, 2017
A bug in eventlet v20 or 21 caused the app to fail. Would get this error:

Exception AttributeError: "'_SocketDuckForFd' object has no attribute '_closed'" in <bound method _SocketDuckForFd.__del__ of _SocketDuckForFd:9>

Seems related to issue 401: new monotonic broken on docker?
eventlet/eventlet#401
fujita pushed a commit to faucetsdn/ryu that referenced this issue May 9, 2017
This patch adopts the workaround which is discussing on the eventlet
team at the following:
 eventlet/eventlet#401
This workaround is suggested by Raymond Burkholder.

Suggested-by: Raymond Burkholder <ray@oneunified.net>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
@prometheanfire
Copy link

Are there any updates here or just workarounds? We are looping to block the new eventlet in openstack due to this bug. https://review.openstack.org/464687

openstack-gerrit pushed a commit to openstack/openstack that referenced this issue May 17, 2017
Project: openstack/requirements  e0f0220a89688ce000698ae1cadda750f87a80fd

block eventlet >= 0.21.0

There is an interaction between eventlet and monotonic on eventlet >=
0.21.0 which is triggered during oslo.db library loading.

Upstream eventlet bug: eventlet/eventlet#401
Related-Bug: #1690819

Change-Id: I26965bd363661318a8f9646589755cbb78a58eb7
openstack-gerrit pushed a commit to openstack/requirements that referenced this issue May 17, 2017
There is an interaction between eventlet and monotonic on eventlet >=
0.21.0 which is triggered during oslo.db library loading.

Upstream eventlet bug: eventlet/eventlet#401
Related-Bug: #1690819

Change-Id: I26965bd363661318a8f9646589755cbb78a58eb7
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue May 17, 2017
Project: openstack/requirements  e0f0220a89688ce000698ae1cadda750f87a80fd

block eventlet >= 0.21.0

There is an interaction between eventlet and monotonic on eventlet >=
0.21.0 which is triggered during oslo.db library loading.

Upstream eventlet bug: eventlet/eventlet#401
Related-Bug: #1690819

Change-Id: I26965bd363661318a8f9646589755cbb78a58eb7
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue May 18, 2017
Project: openstack/designate  4faac428bf2f825b192a044ff6e20bb61e003ca2

Blacklist python 3 UT because of eventlet bug

Eventlet>=0.21.0 has been blocked in uc [1] due to bug [2].
Let's re-block failed py3 UT based on eventlet 0.21.0 until
new release lands.

[1]. https://review.openstack.org/#/c/464687/
[2]. eventlet/eventlet#401

Change-Id: I5b68731519bc7de1273ef9d397ed908be63db64e
@prometheanfire
Copy link

just to be clear, was b756447 the fix for this bug?

@temoto
Copy link
Member

temoto commented Jan 9, 2018 via email

@prometheanfire
Copy link

cool, thanks, do you know when the next release is supposed to be? I ask because I'd like to uncap eventlet in requirements for openstack.

https://github.com/openstack/requirements/blob/master/global-requirements.txt#L56

@temoto
Copy link
Member

temoto commented Jan 10, 2018

@prometheanfire I want to fix this #147 problem with multiprocessing, seems it's a huge pain for many people.

Meanwhile, my constant recommendation is to require particular commit id. It has all benefits of specifying exact version (repeatable build, no new errors) + absence of stupid pypi release bureaucracy. The only better way is to include dependency sources within your project to protect against upstream servers downtime.

@prometheanfire
Copy link

Unfortunately we cannot lock to a sha with how we are organized now, we only include releases, even rc and beta releases are rejected.

@temoto temoto modified the milestones: v0.22, 0.23 Jan 12, 2018
@temoto
Copy link
Member

temoto commented Jan 12, 2018

@prometheanfire this fix was included in 0.22 release on pypi

@prometheanfire
Copy link

thanks :D

cdonati added a commit to cdonati/appscale that referenced this issue Jan 24, 2018
rdoproject pushed a commit to rdo-infra/fedora-stable-config that referenced this issue May 23, 2018
We are having some issues related to [1] with eventlet 0.22.1 from
Fedora 28. Since upper-constraints is still listing 0.20.0, let's try
using that version.

[1] - eventlet/eventlet#401

Change-Id: I3882202ed16f90ba508bfab4040ac3e62cf221c4
@toabctl
Copy link

toabctl commented Mar 21, 2019

I still see this problem with eventlet==0.24.1 and monotonic==1.5 :

[   58s] Captured daemon_log:
[   58s] ~~~~~~~~~~~~~~~~~~~~
[   58s]     Exception AttributeError: "'_SocketDuckForFd' object has no attribute '_closed'" in <bound method _SocketDuckForFd.__del__ of _SocketDuckForFd:16> ignored
[   58s]     Exception AttributeError: "'_SocketDuckForFd' object has no attribute '_closed'" in <bound method _SocketDuckForFd.__del__ of _SocketDuckForFd:17> ignored
[   58s]     Traceback (most recent call last):
[   58s]       File "oslo_rootwrap/tests/run_daemon.py", line 20, in <module>
[   58s]         from oslo_rootwrap import cmd
[   58s]       File "/home/abuild/rpmbuild/BUILD/oslo.rootwrap-5.15.2/oslo_rootwrap/__init__.py", line 19, in <module>
[   58s]         import eventlet.patcher
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/__init__.py", line 10, in <module>
[   58s]         from eventlet import convenience
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/convenience.py", line 7, in <module>
[   58s]         from eventlet.green import socket
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/green/socket.py", line 21, in <module>
[   58s]         from eventlet.support import greendns
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/support/greendns.py", line 64, in <module>
[   58s]         setattr(dns, pkg, import_patched('dns.' + pkg))
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/support/greendns.py", line 59, in import_patched
[   58s]         return patcher.import_patched(module_name, **modules)
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/patcher.py", line 120, in import_patched
[   58s]         *additional_modules + tuple(kw_additional_modules.items()))
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/patcher.py", line 94, in inject
[   58s]         module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
[   58s]       File "/usr/lib/python2.7/site-packages/dns/dnssec.py", line 482, in <module>
[   58s]         from Crypto.Hash import MD5, SHA1, SHA256, SHA384, SHA512
[   58s]       File "/usr/lib64/python2.7/site-packages/Crypto/Hash/MD5.py", line 47, in <module>
[   58s]         """)
[   58s]       File "/usr/lib64/python2.7/site-packages/Crypto/Util/_raw_api.py", line 296, in load_pycryptodome_raw_lib
[   58s]         cdecl)
[   58s]       File "/usr/lib64/python2.7/site-packages/Crypto/Util/_raw_api.py", line 175, in load_lib
[   58s]         bits, linkage = platform.architecture()
[   58s]       File "/usr/lib64/python2.7/platform.py", line 1066, in architecture
[   58s]         output = _syscmd_file(executable, '')
[   58s]       File "/usr/lib64/python2.7/platform.py", line 1009, in _syscmd_file
[   58s]         stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
[   58s]       File "/usr/lib64/python2.7/subprocess.py", line 420, in __init__
[   58s]         self.stdout = os.fdopen(c2pread, 'rb', bufsize)
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/green/os.py", line 28, in fdopen
[   58s]         return greenio.GreenPipe(fd, *args, **kw)
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/greenio/py2.py", line 42, in __init__
[   58s]         super(GreenPipe, self).__init__(_SocketDuckForFd(fileno), mode, bufsize)
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/greenio/py2.py", line 129, in __init__
[   58s]         notify_opened(fileno)
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 190, in notify_opened
[   58s]         hub = get_hub()
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 117, in get_hub
[   58s]         use_hub()
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 71, in use_hub
[   58s]         mod = get_default_hub()
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/hubs/__init__.py", line 39, in get_default_hub
[   58s]         import eventlet.hubs.epolls
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/hubs/epolls.py", line 13, in <module>
[   58s]         from eventlet.hubs.hub import BaseHub
[   58s]       File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 24, in <module>
[   58s]         import monotonic
[   58s]       File "/usr/lib/python2.7/site-packages/monotonic.py", line 169, in <module>
[   58s]         raise RuntimeError('no suitable implementation for this system: ' + repr(e))
[   58s]     RuntimeError: no suitable implementation for this system: AttributeError("'module' object has no attribute 'epolls'",)
[   58s]     Exception AttributeError: "'_SocketDuckForFd' object has no attribute '_closed'" in <bound method _SocketDuckForFd.__del__ of _SocketDuckForFd:10> ignored
[   58s]     

@dtantsur
Copy link
Contributor

@temoto
Copy link
Member

temoto commented Jan 23, 2020

@toabctl @dtantsur this crutch should work:

Execute this line before importing eventlet.

+import dns  # workaround for https://github.com/eventlet/eventlet/issues/401
 import eventlet

Root cause is import cycle: eventlet -> dns -> Crypto.Hash -> platform -> [patched]subprocess -> eventlet

@temoto temoto reopened this Jan 23, 2020
@dtantsur
Copy link
Contributor

Root cause is import cycle: eventlet -> dns -> Crypto.Hash -> platform -> [patched]subprocess -> eventlet

@temoto thanks for looking into this! Which versions of these packages do you use to confirm the bug? I have two CI jobs that differ in the installed packages, but these ones seem to be the same in both. One works, one crashes with the traceback above..

@dtantsur
Copy link
Contributor

I have a suspect: cryptography 2.6.1 on the working run vs 2.8 on the broken one.

@temoto
Copy link
Member

temoto commented Jan 23, 2020

@dtantsur I didn't run code this time, just read posted logs.

Probably you are looking for packages providing dns, Crypto or Cryptodome.

@temoto
Copy link
Member

temoto commented Jan 23, 2020

With big no-blame note, you could say this break was provoked not caused by this change Legrandin/pycryptodome@f08e5f9

@dtantsur
Copy link
Contributor

Sounds entirely plausible.

@chenxing0407
Copy link

you can add traceback to see the real reason, I encounter
"IOError: [Errno 13] Permission denied: '/dev/null'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.