"Kernel panic" bei erstem Seitenaufruf #43

Open
opened 2022-02-23 14:37:46 +01:00 by Brain · 6 comments
Owner

Zusammenfassung

Beim ersten Aufruf von https://ki.wtf-eg.de nach einer längeren Pause zeigt das Frontend "Kernel panic :/" (siehe Anhang).

Schritte zum Nachstellen des Problems

  • Benutze KI
  • Logge dich nicht aus
  • Schließe den Tab
  • Warte ein paar Tage (erforderliches Zeitfenster unbekannt)
  • Rufe https://ki.wtf-eg.de auf

Erwartetes Verhalten

In der Übersicht sollte eine Auflistung von Kompetenzeinträgen auftauchen.

Aktuelles Verhalten

Die Startseite zeigt einen Fehler.

GET https://ki.wtf-eg.de/api/users/profiles
Status 500 Internal Server Error
Version HTTP/2
Übertragen 511 B (290 B Größe)
Referrer Policy strict-origin-when-cross-origin

Antwortkopfzeilen:
access-control-allow-origin     https://ki.wtf-eg.de/
content-length                  290
content-type                    text/html; charset=utf-8
date                            Wed, 23 Feb 2022 13:12:22 GMT
server                          nginx
X-Firefox-Spdy                  h2

Anfragekopfzeilen:
Accept              */*
Accept-Encoding     gzip, deflate, br
Accept-Language     de,en-US;q=0.7,en;q=0.3
Authorization       Bearer [REDACTED]
Connection          keep-alive
Host                ki.wtf-eg.de
Referer             https://ki.wtf-eg.de/s/search
Sec-Fetch-Dest      empty
Sec-Fetch-Mode      cors
Sec-Fetch-Site      same-origin
TE                  trailers
User-Agent          Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0

Ein direkter Klick auf Suchen ist erfolgreich. Der Request ist exakt gleich zum ersten, mit der Ausnahme, dass der TE-Header fehlt. Ein erneutes Abschicken inklusive dem TE-Header führt aber nicht wieder zu einem Fehler.

Sonstiges

  • Betriebssystem (inkl. Version): macOS 12.2.1
  • Browser (inkl. Version): Firefox 97.0.1 (64-bit)
## Zusammenfassung Beim ersten Aufruf von https://ki.wtf-eg.de nach einer längeren Pause zeigt das Frontend "Kernel panic :/" (siehe Anhang). ## Schritte zum Nachstellen des Problems - Benutze KI - Logge dich nicht aus - Schließe den Tab - Warte ein paar Tage (erforderliches Zeitfenster unbekannt) - Rufe https://ki.wtf-eg.de auf **Erwartetes Verhalten** In der Übersicht sollte eine Auflistung von Kompetenzeinträgen auftauchen. **Aktuelles Verhalten** Die Startseite zeigt einen Fehler. ``` GET https://ki.wtf-eg.de/api/users/profiles Status 500 Internal Server Error Version HTTP/2 Übertragen 511 B (290 B Größe) Referrer Policy strict-origin-when-cross-origin Antwortkopfzeilen: access-control-allow-origin https://ki.wtf-eg.de/ content-length 290 content-type text/html; charset=utf-8 date Wed, 23 Feb 2022 13:12:22 GMT server nginx X-Firefox-Spdy h2 Anfragekopfzeilen: Accept */* Accept-Encoding gzip, deflate, br Accept-Language de,en-US;q=0.7,en;q=0.3 Authorization Bearer [REDACTED] Connection keep-alive Host ki.wtf-eg.de Referer https://ki.wtf-eg.de/s/search Sec-Fetch-Dest empty Sec-Fetch-Mode cors Sec-Fetch-Site same-origin TE trailers User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0 ``` Ein direkter Klick auf _Suchen_ ist erfolgreich. Der Request ist exakt gleich zum ersten, mit der Ausnahme, dass der TE-Header fehlt. Ein erneutes Abschicken inklusive dem TE-Header führt aber nicht wieder zu einem Fehler. ## Sonstiges - Betriebssystem (inkl. Version): macOS 12.2.1 - Browser (inkl. Version): Firefox 97.0.1 (64-bit)
Brain added the
bug
label 2022-02-23 14:37:46 +01:00
Author
Owner

Durch das neue Release taucht jetzt bei dieser Situation folgendes im Log auf:

[2022-03-01 15:27:01,114] ERROR in app: Exception on /users/profiles [GET]
Traceback (most recent call last):
  File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 756, in _write_bytes
    self._sock.sendall(data)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1771, in _execute_context
    self.dialect.do_execute(
  File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
    cursor.execute(statement, parameters)
  File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 547, in query
    self._execute_command(COMMAND.COM_QUERY, sql)
  File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 814, in _execute_command
    self._write_bytes(packet)
  File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 759, in _write_bytes
    raise err.OperationalError(
pymysql.err.OperationalError: (2006, "MySQL server has gone away (ConnectionResetError(104, 'Connection reset by peer'))")
The above exception was the direct cause of the following exception:
[...]

Es scheint also die Datenbankverbindung nach einer gewissen Zeit getrennt zu werden. Vielleicht auch die Ursache von #25

Durch das neue Release taucht jetzt bei dieser Situation folgendes im Log auf: ``` [2022-03-01 15:27:01,114] ERROR in app: Exception on /users/profiles [GET] Traceback (most recent call last): File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 756, in _write_bytes self._sock.sendall(data) ConnectionResetError: [Errno 104] Connection reset by peer During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1771, in _execute_context self.dialect.do_execute( File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute cursor.execute(statement, parameters) File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute result = self._query(query) File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query conn.query(q) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 547, in query self._execute_command(COMMAND.COM_QUERY, sql) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 814, in _execute_command self._write_bytes(packet) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 759, in _write_bytes raise err.OperationalError( pymysql.err.OperationalError: (2006, "MySQL server has gone away (ConnectionResetError(104, 'Connection reset by peer'))") The above exception was the direct cause of the following exception: [...] ``` Es scheint also die Datenbankverbindung nach einer gewissen Zeit getrennt zu werden. Vielleicht auch die Ursache von #25

Ich hatte vorhin auch das Login-Problem. Wenn ihr wollt könnt ihr mal im Log nachsehen.

Ich hatte vorhin auch das Login-Problem. Wenn ihr wollt könnt ihr mal im Log nachsehen.
Mascha added the
prio
2
label 2023-09-01 10:31:43 +02:00
srsh added this to the Project for KI project 2024-01-06 12:59:23 +01:00
Owner

Welche Datenbankversion läuft auf prod?

Welche Datenbankversion läuft auf prod?
Member

Ich habe versucht, den Fehler zu reproduzieren und es ist mir bisher nicht gelungen.

Was ich getan habe:

  1. docker-compose file angepasst und MySQL service hinzugefügt
  2. Backend auf MySQL umkonfiguriert
  3. alle Container gestartet
  4. auf der Seite rumgeklickt
  5. MySQL container pausiert
  6. auf der Seite rumgeklickt: Backend hängt ohne Fehlermeldung
  7. MySQL container resumed
  8. Backend reagiert wieder ohne Fehlermeldung
  9. MySQL container restarted
  10. Backend hängt kurz und läuft normal weiter ohne Fehlermeldung
Ich habe versucht, den Fehler zu reproduzieren und es ist mir bisher nicht gelungen. Was ich getan habe: 1. docker-compose file angepasst und MySQL service hinzugefügt 1. Backend auf MySQL umkonfiguriert 1. alle Container gestartet 1. auf der Seite rumgeklickt 1. MySQL container pausiert 1. auf der Seite rumgeklickt: Backend hängt ohne Fehlermeldung 1. MySQL container resumed 1. Backend reagiert wieder ohne Fehlermeldung 1. MySQL container restarted 1. Backend hängt kurz und läuft normal weiter ohne Fehlermeldung
Author
Owner

Welche Datenbankversion läuft auf prod?

MariaDB 10.6

> Welche Datenbankversion läuft auf prod? MariaDB 10.6
Author
Owner

Auf https://ki.dev.wtf-eg.de läuft es mit MariaDB 10.11 und dort tritt der Fehler gleichermaßen auf:

[2024-01-06 13:06:38,193] ERROR [waitress] Exception while serving /users/profiles
Traceback (most recent call last):
  File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 760, in _write_bytes
    self._sock.sendall(data)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context
    self.dialect.do_execute(
  File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
  File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query
    self._execute_command(COMMAND.COM_QUERY, sql)
  File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 818, in _execute_command
    self._write_bytes(packet)
  File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 763, in _write_bytes
    raise err.OperationalError(
pymysql.err.OperationalError: (2006, "MySQL server has gone away (ConnectionResetError(104, 'Connection reset by peer'))")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/pyroot/lib/python3.8/site-packages/waitress/channel.py", line 397, in service
    task.service()
  File "/pyroot/lib/python3.8/site-packages/waitress/task.py", line 168, in service
    self.execute()
  File "/pyroot/lib/python3.8/site-packages/waitress/task.py", line 434, in execute
    app_iter = self.channel.server.application(environ, start_response)
  File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 2076, in wsgi_app
    response = self.handle_exception(e)
  File "/pyroot/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/pyroot/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/app/ki/routes.py", line 30, in _token_auth
    token = Token.query.filter(Token.token == auth_header[7:]).first()
  File "/pyroot/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2824, in first
    return self.limit(1)._iter().first()
  File "/pyroot/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2916, in _iter
    result = self.session.execute(
  File "/pyroot/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1717, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
  File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1710, in _execute_20
   return meth(self, args_10style, kwargs_10style, execution_options)
 File "/pyroot/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection
   return connection._execute_clauseelement(
 File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1577, in _execute_clauseelement
   ret = self._execute_context(
 File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1953, in _execute_context
   self._handle_dbapi_exception(
 File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2134, in _handle_dbapi_exception
   util.raise_(
 File "/pyroot/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
   raise exception
 File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context
   self.dialect.do_execute(
 File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
   cursor.execute(statement, parameters)
 File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 158, in execute
   result = self._query(query)
 File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 325, in _query
   conn.query(q)
 File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query
   self._execute_command(COMMAND.COM_QUERY, sql)
 File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 818, in _execute_command
   self._write_bytes(packet)
 File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 763, in _write_bytes
   raise err.OperationalError(
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2006, "MySQL server has gone away (ConnectionResetError(104, 'Connection reset by peer'))")
[SQL: SELECT token.id AS token_id, token.user_id AS token_user_id, token.token AS token_token
FROM token
WHERE token.token = %(token_1)s
LIMIT %(param_1)s]
[parameters: {'token_1': '***REDACTED***', 'param_1': 1}]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
Auf https://ki.dev.wtf-eg.de läuft es mit MariaDB 10.11 und dort tritt der Fehler gleichermaßen auf: ``` [2024-01-06 13:06:38,193] ERROR [waitress] Exception while serving /users/profiles Traceback (most recent call last): File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 760, in _write_bytes self._sock.sendall(data) ConnectionResetError: [Errno 104] Connection reset by peer During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context self.dialect.do_execute( File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute cursor.execute(statement, parameters) File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 158, in execute result = self._query(query) File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 325, in _query conn.query(q) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query self._execute_command(COMMAND.COM_QUERY, sql) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 818, in _execute_command self._write_bytes(packet) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 763, in _write_bytes raise err.OperationalError( pymysql.err.OperationalError: (2006, "MySQL server has gone away (ConnectionResetError(104, 'Connection reset by peer'))") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/pyroot/lib/python3.8/site-packages/waitress/channel.py", line 397, in service task.service() File "/pyroot/lib/python3.8/site-packages/waitress/task.py", line 168, in service self.execute() File "/pyroot/lib/python3.8/site-packages/waitress/task.py", line 434, in execute app_iter = self.channel.server.application(environ, start_response) File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 2091, in __call__ return self.wsgi_app(environ, start_response) File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 2076, in wsgi_app response = self.handle_exception(e) File "/pyroot/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request rv = self.handle_user_exception(e) File "/pyroot/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/pyroot/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "/app/ki/routes.py", line 30, in _token_auth token = Token.query.filter(Token.token == auth_header[7:]).first() File "/pyroot/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2824, in first return self.limit(1)._iter().first() File "/pyroot/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2916, in _iter result = self.session.execute( File "/pyroot/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1717, in execute result = conn._execute_20(statement, params or {}, execution_options) File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1710, in _execute_20 return meth(self, args_10style, kwargs_10style, execution_options) File "/pyroot/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection return connection._execute_clauseelement( File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1577, in _execute_clauseelement ret = self._execute_context( File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1953, in _execute_context self._handle_dbapi_exception( File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2134, in _handle_dbapi_exception util.raise_( File "/pyroot/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 211, in raise_ raise exception File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context self.dialect.do_execute( File "/pyroot/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute cursor.execute(statement, parameters) File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 158, in execute result = self._query(query) File "/pyroot/lib/python3.8/site-packages/pymysql/cursors.py", line 325, in _query conn.query(q) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query self._execute_command(COMMAND.COM_QUERY, sql) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 818, in _execute_command self._write_bytes(packet) File "/pyroot/lib/python3.8/site-packages/pymysql/connections.py", line 763, in _write_bytes raise err.OperationalError( sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2006, "MySQL server has gone away (ConnectionResetError(104, 'Connection reset by peer'))") [SQL: SELECT token.id AS token_id, token.user_id AS token_user_id, token.token AS token_token FROM token WHERE token.token = %(token_1)s LIMIT %(param_1)s] [parameters: {'token_1': '***REDACTED***', 'param_1': 1}] (Background on this error at: https://sqlalche.me/e/14/e3q8) ```
Sign in to join this conversation.
No description provided.