Since the 2022.8.* release I’ve found that I’m having to restart home assistant every couple of days, it goes very unresponsive and on checking the raspberrypi os log I’m getting this error: -
hass[]: OSError: [Errno 24] Too many open files
I’m running home assistant core (unsupervised) on a raspberry pi 4 (4GB) running raspberrypi os (buster) with python 3,9,9 and sqlite3 version 3.36.0 .
On investigating
lsof -u homeassistant | wc -l
1391
$ cat /proc/561/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 13167 13167 processes
Max open files 1024 524288 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 13167 13167 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Open files whilst the problem occurring shows 1391, and the process limits for “max open files” shows 1024 for the soft limit,
I’ve increased the soft limit for the process within the systemd startup script to 2048.
That has stopped the open files error, but now I’m getting this: -
hass[]: 2022-08-16 19:23:47.599 WARNING (Thread-11) [pychromecast.socket_client] [Downstairs(192.168.1.54):32126] Error communicating with socket, resetting connection
hass[20458]: 2022-08-16 19:23:47.647 ERROR (Thread-11) [pychromecast.socket_client] [Downstairs(192.168.1.54):32126] Error in select call: filedescriptor out of range in select()
These are the only thing in the logs now, so I cannot go further back and tell what caused the issue.
I’ve not had this type of behaviour in previous versions when my chromecast devices were unavailable/switched off!
Any ideas?