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

[BUG] Error while login on instance setup using docker-compose #5483

Closed
Tracked by #5705
Aadesh-Baral opened this issue Dec 15, 2022 · 4 comments
Closed
Tracked by #5705

[BUG] Error while login on instance setup using docker-compose #5483

Aadesh-Baral opened this issue Dec 15, 2022 · 4 comments

Comments

@Aadesh-Baral
Copy link
Contributor

Aadesh-Baral commented Dec 15, 2022

/system/authentication/login throws error after the authorization on instance setup using docker. This issue is probably related to gevent as this issue started after the update of gevent and greenlet in #5316 which had to be done to resolve #5300.

Error log:

ERROR in app: Exception on /api/v2/system/authentication/callback/ [GET]
backend       | Traceback (most recent call last):
backend       |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
backend       |     rv = self.dispatch_request()
backend       |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
backend       |     return self.view_functions[rule.endpoint](**req.view_args)
backend       |   File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
backend       |     resp = resource(*args, **kwargs)
backend       |   File "/usr/local/lib/python3.7/site-packages/flask/views.py", line 89, in view
backend       |     return self.dispatch_request(*args, **kwargs)
backend       |   File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
backend       |     resp = meth(*args, **kwargs)
backend       |   File "/usr/src/app/backend/api/system/authentication.py", line 72, in get
backend       |     code=authorization_code,
backend       |   File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 350, in fetch_token
backend       |     **request_kwargs
backend       |   File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 522, in request
backend       |     method, url, headers=headers, data=data, **kwargs
backend       |   File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 529, in request
backend       |     resp = self.send(prep, **send_kwargs)
backend       |   File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 645, in send
backend       |     r = adapter.send(request, **kwargs)
backend       |   File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 450, in send
backend       |     timeout=timeout
backend       |   File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 710, in urlopen
backend       |     chunked=chunked,
backend       |   File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 386, in _make_request
backend       |     self._validate_conn(conn)
backend       |   File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
backend       |     conn.connect()
backend       |   File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 397, in connect
backend       |     cert_reqs=resolve_cert_reqs(self.cert_reqs),
backend       |   File "/usr/local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 312, in create_urllib3_context
backend       |     context.options |= options
backend       |   File "/usr/local/lib/python3.7/ssl.py", line 518, in options
backend       |     super(SSLContext, SSLContext).options.__set__(self, value)
backend       |   File "/usr/local/lib/python3.7/ssl.py", line 518, in options
backend       |     super(SSLContext, SSLContext).options.__set__(self, value)
backend       |   File "/usr/local/lib/python3.7/ssl.py", line 518, in options
backend       |     super(SSLContext, SSLContext).options.__set__(self, value)
backend       |   [Previous line repeated 428 more times]
backend       | RecursionError: maximum recursion depth exceeded
@Aadesh-Baral
Copy link
Contributor Author

I've managed to fix this issue by using gevent.monkey.patch_ssl() before any imports on backend.__init__.py. Most of the solution on the internet points out setting gevent.monkey.patch_all() , since we have issue around the SSL i've patched SSL only instead of patching everything. But i am not sure if this is a right way of solving this issue. If anybody have faced this issue any help will be hugely appreciated.

@Aadesh-Baral Aadesh-Baral linked a pull request Dec 15, 2022 that will close this issue
@nicokant
Copy link
Contributor

nicokant commented May 4, 2023

I'm having the same issue, the workaround proposed by @Aadesh-Baral seems to work fine.

@eternaltyro
Copy link
Collaborator

Probably fixed by #5642 . Needs to be verified.

@ramyaragupathy
Copy link
Member

Not relevant anymore as the login works well with recent docker setup

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

Successfully merging a pull request may close this issue.

4 participants