Restart server does not help, restart docker container does

I use hassbian in Docker on a Synology Nas.

When I make changes to my configuration, restarting the Home Assistant server ensures that the changes are applied.
However, in the last few days I have been looking for the reason why a small change (adding some entities to saving in Influxdb) was not processed. When I restarted the Docker container today, it worked. took me a few hours: unamused:

The same thing happened once before when I wanted to add an IP camera while some others were displayed correctly.

If someone recognizes this, can you tell me when I just need to restart the home assistant server and when I have to restart the container?

That’s not possible. I assume you mean you are running Home Assistant in Docker. Hassbian is a pi-only distribution, based on Raspbian, which is a pi only distribution.

The best thing to do is always restart the container. Using the restart button in HA is iffy at best.

Thank you, I allways though there were two flavours : 1. Hassio and 2. Hassbian.

I think that I will restart the container when the restart button does not do what I expect.

Those are INSTALLATION METHODS for installing Home Assistant.

Those aren’t flavors of Home Assistant.

It is annoying that the restart button / service doesn’t work reliably. I hate to just arbitraritly kill the running process for fear of corrupting an sqlite3 database update or something. It’s not obvious how many worker threads are still running (or ideally, what they’re suspended on…) after punching the restart button and just waiting… awhile… before giving up and restarting the Docker container.

I run Home Assistant on Ubuntu 18.04 as the distributed Docker image.

You could set your HA Docker container restart policy to ‘Always’ then when you select server stop in HA it’ll restart the docker container automatically (and I assume will have shut down gracefully).

1 Like

My guess is that “stop” wouldn’t work much better than “restart”, but that might be worth a shot…

JS1, are you able to provide some simple instructions on how one might go about that?

I’m running lubuntu and am currently having a strange problem where, after boot, docker will start with homeassistant container running, but home assistant won’t be accessible. To make it accessible, I do a sudo docker restart homeassistant, restarting the docker container. Then Home Assistant boots properly and comes online.

Similarly, if I restart Home Assistant from inside home assistant (webgui), it doesn’t come back on by itself. Again, I have to manually restart the docker container.

I find it quite weird as I haven’t really messed around with docker since my install of home assistant quite a while ago. Could it have been affected by some update?

Hi, sorry for the late reply, I missed the notification that there was a new post.

In fact I manage my Docker containers with Portainer which makes it super easy to update HA and very easy to change the restart policy for a container, there is a field called restart policies, you select the one you want and click update.

Portainer made me a bit lazy with Docker to be honest, I stared off controlling Docker with the CLI but haven’t looked back since using Portainer.

Did you find a solution for this? I have been facing the exact same problem for a while. Also running the official container image, on RPi in my case. Restarting HA from the web UI will make it stop working however it never comes back up. HA then requires a docker-compose restart from CLI to come back to life, it’s annoying. Running the current stable image as of today.

The logs show nothing - it’s like the shutdown gets stuck, because I see the log is not re-initialized until the docker-compose restart is done

I have docker on a Synology Nas. Restarting the container is very easy. I don’t use compose. When restarting from the web doesn’t give the expected result I restart the container.

In your case restarting from the web UI sometimes work? In my case it seems to fail every time for some reason

Yes it does. I cannot say when it works by only restarting from the web ui and when it does not.

Hi, Did you find a solution to this please as i have exactly the same behaviour? Restart in the UI often only stops HA but it doesn’t come back up and iI then need to restart the container

To be honest, I don’t have this problem anymore lately. I did not find why this problem occured.