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

[Bug]: Evok does not handle not running owserver properly #200

Open
2 tasks done
cleveHEX opened this issue Jan 8, 2025 · 0 comments
Open
2 tasks done

[Bug]: Evok does not handle not running owserver properly #200

cleveHEX opened this issue Jan 8, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@cleveHEX
Copy link
Collaborator

cleveHEX commented Jan 8, 2025

Prerequisites

  • I am running the latest Evok version
  • I have searched other issues

Describe the bug

When the owserver is not running, evok does not state this information and throws errors.

Evok log

Jan 08 11:26:07 UNIPI1-sn8169 systemd[1]: Started evok.service - EVOK Rest/WebSocket/RPC Server.
-- Subject: A start job for unit evok.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit evok.service has finished successfully.
--
-- The job identifier is 2490.
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: INFO:evok:Starting Evok v3.0.6 using config directory '/etc/evok'.
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: INFO:evok:Setting logging level to 'WARNING'.
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: ERROR:asyncowfs.service:Could not start 127.0.0.1:4304 CancelledError('Cancelled by cancel scope 75cb7c70')
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: ERROR:tornado.application:Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x75cc0450>>, <Task finished name='Task-2' coro=<OwBusDriver.run() done, defined at /opt/evok/lib/python3.11/site-packages/evok/owdevice.py:392> exception=ExceptionGroup('unhandled errors in a TaskGroup', [ExceptionGroup('unhandled errors in a TaskGroup', [OSError('All connection attempts failed')])])>)
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: Traceback (most recent call last):
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/service.py", line 103, in add_server
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:     await s.start()
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/server.py", line 150, in start
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:     await val.get()
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/util.py", line 49, in get
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:     await self.event.wait()
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   File "/opt/evok/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 1662, in wait
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:     await self._event.wait()
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   File "/usr/lib/python3.11/asyncio/locks.py", line 213, in wait
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:     await fut
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: asyncio.exceptions.CancelledError: Cancelled by cancel scope 75cb7c70
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: During handling of the above exception, another exception occurred:
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: Traceback (most recent call last):
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/service.py", line 263, in OWFS
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:     yield s
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   File "/opt/evok/lib/python3.11/site-packages/evok/owdevice.py", line 396, in run
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:     server = await ow.add_server('127.0.0.1', 4304)  # host, port)
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/service.py", line 106, in add_server
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:     await self.push_event(ServerDeregistered(s))
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: asyncio.exceptions.CancelledError: Cancelled by cancel scope 75cb7c70
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]: During handling of the above exception, another exception occurred:
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   + Exception Group Traceback (most recent call last):
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   |   File "/opt/evok/lib/python3.11/site-packages/tornado/ioloop.py", line 738, in _run_callback
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   |     ret = callback()
Jan 08 11:26:09 UNIPI1-sn8169 evok[15363]:   |           ^^^^^^^^^^
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |   File "/opt/evok/lib/python3.11/site-packages/tornado/ioloop.py", line 762, in _discard_future_result
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |     future.result()
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |   File "/opt/evok/lib/python3.11/site-packages/evok/owdevice.py", line 394, in run
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |     async with OWFS(initial_scan=False) as ow:
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |   File "/usr/lib/python3.11/contextlib.py", line 222, in __aexit__
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |     await self.gen.athrow(typ, value, traceback)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/service.py", line 260, in OWFS
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |     async with anyio.create_task_group() as n:
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |   File "/opt/evok/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   |     raise BaseExceptionGroup(
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:   +-+---------------- 1 ----------------
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     | Traceback (most recent call last):
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/server.py", line 101, in _run_one
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |     self.stream = await anyio.connect_tcp(self.host, self.port)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |   File "/opt/evok/lib/python3.11/site-packages/anyio/_core/_sockets.py", line 227, in connect_tcp
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |     raise OSError("All connection attempts failed") from cause
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     | OSError: All connection attempts failed
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     | During handling of the above exception, another exception occurred:
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     | Exception Group Traceback (most recent call last):
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/server.py", line 159, in _run_reconnected
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |     await self._run_one(val)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/server.py", line 99, in _run_one
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |     async with anyio.create_task_group() as tg:
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |   File "/opt/evok/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     |     raise BaseExceptionGroup(
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:     +-+---------------- 1 ----------------
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       | Traceback (most recent call last):
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/opt/evok/lib/python3.11/site-packages/anyio/_core/_sockets.py", line 165, in try_connect
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     stream = await asynclib.connect_tcp(remote_host, remote_port, local_address)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/opt/evok/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2301, in connect_tcp
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     await get_running_loop().create_connection(
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/usr/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     raise exceptions[0]
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/usr/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     sock = await self._connect_sock(
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |            ^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/usr/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     await self.sock_connect(sock, address)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/usr/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     return await fut
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |            ^^^^^^^^^
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/usr/lib/python3.11/asyncio/selector_events.py", line 674, in _sock_connect_cb
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     raise OSError(err, f'Connect call failed {address}')
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       | ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 4304)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       | The above exception was the direct cause of the following exception:
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       | Traceback (most recent call last):
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/opt/evok/lib/python3.11/site-packages/asyncowfs/server.py", line 101, in _run_one
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     self.stream = await anyio.connect_tcp(self.host, self.port)
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |   File "/opt/evok/lib/python3.11/site-packages/anyio/_core/_sockets.py", line 227, in connect_tcp
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       |     raise OSError("All connection attempts failed") from cause
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       | OSError: All connection attempts failed
Jan 08 11:26:10 UNIPI1-sn8169 evok[15363]:       +------------------------------------

Steps to reproduce

  1. Stop owserver
  2. Restart Evok
  3. Read the log

Expected behavior

Evok complains about owserver not running

Actual behavior

Throws errors that do not help the user resolve the situation.

@cleveHEX cleveHEX added the bug Something isn't working label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants