Home Assistant fails to reboot

So I’ve been running into this issue multiple time today and it is starting to become very annoying.
Basically, whenever I shut down HA using this command

sudo systemctl restart [email protected]

or when I do it via the user interface, HA takes forever to shut down and I have to unplug and plug the raspberry pi back in. The reboot command also does exactly the same thing.

Here is what I see in the systemctl status when this error occurs:

 [email protected] - Home Assistant for homeassistant
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled)
   Active: failed (Result: timeout) since Thu 2017-07-20 19:36:46 CEST; 2min 32s ago
 Main PID: 1211

Jul 20 19:33:17 hassbian hass[1211]: 2017-07-20 19:33:17 INFO (MainThread) [homeassistant.components.http] Serving /api/camera_proxy/camera.living_room to 90.43.120.241 (auth: False)
Jul 20 19:33:18 hassbian hass[1211]: 2017-07-20 19:33:18 INFO (Thread-6) [pyicloud.base] Authentication completed successfully
Jul 20 19:33:23 hassbian hass[1211]: 2017-07-20 19:33:23 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1979182576-10>
Jul 20 19:33:23 hassbian hass[1211]: 2017-07-20 19:33:23 INFO (MainThread) [homeassistant.core] Bus:Handling <Event homeassistant_stop[L]>
Jul 20 19:33:29 hassbian hass[1211]: 2017-07-20 19:33:28 INFO (MainThread) [homeassistant.core] Bus:Handling <Event homeassistant_close[L]>
Jul 20 19:33:45 hassbian systemd[1]: Stopping Home Assistant for homeassistant...
Jul 20 19:35:16 hassbian systemd[1]: [email protected] stop-sigterm timed out. Skipping SIGKILL.
Jul 20 19:36:46 hassbian systemd[1]: [email protected] stop-final-sigterm timed out. Skipping SIGKILL. Entering failed mode.
Jul 20 19:36:46 hassbian systemd[1]: Stopped Home Assistant for homeassistant.
Jul 20 19:36:46 hassbian systemd[1]: Unit [email protected] entered failed state.

So, what do you think I need to do to fix this issue?
I did a full reset on the PI, set up Hassbian again with all of my files but the issue still occurs.

I see that occasionally, but usually once it enters the failed state it starts the startup within a minute. How long do you wait until you reboot?

1 Like

In my case, HA will not reboot after it enters the failed state and I have to use

sudo systemctl start [email protected]

to get it to work again.

Odd. Don’t have an answer then I’m afraid. I’d just check you’ve updated both Raspbian (and the kernel) and that you’re on the current firmware (see https://www.raspberrypi.org/documentation/raspbian/updating.md), just in case you’ve got something outdated.

1 Like

I’ve already tried updating the firmware but that did not help.
When you use the “sudo systemctl restart [email protected]” command, for how much time does the command hang? Does it take more than 2 minutes?

Sometimes not at all, sometimes a minute or 2 - I honestly don’t track since it’s never failed to start after it reaches the failed state.

1 Like

Thanks for your help @Tinkerer but, after activating the “logger:”, I realised that I accidentally added a semi-column in the config and it seems that it was causing a lot of errors, and slowing down the shutdown process.

1 Like