HTTP Request Timeout

4 users tried to login to the webapp, but the webapp crashed upon authenticating with an Internal Server Error. According to the Traceback, it seemed that a timeout has been reached while fetching access token. Do you think there’s a way not to put users under this traffic? Keep in mind that after a while the server regains its course for fewer users entering. That being said, the served webapp works completely find just not when several users entering together.

Traceback found below:

 AttributeError: 'NoneType' object has no attribute 'body'
     body = codecs.decode(response.body, 'utf-8')
   File ".../.local/lib/python3.10/site-packages/panel/auth.py", line 47, in decode_response_body
     body = body or decode_response_body(response)
   File ".../.local/lib/python3.10/site-packages/panel/auth.py", line 345, in _on_error
     return self._on_error(e.response)
   File ".../.local/lib/python3.10/site-packages/panel/auth.py", line 194, in _fetch_access_token
     return await self._fetch_access_token(
   File ".../.local/lib/python3.10/site-packages/panel/auth.py", line 129, in get_authenticated_user
     user = await self.get_authenticated_user(**params)
   File ".../.local/lib/python3.10/site-packages/panel/auth.py", line 315, in get
     result = await result
   File ".../.local/lib/python3.10/site-packages/tornado/web.py", line 1713, in _execute
 Traceback (most recent call last):
 During handling of the above exception, another exception occurred:
 AttributeError: 'NoneType' object has no attribute 'body'
     body = codecs.decode(response.body, 'ascii')
   File ".../.local/lib/python3.10/site-packages/panel/auth.py", line 45, in decode_response_body
 Traceback (most recent call last):
 During handling of the above exception, another exception occurred:
 tornado.simple_httpclient.HTTPTimeoutError: Timeout during request
     response = await http.fetch(req)
   File ".../.local/lib/python3.10/site-packages/panel/auth.py", line 192, in _fetch_access_token
 Traceback (most recent call last):
 HTTPServerRequest(protocol='http', host='xxxx:yyyy', method='GET', uri='/login?next=%2F%3Fcode%...
 2023-11-30 07:16:46,767 Uncaught exception GET /login?next=%2F%3Fcode%...%26scope%3Dopenid%2520email%26...
 2023-11-30 07:14:49,696 Starting Bokeh server with process id: 1060
 2023-11-30 07:14:49,696 Bokeh app running at: http://localhost:5000/app

2 Likes

Hi @simonay

This is a difficult question for Discourse. I would recommend posting this as a bug on github. Try to make the issue as specific and reproducible as possible. That would give someone a better chance to try to help.

2 Likes

Hi @simonay

This is using OAuth Providers in Panel? I haven’t used it yet, but am planning to give it a try soon. Which provider are you using? (I was going to try GitHub and MS Azure)
https://panel.holoviz.org/how_to/authentication/index.html

@Marc - I just saw here in the Authentication documentation it says that Panel is using tornado, but here under Azure Deployment it says gunicorn. Should I do a pull request or are both web servers being used? Microsoft Azure — Panel v1.3.4

Hi @petegordon ,

It all depends on your project’s needs. I’m not using any of the built-in providers, I’m building a generic one for specific needs. It all depends on your user’s preferred background I guess. The built-in providers work beautifully.

1 Like

on it, thanks.