synesthesiam / homeassistant-satellite

Streaming audio satellite for Home Assistant
MIT License
186 stars 22 forks source link

Temporary failure in name resolution #79

Open ignacio82 opened 9 months ago

ignacio82 commented 9 months ago

I'm trying to run homeassistant-satellite as a docker container. This is what I get when I try to start the container:

  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host http:80 ssl:default [Temporary failure in name resolution]
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1152, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 874, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Temporary failure in name resolution
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 28, in stream
    async with session.ws_connect(url) as websocket:
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 779, in _ws_connect
    resp = await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host http:80 ssl:default [Temporary failure in name resolution]
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1152, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 874, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Temporary failure in name resolution
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 28, in stream
    async with session.ws_connect(url) as websocket:
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 779, in _ws_connect
    resp = await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host http:80 ssl:default [Temporary failure in name resolution]
raetha commented 9 months ago

Can you share your Docker command or compose? It looks like you specified the Home Assistant host name as “http:80”. That is unlikely to work, but easiest to confirm if you share your config. Do make sure you’ve specified the right host for Home Assistant.

ignacio82 commented 9 months ago
version: "3.9"
services:
  homeassistant-satellite:
    image: "ghcr.io/synesthesiam/homeassistant-satellite:latest"
    devices:
      - /dev/snd:/dev/snd
    group_add:
      - audio
    command:
      - --host
      - http://192.168.86.124:8123
      - --token
      - eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI5N_THE_REST_IS_SUPER_SECRET

Thanks for the help

raetha commented 9 months ago

Try setting host to just 192.168.86.124 without specifying the port or protocol. Since there is a separate "--protocol" argument to use https, I'm thinking the "--host" argument isn't coded to handle the protocol in the value and assumes port 8123 for http. I've just been using an IP in my local installs successfully, and have not tested this in docker specifically, but it works perfectly for me with just IP.

ignacio82 commented 9 months ago

Thanks. That was at least part of the problem. This is what I have on my logs now:

ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:831: audio open error: No such file or directory

In case it is relevant, this is the usb mic that I'm trying to use: Bus 011 Device 002: ID 291a:3308 ANKER Anker PowerConf S330

Any suggestions?

raetha commented 9 months ago

That sounds like an alsa config issue. Can you share /etc/asound.conf and the .asoundrc file from your home directory? I’m guessing one has a discontinued dsnoop section.On Dec 3, 2023, at 13:27, Ignacio Martinez @.***> wrote: Thanks. That was at least part of the problem. This is what I have on my logs now: ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave arecord: main:831: audio open error: No such file or directory

Any suggestions?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

ignacio82 commented 9 months ago
$ sudo more /etc/asound.conf
more: cannot open /etc/asound.conf: No such file or directory

$ more ~/.asoundrc 
more: cannot open /home/ignacio/.asoundrc: No such file or directory

I guess that is the problem? Any suggestion for how to fix it? I'm running docker on ubuntu server in case it is relevant.

raetha commented 9 months ago

Oh shoot, I forgot you were in docker. My only quick thought is that you aren't passing /dev/snd in to the docker container, so it can't access the sound card of the host. However if anything on the host is using the soundcard, the docker container wouldn't be able to. I think I've seen reference somewhere to being able to forward pulseaudio or pipewire sockets into a docker container, though that might require you to do your own image build and make sure the right files are included. If you know your host is using pulseaudio or pipewire, you may want to search the other issues on this repo, or the general internet for advice on how to get those working with docker.

Good luck!

ignacio82 commented 9 months ago

I'm not sure if this is progress, but at least i'm getting a different set of errors:

ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
ERROR:__main__:Unexpected error
Traceback (most recent call last):
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 246, in main
    async for _timestamp, event_type, event_data in stream(
  File "/usr/src/app/homeassistant_satellite/remote.py", line 37, in stream
    message_id, handler_id = await _start_pipeline(
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/homeassistant_satellite/remote.py", line 119, in _start_pipeline
    assert msg["success"], "Pipeline failed to run"
AssertionError: Pipeline failed to run
chatziko commented 9 months ago

Pipeline failed to run indicates that something went wrong on the HA side, eg wake word is not configured under Settings > Voice Assistants. Running with --debug might give more info.

ignacio82 commented 9 months ago

I was finally able to get this docker thing to work!! In case it is helpful to anyone else:

version: "3.9"

services:
  homeassistant-satellite:
    image: "ghcr.io/synesthesiam/homeassistant-satellite:latest"
    devices:
      - /dev/snd:/dev/snd
    group_add:
      - audio
    command:
      - "--host"
      - "192.168.86.124"
      - "--token"
      - "SUPER_SECRET_TOKEN"
      - "--mic-device"
      - "plughw:CARD=S330,DEV=0"
      - "--snd-device"
      - "plughw:CARD=S330,DEV=0"
      - "--auto-gain"
      - "5"
      - "--vad"
      - "webrtcvad"    
ignacio82 commented 9 months ago

One more update. woke up and the container was not longer working. This is what I can see in my logs:

ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054979' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054981' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054983' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054985' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054987' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054989' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054991' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054993' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054995' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3054997' coro=<ClientWebSocketResponse.send_bytes() done, defined at /usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py:153> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

Any ideas whay might be causing this or how to solve it?