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

Eventlet 0.31.0 causes runtime exception in gunicorn #702

Closed
hughsie opened this issue May 5, 2021 · 11 comments
Closed

Eventlet 0.31.0 causes runtime exception in gunicorn #702

hughsie opened this issue May 5, 2021 · 11 comments

Comments

@hughsie
Copy link

hughsie commented May 5, 2021

Update: This should apparently be fixed by upgrading to latest gunicorn.

All my webapps are failing to startup with:

Error: class uri 'eventlet' invalid or not found:
[Traceback (most recent call last):
File "/app/venv/lib64/python3.6/site-packages/gunicorn/util.py", line 99, in load_class
mod = importlib.import_module('.'.join(components))
File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/app/venv/lib64/python3.6/site-packages/gunicorn/workers/geventlet.py", line 20, in <module>
from eventlet.wsgi import ALREADY_HANDLED as EVENTLET_ALREADY_HANDLED
ImportError: cannot import name 'ALREADY_HANDLED'

Pinning to eventlet==0.30.2 "fixes" the issue.

@Mark7888
Copy link

Mark7888 commented May 5, 2021

I have the same issue with 0.31.0.

Pinning to eventlet==0.30.2 "fixed" the issue for me too.

@SoSDylan
Copy link

SoSDylan commented May 5, 2021

Same here, was running pip install gunicorn[eventlet]==19.9.0 to install gunicorn and eventlet in our docker environment.

Out production server went down and is still down, trying the above by installing gunicorn and eventlet separately with the specified versions.

@Mark7888
Copy link

Mark7888 commented May 6, 2021

@SoSDylan
pip install gunicorn==20.1.0 eventlet==0.30.2 is working for me. Try this maybe.

@SoSDylan
Copy link

SoSDylan commented May 6, 2021

@Mark7888
Thank you! That worked, we had about 30 companies that were on our backs about out site being down 😅

@temoto
Copy link
Member

temoto commented May 6, 2021

Problem

Eventlet 0.30.3 removed eventlet.wsgi.ALREADY_HANDLED which is used by gunicorn

Solution

Proper fix - merged, not released in upstream benoitc/gunicorn#2581

Workaround

Pin eventlet==0.30.2 is correct workaround for now.

If you use websockets, please upgrade eventlet>=0.31.0 ASAP, there is moderate security fix. GHSA-9p9m-jm8w-94p2

Note to maintainers: please remove workaround when patch is accepted in gunicorn.

@zhaluza
Copy link

zhaluza commented May 28, 2021

Really glad I found this workaround. Version 0.31.0 was causing a Heroku-hosted Flask app to crash, but downgrading to 0.30.2 got it working again.

@mwibutsa
Copy link

Thanks, this workaround is helpful

Floskinner added a commit to Floskinner/Lamdasonden-Messtation that referenced this issue May 7, 2022
Floskinner added a commit to Floskinner/Lamdasonden-Messtation that referenced this issue Jul 8, 2022
* added new average calculation for the values

* add everage

* changed formular

* updaed

* fixed spelling and some other errors

* added todo

* Switched to poetry and venv

* some linting

* added pre-commit

* reformatted with black

* change code from index to new file

* added the config menue / modal

* added vscode

* mocked spidev in dev mode

* fixed some spelling ??

* Added blinking

* updated blinking to invisable

* added comment

* deleted unused png

* added legend bottom right

* run pre-commit on all files

* change to config instead of global variables

* changed the AFR calculation

* added error check

* added pyinstaller

* fixed exception if ENV not set

* fixed know issue in package eventlet/eventlet#702

* fixed exception if ENV not set

* changed config and can change correction from web interface

Co-authored-by: Glaser <florian.glaser@ifm.com>
oharsta added a commit to SURFscz/SBS that referenced this issue Jul 14, 2022
Floskinner added a commit to Floskinner/Lamdasonden-Messtation that referenced this issue Jul 16, 2022
* added new average calculation for the values

* add everage

* changed formular

* updaed

* fixed spelling and some other errors

* added todo

* Switched to poetry and venv

* some linting

* added pre-commit

* reformatted with black

* change code from index to new file

* added the config menue / modal

* added vscode

* mocked spidev in dev mode

* fixed some spelling ??

* Added blinking

* updated blinking to invisable

* added comment

* deleted unused png

* added legend bottom right

* run pre-commit on all files

* change to config instead of global variables

* changed the AFR calculation

* added error check

* added pyinstaller

* fixed exception if ENV not set

* fixed know issue in package eventlet/eventlet#702

* fixed exception if ENV not set

* changed config and can change correction from web interface

Co-authored-by: Glaser <florian.glaser@ifm.com>
Floskinner added a commit to Floskinner/Lamdasonden-Messtation that referenced this issue Nov 22, 2022
* added new average calculation for the values

* add everage

* changed formular

* updaed

* fixed spelling and some other errors

* added todo

* Switched to poetry and venv

* some linting

* added pre-commit

* reformatted with black

* change code from index to new file

* added the config menue / modal

* added vscode

* mocked spidev in dev mode

* fixed some spelling ??

* Added blinking

* updated blinking to invisable

* added comment

* deleted unused png

* added legend bottom right

* run pre-commit on all files

* change to config instead of global variables

* changed the AFR calculation

* added error check

* added pyinstaller

* fixed exception if ENV not set

* fixed know issue in package eventlet/eventlet#702

* fixed exception if ENV not set

* changed config and can change correction from web interface

Co-authored-by: Glaser <florian.glaser@ifm.com>
@fabswt
Copy link

fabswt commented Nov 24, 2022

Is this workaround supposed to work with Python 3.10?

I'm running gunicorn==20.1.0 and eventlet==0.30.2 on Python 3.10.6 and getting this error:

Error: class uri 'eventlet' invalid or not found:

[Traceback (most recent call last):
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/gunicorn/util.py", line 99, in load_class
    mod = importlib.import_module('.'.join(components))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/gunicorn/workers/geventlet.py", line 10, in <module>
    import eventlet
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/eventlet/__init__.py", line 17, in <module>
    from eventlet import convenience
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/eventlet/convenience.py", line 7, in <module>
    from eventlet.green import socket
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/eventlet/green/socket.py", line 4, in <module>
    __import__('eventlet.green._socket_nodns')
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/eventlet/green/_socket_nodns.py", line 11, in <module>
    from eventlet import greenio
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/eventlet/greenio/__init__.py", line 3, in <module>
    from eventlet.greenio.base import *  # noqa
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/eventlet/greenio/base.py", line 32, in <module>
    socket_timeout = eventlet.timeout.wrap_is_timeout(socket.timeout)
  File "/var/www/html/python-tests/pronunciation-demo/venv/lib/python3.10/site-packages/eventlet/timeout.py", line 166, in wrap_is_timeout
    base.is_timeout = property(lambda _: True)
TypeError: cannot set 'is_timeout' attribute of immutable type 'TimeoutError'
]

@fabswt
Copy link

fabswt commented Nov 25, 2022

Just wanted to confirm that eventlet==0.30.2 with gunicorn==20.1.0 running on Python 3.10.6 does crash, with the TimeoutError mentioned in my previous post.

Confirming that things work fine with Python 3.9.15.

Python 3.10 has been out for over a year and is default on, say, Ubuntu 22.

@temoto
Copy link
Member

temoto commented Nov 27, 2022

Is this workaround supposed to work with Python 3.10?

No, older eventlet version from workaround does not support Python 3.10. This issue/thread/workaround is not related to Python 3.10 support in any way.

If you need to run gunicorn with eventlet, use gunicorn master or eventlet 0.30.2. Latter doesn't support 3.10.

I have successfully run simplest WSGI app using eventlet 0.33.2, gunicorn master and Python 3.10.

Sorry for inconvenience.

Floskinner added a commit to Floskinner/Lamdasonden-Messtation that referenced this issue Dec 29, 2022
* added new average calculation for the values

* add everage

* changed formular

* updaed

* fixed spelling and some other errors

* added todo

* Switched to poetry and venv

* some linting

* added pre-commit

* reformatted with black

* change code from index to new file

* added the config menue / modal

* added vscode

* mocked spidev in dev mode

* fixed some spelling ??

* Added blinking

* updated blinking to invisable

* added comment

* deleted unused png

* added legend bottom right

* run pre-commit on all files

* change to config instead of global variables

* changed the AFR calculation

* added error check

* added pyinstaller

* fixed exception if ENV not set

* fixed know issue in package eventlet/eventlet#702

* fixed exception if ENV not set

* changed config and can change correction from web interface

* added devcontainer

* some code fixes (#7)

* nachkomastellen default zu 2 (#8)

* Set blinking and removed error warning (#10)

* blinking is in settings

* removed error checking

Co-authored-by: Glaser <florian.glaser@ifm.com>
chriskelly added a commit to chriskelly/LifeFinances that referenced this issue Jan 21, 2023
Trying guidance from this issue: eventlet/eventlet#702
@itamarst
Copy link
Contributor

gunicorn fixed this, sounds like.

Floskinner added a commit to Floskinner/Lamdasonden-Messtation that referenced this issue Jan 3, 2024
* added new average calculation for the values

* add everage

* changed formular

* updaed

* fixed spelling and some other errors

* added todo

* Switched to poetry and venv

* some linting

* added pre-commit

* reformatted with black

* change code from index to new file

* added the config menue / modal

* added vscode

* mocked spidev in dev mode

* fixed some spelling ??

* Added blinking

* updated blinking to invisable

* added comment

* deleted unused png

* added legend bottom right

* run pre-commit on all files

* change to config instead of global variables

* changed the AFR calculation

* added error check

* added pyinstaller

* fixed exception if ENV not set

* fixed know issue in package eventlet/eventlet#702

* fixed exception if ENV not set

* changed config and can change correction from web interface

* added devcontainer

* some code fixes (#7)

* nachkomastellen default zu 2 (#8)

* Set blinking and removed error warning (#10)

* blinking is in settings

* removed error checking

* #9 save all setting (#13)

* all settings getting saved

* switched to dynamic attributes in config

* use of url_for

* setup the default values and the persistent saving in the backend

* updated black

* added example settings and use this if not prod

* removed unused settings

* update README für neue Settings

* removed unused import

* added jinja extension

* #12 exceptions anzeigen (#14)

* renamend .html to .jinja

* renamend THREAD to UPDATE_DATA_THREAD and initialize it with None

* Exceptions werden nun angezeigt

* #16 New temperaturanzeige (#23)

* Basisklasse für GPIO erstellt und LambdaSensor daraus abgeleitet

* Added typ_k_tempreatursensor and apply snake_case to lambda_sensor

* submit temperaturdata to webpage

* splittet lamda functions and placed channels to config file

* added new config in exaple file

create base template. Working

moved javascript around

switched back to index.jinja

* lambda und temp werden nun von anfang an auf 50% im index angezeigt

* Tempreaturanzeige wird nun syncronisiert vom Back to Frontend

* alphabetic order

* alle Anzeigen können nun individuell angezeigt werden und in conf eingestellt

* apply orange and red colors

* Temp min max verlauf (#24)

* tmp_commit added charts rev

* added diagramm with test data

* added sqlite db and tempdata routes

* implemented firs working chart for temperatur

* Create own page for history

* switched to date and time imstead of datetime-local

* add nav and hisotry generator tool

* added bg color for chart

* added second timestamp for temprature

* added lambda values for charts

* removed influxdb

* generate better example values

* added timezone to db timestamps

* fixed labes for data

* fixed some type errors

* swtiched to own CSS layout

* changed the main Layout to own CSS

* tracking the sensor lifetime and show warnings (#25)

* added overheating (#26)

* updated readme

* update python version to 3.7.*
@4383 4383 unpinned this issue Mar 13, 2024
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

8 participants