Uninett / zinolib

Python library for zino
Apache License 2.0
1 stars 3 forks source link

Writable socket not set up correctly #69

Closed hmpf closed 3 months ago

hmpf commented 3 months ago
2024-07-02 08:02:58,661 ERROR howitz VENV/lib/python3.11/site-packages/howitz/error_handlers.py:46:: Exception in /get_events: :
Traceback (most recent call last):
  File "VENV/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "VENV/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "VENV/lib/python3.11/site-packages/howitz/endpoints.py", line 503, in get_events
    table_events = get_current_events()
                   ^^^^^^^^^^^^^^^^^^^^
  File "VENV/lib/python3.11/site-packages/howitz/endpoints.py", line 166, in get_current_events
    current_app.event_manager.get_events()
  File "VENV/lib/python3.11/site-packages/zinolib/controllers/zino1.py", line 576, in get_events
    self._verify_session()
  File "VENV/lib/python3.11/site-packages/zinolib/controllers/zino1.py", line 526, in _verify_session
    raise ValueError
ValueError
hmpf commented 3 months ago

_verify_session raises ValueError if the session hasn't been set up correctly. The Zino1EventManager must have been constructed correctly by running Zino1EventManager(session) and the session cannot be None.

Given a manager-object manager:

If we have lost the connection and it has been cleaned up correctly (via manager.disconnect()`` thenmanager.session.requestwill be None, which will raise the ValueError next time something runs_verify_session`.