dahua icon indicating copy to clipboard operation
dahua copied to clipboard

Integration seems to be causing issues with video playback in Frigate?

Open nasixi opened this issue 4 months ago • 0 comments

I've been finding that sometimes recorded video won't playback in Frigate, and looking through the logs, this appears to be something to do with aoihttp.

This is from the core logs:

Logger: custom_components.dahua Source: custom_components/dahua/client.py:744 integration: Dahua (documentation, issues) First occurred: 10 June 2025 at 12:38:27 (2041 occurrences) Last logged: 13:05:26

Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/aiohttp/streams.py", line 347, in _wait await waiter asyncio.exceptions.CancelledError

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

Traceback (most recent call last): File "/config/custom_components/dahua/client.py", line 744, in stream_events async for data, _ in response.content.iter_chunks(): on_receive(data, channel) File "/usr/local/lib/python3.13/site-packages/aiohttp/streams.py", line 71, in anext rv = await self._stream.readchunk() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/streams.py", line 476, in readchunk await self._wait("readchunk") File "/usr/local/lib/python3.13/site-packages/aiohttp/streams.py", line 346, in _wait with self._timer: ^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/helpers.py", line 685, in exit raise asyncio.TimeoutError from exc_val TimeoutError

At the same time, this was in the supervisor logs:

2025-06-11 13:02:47.744 ERROR (MainThread) [aiohttp.server] Error handling request from 172.30.32.1 Traceback (most recent call last): File "/usr/local/lib/python3.13/asyncio/selector_events.py", line 1005, in _read_ready__data_received data = self._sock.recv(self.max_size) ConnectionResetError: [Errno 104] Connection reset by peer The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 198, in block_bad_requests return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 208, in system_validation return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 225, in token_validation return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 289, in core_proxy return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/api/ingress.py", line 165, in handler return await self._handle_request(request, addon, path, session_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/api/ingress.py", line 283, in _handle_request await response.write(data) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_response.py", line 550, in write await self._payload_writer.write(data) File "/usr/local/lib/python3.13/site-packages/aiohttp/http_writer.py", line 156, in write await self.drain() File "/usr/local/lib/python3.13/site-packages/aiohttp/http_writer.py", line 222, in drain await protocol._drain_helper() File "/usr/local/lib/python3.13/site-packages/aiohttp/base_protocol.py", line 100, in _drain_helper await asyncio.shield(waiter) ConnectionError: Connection lost

nasixi avatar Jun 11 '25 12:06 nasixi