eventlet API changes break the server
codeanticode opened this issue · 0 comments
codeanticode commented
Gives the following error on heroku:
021-05-10T20:27:38.993157+00:00 heroku[web.1]: Process exited with status 1
2021-05-10T20:27:39.127940+00:00 heroku[web.1]: State changed from starting to crashed
2021-05-10T20:27:39.131450+00:00 heroku[web.1]: State changed from crashed to starting
2021-05-10T20:27:45.573669+00:00 heroku[web.1]: Starting process with command `gunicorn --worker-class eventlet -w 1 "run:create_app()"`
2021-05-10T20:27:48.080629+00:00 heroku[web.1]: Process exited with status 1
2021-05-10T20:27:48.162002+00:00 heroku[web.1]: State changed from starting to crashed
2021-05-10T20:27:48.004917+00:00 app[web.1]:
2021-05-10T20:27:48.004941+00:00 app[web.1]: Error: class uri 'eventlet' invalid or not found:
2021-05-10T20:27:48.004941+00:00 app[web.1]:
2021-05-10T20:27:48.004942+00:00 app[web.1]: [Traceback (most recent call last):
2021-05-10T20:27:48.004942+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 99, in load_class
2021-05-10T20:27:48.004942+00:00 app[web.1]: mod = importlib.import_module('.'.join(components))
2021-05-10T20:27:48.004943+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-05-10T20:27:48.004943+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-05-10T20:27:48.004944+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-05-10T20:27:48.004944+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-05-10T20:27:48.004944+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-05-10T20:27:48.004945+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-05-10T20:27:48.004945+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 855, in exec_module
2021-05-10T20:27:48.004945+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-05-10T20:27:48.004946+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/geventlet.py", line 20, in <module>
2021-05-10T20:27:48.004946+00:00 app[web.1]: from eventlet.wsgi import ALREADY_HANDLED as EVENTLET_ALREADY_HANDLED
2021-05-10T20:27:48.004947+00:00 app[web.1]: ImportError: cannot import name 'ALREADY_HANDLED' from 'eventlet.wsgi' (/app/.heroku/python/lib/python3.9/site-pac
Thread on stack overflow: https://stackoverflow.com/questions/67409452/gunicorn-importerror-cannot-import-name-already-handled-from-eventlet-wsgi
It's recommended to use eventlet>=0.31.0 if one uses websockets, because older versions are vulnerable to DoS attack. GHSA-9p9m-jm8w-94p2
Temporary workaround: