Not enough system resources / too many files open with 33.3 upgrade

I am getting the follow after upgrading to 33.3 from a working 33.0. I am running a basic HA (with evisalink) and homebridge on a PI 2. I am not sure how to reduce the files open or if that will even help. Any suggestions would be helpful. Thanks

Nov 24 06:45:10 raspberrypi hass[31186]: ERROR:homeassistant.core:Error doing job: socket.accept() out of system resource
Nov 24 06:45:10 raspberrypi hass[31186]: Traceback (most recent call last):
Nov 24 06:45:10 raspberrypi hass[31186]: File "/usr/lib/python3.4/asyncio/selector_events.py", line 137, in _accept_connec
Nov 24 06:45:10 raspberrypi hass[31186]: conn, addr = sock.accept()
Nov 24 06:45:10 raspberrypi hass[31186]: File "/usr/lib/python3.4/socket.py", line 184, in accept
Nov 24 06:45:10 raspberrypi hass[31186]: OSError: [Errno 24] Too many open files

got the same issue.

Try rebooting. It should fix it.

Yes, that fixed it. Thanks

rebooting fixes this, but after restarting home assistant 3 or 4 times, 33.3 and 33.4 report too many open files again. i ended up rebooting a couple of of times a day and finally went back to 31.1, where the system resources do get not exhausted by HA. (HA running on os x el capitan)

Huh, I’m on el cap too.

/cc @balloob

Hmmm, nothing changed stands out that could cause this.

Changed files.

are both of you using yr ? Could someone try running without yr ?

sorry @balloob, what’s yr? if i knew what it is i would certainly try running HA without it.
(i don’t use https://home-assistant.io/components/sensor.yr/)

I’m still getting this routinely. Any big dev night of me bouncing HA inevitably ends in me having to reboot my server :confused:

I’m starting to experience this a lot too. Currently on 0.36.1. If I am doing a lot of HA restarts, because of config changes, eventually it just stops working and throws this error, and I have to reboot. Something is not getting closed properly when the service is shut down, I’m guessing.

I haven’t got it since I rebooted back in Nov. but I haven’t don’t much configurations since then.

I still have the same problem, too (0.37.0). I imagine it could home something to do with the webinterface, I have tons of connections to :8123, even is hass is killed - and even in established state.

I’m still seeing the exact same thing

+1

Observed about 20-30 web connections.

My server just died today, stopped responding to all commands. When I went to check the log file, it was this issue again.

I’m not sure what to do to troubleshoot, but would be happy to help if someone can give me some direction.

Possible solution:
I ran lsof | grep 8123 and found that there were tons and tons of these sort of lines:

node       401  ob1   18u     IPv4 0xdd2a305bd36460cf        0t0      TCP localhost:62801->localhost:8123 (ESTABLISHED)
node       401  ob1   19u     IPv4 0xdd2a305bccf36cef        0t0      TCP localhost:62802->localhost:8123 (ESTABLISHED)
node       401  ob1   20u     IPv4 0xdd2a305bccf37edf        0t0      TCP localhost:62803->localhost:8123 (ESTABLISHED)
node       401  ob1   21u     IPv4 0xdd2a305bccf35aff        0t0      TCP localhost:62804->localhost:8123 (ESTABLISHED)

The only thing that was running node was homebridge. I killed and restarted homebridge and tada homeassistant was working again! Not sure why it was happening in the first place though. But it seems to be related at least in some regard to quitting and restarting hass with the connections not having a chance to close.

edited to reflect homeBRIDGE not homeBREW… oops!

2 Likes

I have found this related to homebridge.

If i stop homebridge. Restart HA and then start homebridge everything plays nice.

In my setup it looks like homebridge goes on a frenzy and opens 100’s of connections to the HA API.

2 Likes

My original setup was on a Mac Mini. Gave up on that a couple of weeks ago and built loaded Hassbian on a Pi 3. No errors and install was easier. Backup of the SD card is easy so if something goes wrong I can quickly fall back to a working system.

Experienced the same thing here last night running OS X Sierra and HASS 0.39.2. Not running homebridge and no zombie node processes running.

Hope this doesn’t become a re-occurring thing.

I’m egetting the same. Homeassistant 0.40 no home bridge.
Any ideas on how to increase the number of files? Raspbian?

Couldn’t get to work with MySQL reliably. Switched to Postgres. Now getting the following after 3-4 days. Anybody know how to fix this one? Guess the same reason my nmap scan is also failing

requests.exceptions.ConnectionError: HTTPConnectionPool(host='xxx', port=8086): Max retries exceeded with url: /write?db=home_assistant (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3c5f66b0>: Failed to establish a new connection: [Errno 24] Too many open files',))

Rnin lsof see a lot of entries like this

hass       720 1061 homeassistant   55u     0000       0,11        0       4714 anon_inode
hass       720 1061 homeassistant   56u     0000       0,11        0       4714 anon_inode
hass       720 1061 homeassistant   57u     unix 0xb68eaa00      0t0      28682 socket
hass       720 1061 homeassistant   58u     unix 0xb68ea100      0t0      28683 socket
hass       720 1061 homeassistant   59u     0000       0,11        0       4714 anon_inode
hass       720 1061 homeassistant   60u     unix 0xb6964300      0t0      23403 socket
hass       720 1061 homeassistant   61u     unix 0xb9358300      0t0      33076 socket
hass       720 1061 homeassistant   62u     unix 0xb935a700      0t0      33077 socket
hass       720 1061 homeassistant   63u     0000       0,11        0       4714 anon_inode
hass       720 1061 homeassistant   64u     unix 0xb6965200      0t0      32212 socket
hass       720 1061 homeassistant   65u     unix 0xb6964600      0t0      32213 socket
hass       720 1061 homeassistant   66u     0000       0,11        0       4714 anon_inode
hass       720 1061 homeassistant   67u     0000       0,11        0       4714 anon_inode
hass       720 1061 homeassistant   68u     0000       0,11        0       4714 anon_inode
hass       720 1061 homeassistant   69u     unix 0xb935a100      0t0      48704 socket
hass       720 1061 homeassistant   70u     unix 0xb935b000      0t0      48705 socket