Locust crashes immediately after launching under python3.7. The errors appear to have something to do with greenlet or gevent.
It should work normally
Immediate crash. Output:
> locust -f infrastructure/locust/locustfile.py
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
<env_path>/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
return f(*args, **kwds)
[2018-07-26 16:45:01,586] L08125.local/INFO/locust.main: Starting web monitor at *:8089
[2018-07-26 16:45:01,587] L08125.local/ERROR/stderr: Traceback (most recent call last):
[2018-07-26 16:45:01,587] L08125.local/ERROR/stderr: File "<env_path>/bin/locust", line 11, in <module>
[2018-07-26 16:45:01,587] L08125.local/ERROR/stderr:
[2018-07-26 16:45:01,587] L08125.local/ERROR/stderr: sys.exit(main())
[2018-07-26 16:45:01,587] L08125.local/ERROR/stderr:
[2018-07-26 16:45:01,587] L08125.local/ERROR/stderr: File "<env_path>/lib/python3.7/site-packages/locust/main.py", line 430, in main
[2018-07-26 16:45:01,588] L08125.local/ERROR/stderr:
[2018-07-26 16:45:01,588] L08125.local/ERROR/stderr: main_greenlet = gevent.spawn(web.start, locust_classes, options)
[2018-07-26 16:45:01,588] L08125.local/ERROR/stderr:
[2018-07-26 16:45:01,588] L08125.local/ERROR/stderr: File "src/gevent/greenlet.py", line 538, in gevent._greenlet.Greenlet.spawn
[2018-07-26 16:45:01,588] L08125.local/ERROR/stderr: File "src/gevent/greenlet.py", line 213, in gevent._greenlet.Greenlet.__init__
[2018-07-26 16:45:01,588] L08125.local/ERROR/stderr: File "src/gevent/_hub_local.py", line 80, in gevent.__hub_local.get_hub_noargs
[2018-07-26 16:45:01,588] L08125.local/ERROR/stderr: File "<env_path>/lib/python3.7/site-packages/gevent/hub.py", line 390, in __init__
[2018-07-26 16:45:01,589] L08125.local/ERROR/stderr:
[2018-07-26 16:45:01,589] L08125.local/ERROR/stderr: WaitOperationsGreenlet.__init__(self, None, None)
[2018-07-26 16:45:01,589] L08125.local/ERROR/stderr:
[2018-07-26 16:45:01,590] L08125.local/ERROR/stderr: File "src/gevent/_greenlet_primitives.py", line 42, in gevent.__greenlet_primitives.TrackedRawGreenlet.__init__
[2018-07-26 16:45:01,590] L08125.local/ERROR/stderr: SystemError
[2018-07-26 16:45:01,590] L08125.local/ERROR/stderr: :
[2018-07-26 16:45:01,590] L08125.local/ERROR/stderr: Objects/dictobject.c:1439: bad argument to internal function
[2018-07-26 16:45:01,590] L08125.local/ERROR/stderr:
pip install locustiolocust -f <path_to_locustfile>Edit: the package name is locustio, not locust :p
I'm working around this by running locust in a python:3.6 docker container.
To be fair, https://github.com/locustio/locust#supported-python-versions doesn't list 3.7
http://www.gevent.org/changelog.html#unreleased
1.3.6 (unreleased)
gevent now depends on greenlet 0.4.14 or above. gevent binary wheels for 1.3.5 and below must have greenlet 0.4.13 installed on Python 3.7 or they will crash. Reported by Alexey Stepanov in issue #1260 and pkittenis in issue #1261.
My fresh install of locustio on Py3.7 gave me:
- gevent [required: >=1.2.2, installed: 1.3.5]
- greenlet [required: >=0.4.13, installed: 0.4.14]
installing and pinning greenlet==0.4.13 fixed it for me
:+1: I'll give that a try tomorrow!
I had the same issue:
Issues: Workers were timing out, after some fixing, the Runtime Error.
Fixed:
Thanks for your help!
Working fine under python 3.7 for me with the pinned gevent (1.3.5) and greenlet (0.4.13) versions
this is working work now.. I just merged #885
I don't see anything in the diff that will fix the specific problem with gevent==1.35 detailed in this issue
fresh installs work under Python 3.7 now because gevent released 1.3.6 to PyPI
so the fix for anyone with this problem is to upgrade to gevent==1.3.6
Most helpful comment
Working fine under python 3.7 for me with the pinned gevent (1.3.5) and greenlet (0.4.13) versions