Skip to content

HA went into a failure loop after running out of file descriptors #144802

Open
@akx

Description

@akx

The problem

Last night, the better half complained that the lights in the living room didn't work, and I noticed the NUC hosting our HA was spinning its fans like no tomorrow.

Looking at journalctl logs for HA, it had apparently run out of file descriptors, and absolutely couldn't deal:

May 12 19:09:57 saga hass[1303189]: 2025-05-12 19:09:57.800 INFO (MainThread) [homeassistant.components.number] Setting up wiz.number
May 12 19:09:57 saga hass[1303189]: 2025-05-12 19:09:57.802 INFO (MainThread) [homeassistant.components.sensor] Setting up wiz.sensor
May 12 19:09:57 saga hass[1303189]: 2025-05-12 19:09:57.802 INFO (MainThread) [homeassistant.components.switch] Setting up wiz.switch
(nb.: the above are likely unrelated...)
May 12 19:13:26 saga hass[1303189]: 2025-05-12 19:13:26.578 ERROR (MainThread) [homeassistant] Error doing job: socket.accept() out of system resource (None)
May 12 19:13:26 saga hass[1303189]: Traceback (most recent call last):
May 12 19:13:26 saga hass[1303189]:   File "/home/homeassistant/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/asyncio/selector_events.py", line 178, in _accept_connection
May 12 19:13:26 saga hass[1303189]:   File "/home/homeassistant/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/socket.py", line 295, in accept
May 12 19:13:26 saga hass[1303189]: OSError: [Errno 24] Too many open files
May 12 19:13:26 saga hass[1303189]: 2025-05-12 19:13:26.579 ERROR (MainThread) [homeassistant] Error doing job: socket.accept() out of system resource (None)
May 12 19:13:26 saga hass[1303189]: Traceback (most recent call last):
May 12 19:13:26 saga hass[1303189]:   File "/home/homeassistant/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/asyncio/selector_events.py", line 178, in _accept_connection
May 12 19:13:26 saga hass[1303189]:   File "/home/homeassistant/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/socket.py", line 295, in accept
May 12 19:13:26 saga hass[1303189]: OSError: [Errno 24] Too many open files
May 12 19:13:26 saga hass[1303189]: 2025-05-12 19:13:26.580 ERROR (MainThread) [homeassistant] Error doing job: socket.accept() out of system resource (None)
May 12 19:13:26 saga hass[1303189]: Traceback (most recent call last):
May 12 19:13:26 saga hass[1303189]:   File "/home/homeassistant/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/asyncio/selector_events.py", line 178, in _accept_connection
May 12 19:13:26 saga hass[1303189]:   File "/home/homeassistant/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/socket.py", line 295, in accepthttps://github.com/home-assistant/core/issues/58711
...

repeated ad infinitum, up to 4,000 times per second (!!!), until I systemctl restart homeassistant-ha'd.

Running out of fds is likely an unrecoverable error, so it could be a good idea for HA to crash and get restarted if it notices this?

FWIW, I hadn't noticed this before 2025.4.4 but that isn't saying it's a regression c.f. the previous version, 2025.4.0.

core-2025.4.4 running on Python 3.13.1 (via uv) on Linux x86_64.

What version of Home Assistant Core has the issue?

core-2025.4.4

What was the last working version of Home Assistant Core?

core-2025.4

What type of installation are you running?

Home Assistant Core

Related issues/prior art

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions