websocket error during crawls that don't seem to be related to my Actor

We're getting crashes in our self-developed Actor (Python, playwright) from an apify websocket thing. We don't use websockets on our own. We're not sure what's causing this.
ERROR Error in websocket connection
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1301, in close_connection
await self.transfer_data_task
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 974, in transfer_data
await asyncio.shield(self._put_message_waiter)
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/apify/event_manager.py", line 222, in _process_platform_messages
async for message in websocket:
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 498, in __aiter__
yield await self.recv()
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 568, in recv
await self.ensure_open()
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 939, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1011 (internal error) keepalive ping timeout; no close frame received
ERROR Error in websocket connection
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1301, in close_connection
await self.transfer_data_task
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 974, in transfer_data
await asyncio.shield(self._put_message_waiter)
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/apify/event_manager.py", line 222, in _process_platform_messages
async for message in websocket:
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 498, in __aiter__
yield await self.recv()
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 568, in recv
await self.ensure_open()
File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 939, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1011 (internal error) keepalive ping timeout; no close frame received
1 Reply
xenial-black
xenial-black15mo ago
@grackle Please repost it to #crawlee-python And please, provide more information (maybe some small reproduction / code snippet / scraper config) Just in case, this could help: https://angelika.me/2024/01/03/how-to-ask-for-help-with-your-code-online/. cc @Vlada Dusek

Did you find this page helpful?