madmachinations / home-assistant-alexa-shopping-list

A custom component for Home Assistant which synchronises your Alexa Shopping List
GNU General Public License v3.0
32 stars 3 forks source link

Timeout #26

Open lukasschneider911 opened 4 weeks ago

lukasschneider911 commented 4 weeks ago

Hi! I installed the "Alexa Shopping List Sync" as an Add-on in my Home Assistant OS setup. I also installed the "Advanced SSH & Web Terminal" Add-on to execute the Python client-script to configure the server. I managed to get it authenticated with "amazon.de" and was initially able to display my shopping list items using the "list" command.

Since the "Alexa Shopping List" integration failed to synchronize, I went back to the client to verify the authentication but receive this error message ever since:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1287, in close_connection
    await self.transfer_data_task
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 953, in transfer_data
    message = await self.read_message()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1023, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1098, in read_data_frame
    frame = await self.read_frame(max_size)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 1155, in read_frame
    frame = await Frame.read(
            ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/websockets/legacy/framing.py", line 70, in read
    data = await reader(2)
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/streams.py", line 752, in readexactly
    await self._wait_for_data('readexactly')
  File "/usr/lib/python3.12/asyncio/streams.py", line 545, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/homeassistant/client/client.py", line 288, in <module>
    asyncio.run(client.run_console())
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/homeassistant/client/client.py", line 274, in run_console
    keep_running = await self._handle_commands(command, arguments)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/homeassistant/client/client.py", line 236, in _handle_commands
    await self._cmd_get_shopping_list()
  File "/homeassistant/client/client.py", line 188, in _cmd_get_shopping_list
    response = await self._send_command("get_list")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/homeassistant/client/client.py", line 39, in _send_command
    response = await websocket.recv()
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 562, in recv
    await self.ensure_open()
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 938, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1011 (internal error) keepalive ping timeout; no close frame received

In the Add-on log the error looks like this:

connection handler failed
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/websockets/legacy/server.py", line 245, in handler
    await self.ws_handler(self)
  File "/usr/lib/python3.12/site-packages/websockets/legacy/server.py", line 1188, in _ws_handler
    return await cast(
           ^^^^^^^^^^^
  File "/server/server.py", line 250, in _process_command
    async for message in websocket:
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 494, in __aiter__
    yield await self.recv()
          ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 564, in recv
    await self.ensure_open()
  File "/usr/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 940, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: received 1011 (internal error) keepalive ping timeout; then sent 1011 (internal error) keepalive ping timeout

It looks like the server is running into a timeout.

Do you have an idea, what could be causing this?

Cheers, Lukas

madmachinations commented 4 weeks ago

Is this running on a raspberry pi, by any chance?

lukasschneider911 commented 4 weeks ago

It is running as VM under Synology Virtual Machine Manager. Am 25. Okt. 2024, 15:51 +0200 schrieb Madmachinations @.***>:

Is this running on a raspberry pi, by any chance? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

madmachinations commented 3 weeks ago

It is running as VM under Synology Virtual Machine Manager. Am 25. Okt. 2024, 15:51 +0200 schrieb Madmachinations @.>: Is this running on a raspberry pi, by any chance? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

What is the spec?

lukasschneider911 commented 3 weeks ago

The VM has 8 Cores and 8 GB RAM.