Hass.io always fails restarting - needs reboot

I have this issue where running hassio ha restart after a configuration change constantly fails. Even when I run hassio ha check and this returns successful.

I timed it to check how long it takes, and it took 1 minute and 13 seconds.

$ time hassio ha check
Processing... Done.

Command completed successfully.

real	1m13.965s
user	0m0.102s
sys	    0m0.173s

However, I ran hassio ha restart for the configuration changes to take effect. I timed this as well, and it takes incredible long time (11 minutes 4 seconds).

$ time hassio ha restart
Processing... Done.

Error: Unknown Error, see logs

real	11m4.458s
user	0m1.069s
sys	    0m1.479s

I checked the error logs, and it says the following:

$ cat home-assistant.log 
2020-01-08 10:02:31 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-08 10:02:44 ERROR (MainThread) [hole] Can not load data from *hole: 192.168.86.45:8089
2020-01-08 10:02:44 ERROR (MainThread) [homeassistant.components.pi_hole] Unable to fetch data from Pi-hole
2020-01-08 10:02:52 ERROR (MainThread) [tibber] Timed out when connecting to Tibber:  

To get Hass.io up and running, I restart the computer hassio ho reboot.

However, the errors in the log are still there, with even more errors, but Hass.io is still running:

$ cat home-assistant.log
2020-01-08 10:18:01 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-08 10:18:18 ERROR (MainThread) [hole] Can not load data from *hole: 192.168.86.45:8089
2020-01-08 10:18:18 ERROR (MainThread) [homeassistant.components.pi_hole] Unable to fetch data from Pi-hole
2020-01-08 10:18:18 ERROR (MainThread) [homeassistant.components.deconz] Error connecting to deCONZ gateway at 172.30.33.1
2020-01-08 10:18:22 ERROR (MainThread) [tibber] Timed out when connecting to Tibber:  
2020-01-08 10:19:59 ERROR (MainThread) [homeassistant.components.bluetooth_tracker.device_tracker] Error looking up Bluetooth device
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/bluetooth/bluez.py", line 31, in discover_devices
    lookup_class=lookup_class, device_id=device_id)
_bluetooth.error: (110, 'Operation timed out')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 140, in perform_bluetooth_update
    devices = await hass.async_add_executor_job(discover_devices, device_id)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 62, in discover_devices
    device_id=device_id,
  File "/usr/local/lib/python3.7/site-packages/bluetooth/bluez.py", line 34, in discover_devices
    raise BluetoothError ("error communicating with local "
bluetooth.btcommon.BluetoothError: error communicating with local bluetooth adapter
2020-01-08 10:31:35 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1805282736] Client exceeded max pending messages [2]: 512
2020-01-08 10:31:35 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1805282736] Client exceeded max pending messages [2]: 512

How come a restart never works, but a reboot does, even with the same error messages?

Well, you should never get any errors. Start by fixing all your errors, and if the problem still exists, then post. But right now you have 3 errors on the bad start and 5 errors on the good start. All bad. Any one of those errors can propagate and cause issues for the boot process. Any one of those errors could have intermittent hardware communication issues which a reboot fixes.

@petro I agree that no errors is the best, but look at this log:

2020-01-22 08:14:42 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-22 08:15:05 ERROR (MainThread) [tibber] Timed out when connecting to Tibber:  
2020-01-22 08:15:05 ERROR (MainThread) [homeassistant.components.deconz] Error connecting to deCONZ gateway at 172.30.33.0

Line 1: Just a warning that I use HACS. Should be OK to ignore right?
Line 2: Tibber sensor times out, how can I fix this? This sensor always works when I reboot.
Line 3: Using Hassio’s own deCONZ plugin, how is this failing??

Edit: Seems like it’s the deCONZ plugin that prohibits Hassio from starting…

Now suddenly there is a issue with MQTT not starting that blocks Hass.io.

I’m thinking of maybe ditch the whole forever beta application that Hass.io is. I can’t see when Hass.io will be stable enough to be used in a real world… sigh

1 Like

I run hassio without issue for months on end.

Turn on debugging and see what’s popping up in your logs. Fix the issues and be on your way.

If you want hassio to be without fixes, don’t update it when a new update comes.

Apparantly not upgrading Home Assistant when a new version is coming is a good tip. This has screwed my config several times because of breaking changes. You might say that it is my fault not to take this into consideration when upgrading, which I agree.

Currently, after last fresh reboot of the host computer, I get 7 errors and 1 warning.

2020-02-03 13:10:54 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-02-03 13:11:19 ERROR (MainThread) [tibber] Timed out when connecting to Tibber:  
2020-02-03 13:11:20 ERROR (MainThread) [homeassistant.components.deconz] Error connecting to deCONZ gateway at 172.30.33.0
2020-02-03 13:13:20 ERROR (MainThread) [homeassistant.components.bluetooth_tracker.device_tracker] Error looking up Bluetooth device [...] error communicating with local bluetooth adapter
2020-02-03 13:14:16 ERROR (Recorder) [homeassistant.core] Error doing job: Unclosed connection
2020-02-03 13:14:16 ERROR (Recorder) [homeassistant.core] Error doing job: Unclosed connection
2020-02-03 13:14:17 ERROR (Recorder) [homeassistant.core] Error doing job: Unclosed connection
2020-02-03 13:14:26 ERROR (MainThread) [homeassistant.core] Error doing job: Unclosed connection

The warning is not avoidable as this is just information about HACS.
First error (Tibber sensor), not sure how to avoid this? It is a consistent error. A possibility is to remove Tibber sensor which I really don’t want to.
Second error: deCONZ. Not sure why this is failing as I am using the official addon for Home Assistant. I would presume the developers made the addon without error messages, but sadly no.
Third error: Bluetooth device error. Not sure how to avoid this, except dropping Bluetooth device tracking. I am using the internal bluetooth on a off the shelf Hass.io install. This used to work before…
Fourth/fifth/sixth/seventh error: Recorder (dedicated external RPI with MariaDB) is up and running, not sure if this is a bug from the reboot where Hass.io doesn’t close the connection? If so, the Hass.io developers should definitely fix this bug…

So you see, not sure how to really cope with these errors…

Yep, if you fix things and keep the version static, it will run until some company changes the API. Like harmony did a number of years back. I ran the same version of Home Assistant for 8 months without an issue 2017. Haven’t done it since because it’s a hobby that I enjoy at this point.

Yep ignore.

Does it work?

This does not happen for me with MariaDB. Restart MariaDB. I’m guessing hassio crashed and the socket is still in use. Restarting your database and hassio should fix that. I would assume that this is causing the problem.
If you can’t restart the container, reboot the system.

deCONZ does work even if it fails connecting. After a complete reboot I still got the error, but Home Assistant started, with the error message in the log. I find that quite interesting that during a HA restart it fails with this error, but during a reboot, HA will still work even if the same error occurs.

Tibber error is also present during a reboot, but HA will still start.

Rebooting the MariaDB server and a HA host reboot, did solve the recorder and bluetooth issue.

Thank you for your help so far!

So, I would remove Tibber and start up. See if that is the cause of the boot failure. If not. Remove Deconz and do the same thing.

Either way, I would assume that the recorder issue wouldn’t stop a boot up because it would default to the regular database. Can’t say much about Tibber or Deconz.

That’s a joke! It will be a full time job to achieve NO errors/warnings.

I’ve been there for years and I barely touch my HA. And warnings are warnings, you can ignore them if you want to. As for errors, the only errors you can pretty much ignore are the ones that come from the frontend because they are usually errors related to a stale browser login.