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

Immediate crash under python 3.7 #852

Closed
hoylemd opened this issue Jul 26, 2018 · 8 comments
Closed

Immediate crash under python 3.7 #852

hoylemd opened this issue Jul 26, 2018 · 8 comments

Comments

@hoylemd
Copy link
Contributor

hoylemd commented Jul 26, 2018

Description of issue / feature request

Locust crashes immediately after launching under python3.7. The errors appear to have something to do with greenlet or gevent.

Expected behavior

It should work normally

Actual behavior

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:

Environment settings (for bug reports)

  • OS: macos Sierra (10.12.6)
  • Python version: 3.7.0
  • Locust version: 0.8.1

Steps to reproduce (for bug reports)

  • Create a virtualenv with python 3.7
  • activate the virtualenv
  • pip install locustio
  • make a locustfile (The quickstart one is fine)
  • run locust -f <path_to_locustfile>

Edit: the package name is locustio, not locust :p

@hoylemd hoylemd changed the title Update for python 3.7 Immediate crash under python 3.7 Jul 26, 2018
@hoylemd
Copy link
Contributor Author

hoylemd commented Jul 26, 2018

I'm working around this by running locust in a python:3.6 docker container.

@vadi2
Copy link

vadi2 commented Jul 27, 2018

@anentropic
Copy link

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

@hoylemd
Copy link
Contributor Author

hoylemd commented Jul 29, 2018

👍 I'll give that a try tomorrow!

@AndreyBulezyuk
Copy link

I had the same issue:

  • Running Docker Python3.7 on Google Cloud Kubernetes.
  • Gunicorn, Greenlet and Gevent newest versions

Issues: Workers were timing out, after some fixing, the Runtime Error.

Fixed:

  • Changed Base Image to Python3.6
  • gunicorn==19.9.0
  • gevent==1.3.4
  • greenlet==0.4.13

Thanks for your help!

@anentropic
Copy link

anentropic commented Aug 7, 2018

Working fine under python 3.7 for me with the pinned gevent (1.3.5) and greenlet (0.4.13) versions

@cgoldberg
Copy link
Member

this is working work now.. I just merged #885

@anentropic
Copy link

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

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

No branches or pull requests

5 participants