HA crashing (not responding) and lots of errors in log

Hi All,

Since 2 days my HA seems to crash sometimes. It always begins with a lot of workerpool errors in the log and pending jobs queing.

16-09-04 21:24:53 homeassistant.core: WorkerPool:All 23 threads are busy and 70 jobs pending
16-09-04 21:24:53 homeassistant.core: WorkerPool:Current job from 2016-09-04T21:21:10.513121+02:00: (<function        EntityPlatform._update_entity_states at 0x6a8075d0>, <Event time_changed[L]: now=2016-09-    04T21:21:10.501318+02:00>)
16-09-04 21:24:53 homeassistant.core: WorkerPool:Current job from 2016-09-04T21:21:20.513065+02:00: (<function EntityPlatform._update_entity_states at 0x6a8075d0>, <Event time_changed[L]: now=2016-09-04T21:21:20.501237+02:00>)
16-09-04 21:24:53 homeassistant.core: WorkerPool:Current job from 2016-09-04T21:21:30.520091+02:00: (<function EntityPlatform._update_entity_states at 0x6a8075d0>, <Event time_changed[L]: now=2016-09-04T21:21:30.503479+02:00>)
16-09-04 21:24:53 homeassistant.core: WorkerPool:Current job from 2016-09-04T21:21:40.508806+02:00: (<function EntityPlatform._update_entity_states at 0x6a8075d0>, <Event time_changed[L]: now=2016-09-04T21:21:40.501218+02:00>)
16-09-04 21:24:53 homeassistant.core: WorkerPool:Current job from 2016-09-04T21:21:50.509116+02:00: (<function EntityPlatform._update_entity_states at 0x6a8075d0>, <Event time_changed[L]: now=2016-09-04T21:21:50.501236+02:00>)
16-09-04 21:24:53 homeassistant.core: WorkerPool:Current job from 2016-09-04T21:22:00.532831+02:00: (<function EntityPlatform._update_entity_states at 0x6a8075d0>, <Event time_changed[L]: now=2016-09-04T21:22:00.501228+02:00>)

after this jobs seem to be piling up in the queue:

16-09-04 21:25:04 homeassistant.core: WorkerPool:All 23 threads are busy and 277 jobs pending

apart from that i get the follwoing errors:

16-09-04 21:36:39 homeassistant.core: BusHandler:Exception doing job
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/core.py", line 852, in job_handler
func(*args)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/event.py", line 179, in pattern_time_change_listener
action(now)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 180, in _update_entity_states
entity.update_ha_state(True)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 154, in update_ha_state
self.update()
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/samsungtv.py", line 75, in update
return self.send_key('KEY')
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/samsungtv.py", line 88, in send_key
self.get_remote().control(key)
File "/home/hass/.homeassistant/deps/samsungctl/remote.py", line 63, in control
self._read_response()
File "/home/hass/.homeassistant/deps/samsungctl/remote.py", line 72, in _read_response
tv_name = self.connection.recv(tv_name_len)
AttributeError: 'NoneType' object has no attribute 'recv'

Both these errors (workerpool and job errors) keep piling up:

16-09-06 05:43:03 homeassistant.core: WorkerPool:All 23 threads are busy and 565249 jobs pending

That is the last one i got.

This morning nothing was responding anymore. The Gui is reachable and i can press buttons ans switches, but no result. Cant even call a service anymore. Only reboot helped.

Apart from this i got erros from unifi devicetracker, these seem to happen everynight as wel:

16-09-05 19:28:01 homeassistant.components.device_tracker.unifi: Failed to scan clients: HTTP Error 401: Unauthorized

Not sure if this is somehow related, I have seen these errors before. Devicetracking is not working than. Kind of weird, because it was working before, and is also working after a reboot. Not sure what causes the 401, because the credentials are legit.

Any ideas? My HA is kind of unstable now.

Well it’s obvious from the error log that there is a problem with the samsung tv media_player component you are using. Try disabling that component in your configuration.yaml and see if your HA stops crashing. Either you have the media_player configured incorrectly or there is a bug in the samsung tv media_player component.

Now even though the logs show there is a definite problem with the samsung component, that doesn’t mean it is the cause of the crashes. Those thread jobs may have nothing to do with the the samsung component, but at least it will take that obvious problem out of the equation, thus giving us more information to go on and a better idea of where to focus, or NOT to focus, depending on whether or not HA stops crashing after you disable the component.

Ok, it seemseems that it was indeed the Samsung component. Haven’t had these errors since I disabled the component. Tnx!