Hass.io Crashes Frequently

Hello,

My Hass.io installation on Rasperry Pi crashes once a week after the 0.97.x updates. I need to pull the power to get it back up. It answers ping, but I cannot login with ssh etc.

The Log has these repeated:

AttributeError: ‘NoneType’ object has no attribute ‘ports’
2019-08-18 09:28:54 INFO (MainThread) [homeassistant.helpers.script] Script Start HomeKit: Executing step call service
2019-08-18 09:28:54 INFO (SyncWorker_4) [pyhap.accessory_driver] Loading Accessory state from /config/.homekit.state
2019-08-18 09:28:54 INFO (SyncWorker_14) [pyhap.accessory_driver] Starting the event loop
2019-08-18 09:28:54 INFO (SyncWorker_0) [pyhap.accessory_driver] Starting accessory Home Assistant Bridge on address 192.168.1.134, port 51827.
2019-08-18 09:28:54 INFO (Thread-4) [pyhap.hap_server] Got connection with (‘192.168.1.139’, 50770).
2019-08-18 09:28:54 INFO (Thread-4) [pyhap.hap_server] Got connection with (‘192.168.1.132’, 49238).
2019-08-18 09:28:54 INFO (Thread-4) [pyhap.hap_server] Got connection with (‘192.168.1.145’, 57635).
2019-08-18 09:28:54 INFO (Thread-4) [pyhap.hap_server] Got connection with (‘192.168.1.144’, 50622).
2019-08-18 09:28:54 INFO (Thread-5) [pyhap.hap_server] 192.168.1.139 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:54 INFO (Thread-8) [pyhap.hap_server] 192.168.1.144 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:54 INFO (Thread-7) [pyhap.hap_server] 192.168.1.145 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:54 INFO (Thread-6) [pyhap.hap_server] 192.168.1.132 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:54 INFO (Thread-7) [pyhap.hap_server] 192.168.1.145 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:55 INFO (Thread-8) [pyhap.hap_server] 192.168.1.144 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:55 INFO (Thread-6) [pyhap.hap_server] 192.168.1.132 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:55 INFO (Thread-5) [pyhap.hap_server] 192.168.1.139 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:55 INFO (Thread-7) [pyhap.hap_server] 192.168.1.145 - “GET /accessories HTTP/1.1” 200 -
2019-08-18 09:28:55 INFO (Thread-6) [pyhap.hap_server] 192.168.1.132 - “GET /accessories HTTP/1.1” 200 -
2019-08-18 09:28:55 INFO (Thread-8) [pyhap.hap_server] 192.168.1.144 - “GET /accessories HTTP/1.1” 200 -
2019-08-18 09:28:55 INFO (Thread-4) [pyhap.hap_server] Got connection with (‘192.168.1.104’, 54338).
2019-08-18 09:28:55 INFO (Thread-5) [pyhap.hap_server] 192.168.1.139 - “GET /accessories HTTP/1.1” 200 -
2019-08-18 09:28:55 INFO (Thread-9) [pyhap.hap_server] 192.168.1.104 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:56 INFO (Thread-9) [pyhap.hap_server] 192.168.1.104 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:56 INFO (Thread-9) [pyhap.hap_server] 192.168.1.104 - “GET /accessories HTTP/1.1” 200 -
2019-08-18 09:28:58 INFO (Thread-4) [pyhap.hap_server] Got connection with (‘192.168.1.6’, 56262).
2019-08-18 09:28:58 INFO (Thread-4) [pyhap.hap_server] Got connection with (‘192.168.1.6’, 56261).
2019-08-18 09:28:59 INFO (Thread-10) [pyhap.hap_server] 192.168.1.6 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:59 INFO (Thread-10) [pyhap.hap_server] 192.168.1.6 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:59 INFO (Thread-11) [pyhap.hap_server] 192.168.1.6 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:28:59 INFO (Thread-11) [pyhap.hap_server] 192.168.1.6 - “POST /pair-verify HTTP/1.1” 200 -
2019-08-18 09:29:00 INFO (Thread-10) [pyhap.hap_server] 192.168.1.6 - “GET /accessories HTTP/1.1” 200 -
2019-08-18 09:29:00 INFO (Thread-11) [pyhap.hap_server] 192.168.1.6 - “GET /accessories HTTP/1.1” 200 -
2019-08-18 09:29:08 ERROR (MainThread) [aiounifi.api] Couldn’t find key: ‘None’
2019-08-18 09:29:08 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 254, in async_update_ha_state
self._async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 278, in _async_write_ha_state
state = self.state
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 528, in state
return STATE_ON if self.is_on else STATE_OFF
File “/usr/src/homeassistant/homeassistant/components/unifi/switch.py”, line 209, in is_on
return self.port.poe_mode != “off”
File “/usr/src/homeassistant/homeassistant/components/unifi/switch.py”, line 256, in port
return self.device.ports[self.client.sw_port]

And This:

AttributeError: ‘NoneType’ object has no attribute ‘ports’
2019-08-18 09:31:29 ERROR (MainThread) [aiounifi.api] Couldn’t find key: ‘None’
2019-08-18 09:31:29 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 254, in async_update_ha_state
self._async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 278, in _async_write_ha_state
state = self.state
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 528, in state
return STATE_ON if self.is_on else STATE_OFF
File “/usr/src/homeassistant/homeassistant/components/unifi/switch.py”, line 209, in is_on
return self.port.poe_mode != “off”
File “/usr/src/homeassistant/homeassistant/components/unifi/switch.py”, line 256, in port
return self.device.ports[self.client.sw_port]

I don’t understand how when 0.97.0 was only released 11 days ago?

I may be stating the obvious here but it’s not something as simple as your SD card is filling up? do you keep an eye on things like your database and log file sizes?

The last time I had what I thought was a crash was actually a race condition in a Node-Red flow that was just grinding my system to a halt. I think one of the reasons I found this was because I have CPU usage sensor and was able to see in the history it was maxed out for sometime before the crash.
I would have a think about what you have added to your system over the last week or so in case there’s anything that could cause issues.

Lastly random stability issues could be a sign of a failing sd card so make sure you have a backup just in case

Thank you… It has failed twice since the upgrade. My disk usage is 11% and there 690MB Free Memory. I am backing up to dropbox daily.

Something happened at 2AM, but unfortenately I cannot see the logs that far in the DevTools page. That Unifi Error is all over the logs though.

I guess 2am or shortly after is where it crashed and then the second spike is when you unplugged it?

I’m not sure if your unifi errors are the cause, caused by the issue or totally separate and it’s not something i use :frowning:

Do you have any automations that run at that time? or maybe your backups?
You almost need to wait for another crash to see if the graphs look the same.

Yes the second spike is the one when I rebooted it with pulling the power

Backups are running at during the night, but not 2AM. Actually 1AM local and 3 AM Dropbox. Yes, I will wait for the next.

Today it crashed again and now it does not boot anymore. So the SDCard is propably dead. I find it unbelievable that there is no “official” support for SSD with Rasperry Pie. :frowning:

At least you got to the bottom of the issue.
I had 2 fail when I first started with HA.
I find the SD cards shipped with RPis just don’t last.
I have now been using SanDisk ultra 64gb with my database hovering around 1gb for 9months with no issues as of yet. I can’t remember all the research I did but I know the bigger the better so there’s less writes to each block.

I have however spent the time making sure everything that I don’t need history for is excluded from the recorder. I also only auto backup once a week then manual backup if I feel the need to during a major change.

1 Like