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

Frontend crash due to SSL connection has been closed unexpectedly #465

Open
dale-wahl opened this issue Nov 19, 2024 · 2 comments
Open

Frontend crash due to SSL connection has been closed unexpectedly #465

dale-wahl opened this issue Nov 19, 2024 · 2 comments

Comments

@dale-wahl
Copy link
Member

Describe the bug
Not sure yet what caused the crash/disconnect, but once this error hits, the connection to the database is dead/needs a rollback. All other calls fail (since they invariably require something from the database if only user data).

2024-11-17 06:01:32,727 [ERROR]  Exception on / [GET]
Traceback (most recent call last):
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask/app.py", line 1482, in full_dispatch_request
    rv = self.preprocess_request()
         ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask/app.py", line 1974, in preprocess_request
    rv = self.ensure_sync(before_func)()
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask_limiter/extension.py", line 373, in __check_request_limit
    or any(fn() for fn in self._request_filters)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask_limiter/extension.py", line 373, in <genexpr>
    or any(fn() for fn in self._request_filters)
           ^^^^
  File "/opt/4cat/webtool/views/views_user.py", line 167, in exempt_from_limit
    if not config.get("flask.autologin.api"):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/common/config_manager.py", line 489, in get
    return self.config.get(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/common/config_manager.py", line 236, in get
    tags = self.get_active_tags(user, tags)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/common/config_manager.py", line 313, in get_active_tags
    if hasattr(user, "get_id"):
       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/werkzeug/local.py", line 311, in __get__
    obj = instance._get_current_object()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/werkzeug/local.py", line 515, in _get_current_object
    return get_name(local())
                    ^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask_login/utils.py", line 25, in <lambda>
    current_user = LocalProxy(lambda: _get_user())
                                      ^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask_login/utils.py", line 370, in _get_user
    current_app.login_manager._load_user()
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask_login/login_manager.py", line 383, in _load_user
    return self._update_request_context_with_user(user)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/flask_login/login_manager.py", line 339, in _update_request_context_with_user
    user = self.anonymous_user()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/common/lib/user.py", line 73, in get_by_name
    user = db.fetchone("SELECT * FROM users WHERE name = %s", (name,))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/common/lib/database.py", line 320, in fetchone
    self.query(query, cursor=cursor, *args)
  File "/opt/4cat/common/lib/database.py", line 68, in query
    return cursor.execute(query, replacements)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/4cat/venv/lib/python3.11/site-packages/psycopg2/extras.py", line 236, in execute
    return super().execute(query, vars)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: SSL connection has been closed unexpectedly
@dale-wahl
Copy link
Member Author

PR #466 should address these sort of disconnect errors.

@dale-wahl
Copy link
Member Author

screenshots and appstudies both backends found crashed with SSL error. Previously it was only the frontend...

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

No branches or pull requests

1 participant