You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RecursionError: maximum recursion depth exceeded #92
With python-engineio = "3.1.0" I am getting RecursionError: maximum recursion depth exceeded:
File "[...]\site-packages\urllib3\util\ssl_.py", line 281, in create_urllib3_context
context.options |= options
File "[...]\miniconda\envs\py36\lib\ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
ERROR:
Exception on /auth/login [POST] [in c:\user\dev\venvs\flask_36\lib\site-packages\flask\app.py:1761]
Traceback (most recent call last):
File "c:\user\dev\venvs\flask_36\lib\site-packages\flask\app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "c:\user\dev\venvs\flask_36\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "c:\user\dev\venvs\flask_36\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "c:\user\dev\venvs\flask_36\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "c:\user\dev\venvs\flask_36\lib\site-packages\flask\_compat.py", line 35, in reraise
raise value
File "c:\user\dev\venvs\flask_36\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "c:\user\dev\venvs\flask_36\lib\site-packages\flask\app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:\user\Dev\projects\vue_bare\app\backend\auth\views.py", line 14, in login
if user is not None and user.verify_password(password):
File "C:\user\Dev\projects\vue_bare\app\backend\models.py", line 69, in verify_password
return check_page_login(self.username, password)
File "C:\user\Dev\projects\vue_bare\app\backend\authenticate.py", line 13, in check_page_login
r = s.get(url_page, auth=(username, password))
File "c:\user\dev\venvs\flask_36\lib\site-packages\requests\sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "c:\user\dev\venvs\flask_36\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "c:\user\dev\venvs\flask_36\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "c:\user\dev\venvs\flask_36\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "c:\user\dev\venvs\flask_36\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "c:\user\dev\venvs\flask_36\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "c:\user\dev\venvs\flask_36\lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn
conn.connect()
File "c:\user\dev\venvs\flask_36\lib\site-packages\urllib3\connection.py", line 332, in connect
cert_reqs=resolve_cert_reqs(self.cert_reqs),
File "c:\user\dev\venvs\flask_36\lib\site-packages\urllib3\util\ssl_.py", line 281, in create_urllib3_context
context.options |= options
File "C:\user\Dev\apps\miniconda\envs\py36\lib\ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "C:\user\Dev\apps\miniconda\envs\py36\lib\ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "C:\user\Dev\apps\miniconda\envs\py36\lib\ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
[Previous line repeated 304 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
This doesn't appear to be related to python-engineio, note that there isn't a single reference to it in your stack trace. On the other side, this issue regarding monkey patching too late looks related to your problem: gevent/gevent#1016.
@miguelgrinberg yes I did have look. I believe that the issue is not with the order of the imports. The only thing that has changed is the version of python-engineio. The code is the same: it works with the old version and does not work with the new one.
@teucer this error occurs with improper monkey patching. You seem to be fixated on the pinning, but that is not indicative that the problem is in this package, it just means that something that I changed now exposes this bug, which is probably in your application.
For starters, you are not monkey patching socket, I now see. How do you expect requests to work without a monkey patched socket library?
It is important to call monkey_patch() as early in the lifetime of the application as possible. Try to do it as one of the first lines in the main module.
All the documented instances of this bug were proven to be due to a bad monkey patching, so I have to suspect you still have a problem there. Unless you can provide something I can use to debug this I do not know what else I can do to get to the bottom of this issue.
One of the challenges of writing a library like Eventlet is that the built-in networking libraries don’t natively support the sort of cooperative yielding that we need.
You are using requests, which uses the built-in networking libraries in Python.
Activity
miguelgrinberg commentedon Jan 16, 2019
Can you share the complete stack trace please? The portion that you shared doesn't have enough context for me to understand what's going on.
teucer commentedon Jan 16, 2019
miguelgrinberg commentedon Jan 16, 2019
This doesn't appear to be related to python-engineio, note that there isn't a single reference to it in your stack trace. On the other side, this issue regarding monkey patching too late looks related to your problem: gevent/gevent#1016.
teucer commentedon Jan 17, 2019
Pinning the version of python-engineio solves the issue (?)
miguelgrinberg commentedon Jan 17, 2019
@teucer did you look at the link I sent?
teucer commentedon Jan 17, 2019
@miguelgrinberg yes I did have look. I believe that the issue is not with the order of the imports. The only thing that has changed is the version of python-engineio. The code is the same: it works with the old version and does not work with the new one.
miguelgrinberg commentedon Jan 17, 2019
@teucer this error occurs with improper monkey patching. You seem to be fixated on the pinning, but that is not indicative that the problem is in this package, it just means that something that I changed now exposes this bug, which is probably in your application.
For starters, you are not monkey patching socket, I now see. How do you expect requests to work without a monkey patched socket library?
teucer commentedon Jan 17, 2019
Below is the beginning init.py of my flask app
This is called from a run.py
So far it was working...
miguelgrinberg commentedon Jan 17, 2019
From http://eventlet.net/doc/patching.html#monkeypatching-the-standard-library:
teucer commentedon Jan 17, 2019
modified run.py to have
as the first statement to no avail: I am getting the same error
miguelgrinberg commentedon Jan 17, 2019
All the documented instances of this bug were proven to be due to a bad monkey patching, so I have to suspect you still have a problem there. Unless you can provide something I can use to debug this I do not know what else I can do to get to the bottom of this issue.
teucer commentedon Jan 17, 2019
I think the recent updates might have exposed some bugs in
eventlet, when I uninstallflask-socketioit works. Is there a changelog?miguelgrinberg commentedon Jan 17, 2019
You can look at the commit list: https://github.com/miguelgrinberg/python-engineio/commits/master. All releases are clearly marked with a dedicated commit.
teucer commentedon Jan 17, 2019
Removing the lines
fixes the problem.
miguelgrinberg commentedon Jan 17, 2019
It may seem as if the problem is fixed, but that is not the right solution. Without monkey patching your requests calls are going to be blocking.
teucer commentedon Jan 18, 2019
I am deploying the app with
gunicornandeventletworkers. Could you please let me know where the calls would be blocking?PS: I am not using eventlet anywhere else in the code.
miguelgrinberg commentedon Jan 18, 2019
Read up on the topic here: http://eventlet.net/doc/patching.html#greening-the-world
The important concept is this:
You are using requests, which uses the built-in networking libraries in Python.
royrusso commentedon Oct 22, 2019
Sorry to reopen, but related: eventlet/eventlet#371