OpenInterpreter / 01

The #1 open-source voice interface for desktop, mobile, and ESP32 chips.
https://01.openinterpreter.com/
GNU Affero General Public License v3.0
4.92k stars 517 forks source link

`CancelledError` Exception on Boot #251

Open rbrisita opened 5 months ago

rbrisita commented 5 months ago

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):

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.