PenningLabs / lxconsole

LXD Graphical Web Console
GNU Affero General Public License v3.0
161 stars 19 forks source link

500 Internal Server Error after a while #30

Open khairul169 opened 2 weeks ago

khairul169 commented 2 weeks ago

First of all, thank you for providing such fantastic software; it’s truly impressive!

I’d like to report an issue that has been somewhat troublesome for me. Sometimes, the website throws an internal server error, and I can’t access anything unless I manually clear the cookies or restart the container.

image

LXConsole version: v0.6.0

How to reproduce:

Logs: ``` lxconsole-1 | 95.214.55.138 - - [28/Oct/2024 03:07:41] "GET / HTTP/1.1" 302 - lxconsole-1 | 198.235.24.90 - - [28/Oct/2024 04:55:06] "GET / HTTP/1.1" 302 - lxconsole-1 | 198.235.24.90 - - [28/Oct/2024 04:55:06] "GET /login HTTP/1.1" 200 - lxconsole-1 | 95.214.55.43 - - [28/Oct/2024 05:53:35] "GET / HTTP/1.1" 302 - lxconsole-1 | 95.214.53.91 - - [28/Oct/2024 06:17:41] "GET / HTTP/1.1" 302 - lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:20:50] "GET / HTTP/1.1" 302 - lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:20:51] code 505, message Invalid HTTP version (2.0) lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:20:51] "PRI * HTTP/2.0" HTTPStatus.HTTP_VERSION_NOT_SUPPORTED - lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:20:56] "GET /login HTTP/1.1" 200 - lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:20:57] "GET /static/assets/img/logo-light.svg HTTP/1.1" 200 - lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:20:57] "GET /favicon.ico HTTP/1.1" 404 - lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:20:58] code 505, message Invalid HTTP version (2.0) lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:20:58] "PRI * HTTP/2.0" HTTPStatus.HTTP_VERSION_NOT_SUPPORTED - lxconsole-1 | 162.142.125.35 - - [28/Oct/2024 06:21:00] "GET / HTTP/1.1" 302 - lxconsole-1 | 125.229.225.33 - - [28/Oct/2024 06:56:24] "GET / HTTP/1.0" 302 - lxconsole-1 | 95.214.55.138 - - [28/Oct/2024 06:58:18] "GET / HTTP/1.1" 302 - lxconsole-1 | 220.133.196.95 - - [28/Oct/2024 07:13:29] "GET / HTTP/1.0" 302 - lxconsole-1 | 216.218.206.66 - - [28/Oct/2024 07:34:28] "GET / HTTP/1.1" 302 - lxconsole-1 | 216.218.206.66 - - [28/Oct/2024 07:34:37] "GET / HTTP/1.1" 302 - lxconsole-1 | 216.218.206.66 - - [28/Oct/2024 07:34:37] "GET /login HTTP/1.1" 200 - lxconsole-1 | 216.218.206.66 - - [28/Oct/2024 07:34:41] "GET /favicon.ico HTTP/1.1" 404 - lxconsole-1 | 216.218.206.66 - - [28/Oct/2024 07:34:43] "GET http://api.ipify.org/?format=json HTTP/1.1" 302 - lxconsole-1 | 216.218.206.66 - - [28/Oct/2024 07:34:46] "CONNECT www.shadowserver.org:443 HTTP/1.1" 404 - lxconsole-1 | 114.46.99.12 - - [28/Oct/2024 08:16:12] "GET / HTTP/1.0" 302 - lxconsole-1 | 172.21.0.1 - - [28/Oct/2024 08:44:19] "GET / HTTP/1.1" 302 - lxconsole-1 | [2024-10-28 08:44:19,449] ERROR in app: Exception on /servers [GET] lxconsole-1 | Traceback (most recent call last): lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app lxconsole-1 | response = self.full_dispatch_request() lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request lxconsole-1 | rv = self.handle_user_exception(e) lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request lxconsole-1 | rv = self.dispatch_request() lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request lxconsole-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask_login/utils.py", line 290, in decorated_view lxconsole-1 | return current_app.ensure_sync(func)(*args, **kwargs) lxconsole-1 | File "/opt/lxconsole/lxconsole/routes.py", line 125, in servers lxconsole-1 | return render_template('servers.html', page_title='Servers', page_user_id=current_user.id, page_username=current_user.username, client_crt=session['client_crt']) lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/sessions.py", line 79, in __getitem__ lxconsole-1 | return super().__getitem__(key) lxconsole-1 | KeyError: 'client_crt' lxconsole-1 | 172.21.0.1 - - [28/Oct/2024 08:44:19] "GET /servers HTTP/1.1" 500 - lxconsole-1 | 172.21.0.1 - - [28/Oct/2024 08:44:19] "GET /favicon.ico HTTP/1.1" 404 - lxconsole-1 | 172.21.0.1 - - [28/Oct/2024 08:44:27] "GET / HTTP/1.1" 302 - lxconsole-1 | [2024-10-28 08:44:28,021] ERROR in app: Exception on /servers [GET] lxconsole-1 | Traceback (most recent call last): lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app lxconsole-1 | response = self.full_dispatch_request() lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request lxconsole-1 | rv = self.handle_user_exception(e) lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request lxconsole-1 | rv = self.dispatch_request() lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request lxconsole-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask_login/utils.py", line 290, in decorated_view lxconsole-1 | return current_app.ensure_sync(func)(*args, **kwargs) lxconsole-1 | File "/opt/lxconsole/lxconsole/routes.py", line 125, in servers lxconsole-1 | return render_template('servers.html', page_title='Servers', page_user_id=current_user.id, page_username=current_user.username, client_crt=session['client_crt']) lxconsole-1 | File "/usr/local/lib/python3.10/site-packages/flask/sessions.py", line 79, in __getitem__ lxconsole-1 | return super().__getitem__(key) lxconsole-1 | KeyError: 'client_crt' lxconsole-1 | 172.21.0.1 - - [28/Oct/2024 08:44:28] "GET /servers HTTP/1.1" 500 - ```