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

CancelledError Exception on Boot #251

Open
rbrisita opened this issue Apr 18, 2024 · 0 comments
Open

CancelledError Exception on Boot #251

rbrisita opened this issue Apr 18, 2024 · 0 comments

Comments

@rbrisita
Copy link
Contributor

Describe the bug
An exception happens asyncio.exceptions.CancelledError on boot with LOG_LEVEL set to DEBUG:

Traceback (most recent call last):
  File "/home/orangepi/projects/01/software/source/clients/base_device.py", line 358, in websocket_communication
    async with websockets.connect(WS_URL) as websocket:
  File "/home/orangepi/.cache/pypoetry/virtualenvs/01os-CTNZQP68-py3.11/lib/python3.11/site-packages/websockets/legacy/client.py", line 629, in __aenter__
    return await self
           ^^^^^^^^^^
  File "/home/orangepi/.cache/pypoetry/virtualenvs/01os-CTNZQP68-py3.11/lib/python3.11/site-packages/websockets/legacy/client.py", line 647, in __await_impl_timeout__
    return await self.__await_impl__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/orangepi/.cache/pypoetry/virtualenvs/01os-CTNZQP68-py3.11/lib/python3.11/site-packages/websockets/legacy/client.py", line 651, in __await_impl__
    _transport, _protocol = await self._create_connection()
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/orangepi/.pyenv/versions/3.11.9/lib/python3.11/asyncio/base_events.py", line 1070, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/orangepi/.pyenv/versions/3.11.9/lib/python3.11/asyncio/base_events.py", line 974, in _connect_sock
    await self.sock_connect(sock, address)
  File "/home/orangepi/.pyenv/versions/3.11.9/lib/python3.11/asyncio/selector_events.py", line 638, in sock_connect
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError

To Reproduce
Steps to reproduce the behavior:

  1. export LOG_LEVEL=DEBUG
  2. poetry run 01 --local

Expected behavior
Clean boot up of 01OS.

Desktop (please complete the following information):

  • OS: Debian 11 (aarch64)
  • Python Version 3.9.19, 3.10.14, 3.11.9

Additional context
I believe this has to do with client_thread trying to connect to server_thead before the server is ready in start.py. This happens all the time but only visible when viewing debug output.

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