My HA Instance Hung this morning

I only mention this because it is so unusual. This is the first time in nearly a year of use.

It hung this morning at about 6:20, by the looks of it it was in the middle of responding to my wife coming downstairs and trying to turn a light on but that may or may not have been the case.

I’m not too worried, it started right back up again when I restarted it and is now fine.

I was just curious if anyone else has seen anything similar especially since I upgraded to 0.38.4 last night.

Actually… I came home tonight and none of my lights turned on. My hass had hung during the day and been off for about 8 hours. I put it down to my new install over the weekend and have plugged the Pi back in until I have time to fix. Time was 10.40am Australian Eastern Standard, not sure how that relates to you.

My last error in the log was a zwave one and it seems the whole computer was stuck - I couldn’t access it from the network. For reference it was an install on Lbuntu - lightweight Ubuntu desktop version I believe.

Error was similar to

WARNING (Dummy-25) [openzwave] Z-Wave Notification ValueChanged ({'homeId': 0, 'units': '%', 'type': 'Decimal', 'genre': 'User', 'id': 720

Hmm, this just happened to me again after about 5 hours of running. Nothing of note in the logs, no new devices added. All I am doing is developing against the API but that is not unusual.

I’m not convinced mine wasn’t due to me messing up the install but your post gives me a glimmer of hope. At the time my lock up occurred hass had been running for around 12 hours I think.

Following up - I reverted to 0.38.3 this morning and it hasn’t hung since. If it’s still OK in the morning I’ll file a bug.

I have just downgraded to 0.38.3 after noticing crashing and nmap problems with 0.34.4. Never had problems in the past and nothing else has changed on my setup.

Will monitor 0.38.3 anyway.

1 Like

I’m a little surprised that there are only 3 of us on this thread, the issue whatever it is must be very specific. I checked the bugs and don’t see this reported yet.

1 Like

mine was updated last night and 4 hours later home assistant had crashed
the error log had 18K lines

17-02-24 02:27:29 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for group.all_devices took 1.107 seconds. Please report platform to the developers at https://goo.gl/Nvioub
17-02-24 02:27:36 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for group.family took 0.562 seconds. Please report platform to the developers at https://goo.gl/Nvioub
17-02-24 02:27:41 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for climate.home took 1.526 seconds. Please report platform to the developers at https://goo.gl/Nvioub
17-02-24 02:28:11 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for media_player.kodi took 3.192 seconds. Please report platform to the developers at https://goo.gl/Nvioub
17-02-24 02:28:48 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for light.living_room_light took 0.512 seconds. Please report platform to the developers at https://goo.gl/Nvioub
17-02-24 02:28:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/device_tracker/__init__.py", line 657, in async_device_tracker_scan
    found_devices = yield from scanner.async_scan_devices()
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/device_tracker/nmap_tracker.py", line 87, in scan_devices
    self._update_info()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/util/__init__.py", line 296, in wrapper
    result = method(*args, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/device_tracker/nmap_tracker.py", line 110, in _update_info
    scanner = PortScanner()
  File "/home/homeassistant/.homeassistant/deps/nmap/nmap.py", line 131, in __init__
    os.getenv('PATH')
nmap.nmap.PortScannerError: 'nmap program was not found in path. PATH is : /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
17-02-24 02:29:20 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for binary_sensor.fibaro_system_fgms001zw5_motion_sensor_sensor_3_0 took 11.207 seconds. Please report platform to the developers at https://goo.gl/Nvioub
17-02-24 02:29:41 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for sensor.fibaro_system_fgms001zw5_motion_sensor_temperature_3_1 took 2.956 seconds. Please report platform to the developers at https://goo.gl/Nvioub
17-02-24 02:29:51 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 387, in _update_entity_states
    yield from update_coro
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 209, in async_update_ha_state
    yield from self.hass.loop.run_in_executor(None, self.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/cpuspeed.py", line 84, in update
    self.info = cpuinfo.get_cpu_info()
  File "/home/homeassistant/.homeassistant/deps/cpuinfo/cpuinfo.py", line 1502, in get_cpu_info
    info = get_cpu_info_from_cpuid()
  File "/home/homeassistant/.homeassistant/deps/cpuinfo/cpuinfo.py", line 919, in get_cpu_info_from_cpuid
    returncode, output = run_and_get_stdout([sys.executable, "-c", "import cpuinfo; print(cpuinfo._get_cpu_info_from_cpuid())"])
  File "/home/homeassistant/.homeassistant/deps/cpuinfo/cpuinfo.py", line 170, in run_and_get_stdout
    p1 = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python3.4/subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.4/subprocess.py", line 1395, in _execute_child
    restore_signals, start_new_session, preexec_fn)
OSError: [Errno 12] Cannot allocate memory
17-02-24 02:30:23 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for sensor.fibaro_system_fgms001zw5_motion_sensor_seismic_intensity_3_25 took 11.077 seconds. Please report platform to the developers at https://goo.gl/Nvioub

Ive lost my log after downgrading, but i remember seeing this line also. Same goes for too many files open.

After downgrading to 0.38.3 I am back stable again - no crashes for 24 hrs.

Looks like this may be relevant:

https://github.com/home-assistant/home-assistant/issues/6165

I have had two hangs in the last few days but have been making a few changes to my system so I am unable to put it down to anything specific.

However, last night my ZoneMinder machine which I have linked in HA, crashed around the same time my HA setup hung so I am wondering if that caused a problem - repeatedly trying to connect to the server?

I am also seeing occasions of this:

File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/updater.py", line 83, in <lambda>
    hass, lambda _: check_newest_version(hass, huuid),
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/updater.py", line 91, in check_newest_version
    result = get_newest_version(huuid)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/updater.py", line 133, in get_newest_version
    import distro
  File "/home/homeassistant/.homeassistant/deps/distro.py", line 1051, in <module>
    _distro = LinuxDistribution()
  File "/home/homeassistant/.homeassistant/deps/distro.py", line 595, in __init__
    if include_lsb else {}
  File "/home/homeassistant/.homeassistant/deps/distro.py", line 921, in _get_lsb_release_info
    stderr=subprocess.PIPE)
  File "/usr/lib/python3.4/subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.4/subprocess.py", line 1395, in _execute_child
    restore_signals, start_new_session, preexec_fn)
OSError: [Errno 12] Cannot allocate memory

In my log.

Im still tweaking my setup though so it would be unfair to say I had a solid running instance and suddenly got the hangs…

exactly what I am getting… just ran top, 99.9% CPU for Home assistant.

rolled back to 0.38.3, all good again. Thanks for the link!

I SSH’s in and watched ‘top’ and could see the memory usage ticking up.

I have commented out my emulated Hue (using alexa) and restarted and after three hours it has not gone above 5.8% usage (0.38.4 AIO install on a Pi3).

Not ideal, but it seems to work for now. Someone in the above Github link has also tried adding ‘type’ in the emulated hue component which fixed it. I had not set a type in mine so will try and see if it also works.

since i updated yesterday mine has hung up twice, i had to hard reset my pi3, and on reboot my limitless led lights were missing from my config, after restarting home assistant they re appeared, it never done it on 0.38.3 so i think ill revert back as something is not right on the new version

For me 0.38.3 is still solid after several days.

I raised a bug about this as im still experiencing problems with hanging with 0.39

https://github.com/home-assistant/home-assistant/issues/6262

I realize I’m a bit late for this show. I have two rpi4 systems running ha docker containers. Each system quits about the same time: between 6 & 7 eastern. No apparent pattern - it could be 10 days apart or every day but both systems fail together. They are 180 miles apart. I suspect there is a process running that is attempting something causing port 8123 to go offline. Doing a docker restart puts ha back online. Scrolling through the logs just shows failed components - no kidding - but why. A cron job running puts things back but this is a kludgie fix. Im sure I’m not the only user experiencing this. Hopefully someone will stumble on a cause and fix.