Skip to content

Much log entries 'pipe closed by peer' #1417

Description

@Kanecaine

Description

From time to time, I see a huge number of the following entries in the log:

2026-08-21 22:08:22.356 WARNING (MainThread) [asyncio] pipe closed by peer or os.write(pipe, data) raised exception.
2026-08-21 22:08:41.223 WARNING (MainThread) [asyncio] pipe closed by peer or os.write(pipe, data) raised exception.
2026-08-21 22:08:41.223 WARNING (MainThread) [asyncio] pipe closed by peer or os.write(pipe, data) raised exception.
2026-08-21 22:08:41.223 WARNING (MainThread) [asyncio] pipe closed by peer or os.write(pipe, data) raised exception.
...
(I've truncated a few hundred entries)
...
2026-08-21 22:08:42.671 WARNING (MainThread) [asyncio] pipe closed by peer or os.write(pipe, data) raised exception.
2026-08-21 22:08:42.671 WARNING (MainThread) [asyncio] pipe closed by peer or os.write(pipe, data) raised exception.
2026-08-21 22:08:42.671 WARNING (MainThread) [asyncio] pipe closed by peer or os.write(pipe, data) raised exception.
2026-08-21 22:08:42.676 WARNING (Thread-1 (_monitor)) [homeassistant.util.logging] Module asyncio is logging too frequently. 200 messages since last count

There were also the following entries afterward, but I'm not sure if they're directly related:

Traceback (most recent call last): File "/usr/local/lib/python3.14/asyncio/tasks.py", line 488, in wait_for return await fut ^^^^^^^^^ File "/usr/local/lib/python3.14/asyncio/streams.py", line 48, in open_connection transport, _ = await loop.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lambda: protocol, host, port, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.14/asyncio/base_events.py", line 1143, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ exceptions, addrinfo, laddr_infos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.14/asyncio/base_events.py", line 1042, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.14/asyncio/selector_events.py", line 647, in sock_connect return await fut ^^^^^^^^^ asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.14/site-packages/pytapo/media_stream/streamer.py", line 278, in _stream_to_ffmpeg async with mediaSession: ^^^^^^^^^^^^ File "/usr/local/lib/python3.14/site-packages/pytapo/media_stream/session.py", line 85, in __aenter__ await self.start() File "/usr/local/lib/python3.14/site-packages/pytapo/media_stream/session.py", line 100, in start self._reader, self._writer = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ asyncio.open_connection(self.ip, self.port), timeout=CONNECTION_TIMEOUT ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/local/lib/python3.14/asyncio/tasks.py", line 487, in wait_for async with timeouts.timeout(timeout): ~~~~~~~~~~~~~~~~^^^^^^^^^ File "/usr/local/lib/python3.14/asyncio/timeouts.py", line 115, in __aexit__ raise TimeoutError from exc_val TimeoutError

2026-08-21 22:23:00.391 ERROR (MainThread) [homeassistant] Error doing job: Task was destroyed but it is pending! (task: <Task pending name='Task-90092' coro=<Streamer._stream_to_ffmpeg() running at /usr/local/lib/python3.14/site-packages/pytapo/media_stream/streamer.py:278> wait_for=<Future pending cb=[Task.task_wakeup()]>>)

Reproduction Steps

I can't reproduce it reliably, but I was able to trigger it several times after starting the camera stream via a picture entity:

type: picture-entity
entity: camera.tapo_c425_hd_stream_direct
camera_image: camera.tapo_c460_hd_stream_direct
name: C425
show_state: true
show_name: true
camera_view: auto
fit_mode: cover

Apart from the log entries, however, no major problems have been identified. The streams still start, though there may be a delay or you may need to trigger the stream again.

Expected behavior

Of course, timeouts can happen from time to time with a Wi-Fi camera. But that shouldn't result in such a flood of log entries.

If applicable, add error logs.

No response

Device Firmware

1.2.4 Build 260521 Rel.80578n

Integration Version

7.1.25

Last known working integration version

no

Using stream component

No

Does camera work via official integrations?

N/A

HASS Environment

Home Assistant OS on Proxmox

Search for similar issues

Yes

LLM Usage

I confirm

Additional information

Thanks in advance.

Debug Logs (Required)

home-assistant_tapo_control_2026-08-21T20-56-09.529Z.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions