debugging Gevent app is throwing Exceptions
I have a Flask app running on top of gunicorn. I set up my run configuration like so:
* Enabled Gevent compatible on the python debugger preferences.
* set the Script in the run config to point to my virtual environment's gunicorn
* set the params as needed
It all works fine when I run the script. but when I try to debug I get the following Error from pycharm:
Traceback (most recent call last):
[2019-10-30 19:21:29 +0200] [11744] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/gunicorn/workers/geventlet.py", line 102, in init_process
super(EventletWorker, self).init_process()
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.run()
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/gunicorn/workers/geventlet.py", line 135, in run
eventlet.sleep(1.0)
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/eventlet/greenthread.py", line 35, in sleep
hub.switch()
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/eventlet/hubs/hub.py", line 295, in switch
return self.greenlet.switch()
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/eventlet/hubs/hub.py", line 347, in run
self.wait(sleep_time)
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/eventlet/hubs/kqueue.py", line 100, in wait
result = self._control([], self.MAX_EVENTS, seconds)
File "/Users/refael/.local/share/virtualenvs/romee-dkO78zKu/lib/python3.6/site-packages/eventlet/hubs/kqueue.py", line 41, in _control
return self.kqueue.control(events, max_events, timeout)
OSError: [Errno 9] Bad file descriptor
Please sign in to leave a comment.
Hello Refael!
Could you please:
1. upload your logs folder zipped from Help | Compress Logs and Show in…
2. provide a code example, so I will be able to reproduce the issue
Please upload the information to the FTP:
https://uploads.services.jetbrains.com/ and let me know the folder name.
Thank you!
I uploaded logs to the link you have sent (logs-20191103-130959.zip - not sure where its saved).
I hope this example will reproduce your error:
in a python file:
then in run configuration
gunicorn --bind 0.0.0.0:1337 --worker-class eventlet --no-sendfile --timeout 300 -w 1 <path_to_app>:app
and try debugging