Docker install does not upgrade

I installed HA in docker on Ubuntu 18.04 last November and got it going with my Intesishome heat pump controller using a custom component. I have just pretty much left it running in the background since then, and it has been working mostly fine. Once or twice I have had to restart HA as it had stopped for some reason. Today, I checked the Intesishome support and it was integrated into HA in 0.104, so I thought it was about time I upgraded to the latest version. So I shut down HA (systemctl stop homeassistant) and did the docker upgrade:

docker pull homeassistant/home-assistant:latest

from a root prompt. I saw a lot of docker containers get upgraded, and there were no errors or warnings. So I removed my custom component directory and started HA again (systemctl start homeassistant). I was expecting that the configuration I had for my heat pump would now work with the builtin Intesishome support, but I got errors instead. So I let HA finish starting and then from the GUI Developer Tools page I took a look at the current version number. I was very surprised to see it was still saying 0.101.1.

I have restored my custom component directory and restarted HA and now the heat pump component is working again without any errors.

So does anyone have any idea what I have done wrong with this upgrade? What do I do to get it upgraded to the latest version?

Docker pull just downloads the new images, it doesn’t change your container. You need to recreate your container with docker rm / docker run.

Or you can stop the old container (docker stop not systemctl) and create/start a new one and keep the old container around for rollback purposes.

I have no real knowledge of how to use docker, but here is what I see when I run “systemctl cat homeassistant”:

# /etc/systemd/system/homeassistant.service
[Unit]
Description=Home Assistant
Requires=docker.service mosquitto.service
After=docker.service mosquitto.service

[Service]
Restart=always
RestartSec=3
ExecStart=/usr/bin/docker run --name=home-assistant -v /home/homeassistant/:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant:stable
ExecStop=/usr/bin/docker stop -t 2 home-assistant
ExecStopPost=/usr/bin/docker rm -f home-assistant

[Install]
WantedBy=multi-user.target

So it looks like systemctl is doing the necessary “docker stop” and “docker rm” commands when it shuts down HA, and then does a “docker run” when it starts HA. Does that look correct?

You wait long time for update. Likely HA won’t start regardless since 30+ breaking changes you miss but maybe u get lucky.

Easier you build new HA container and move on. Also may look at Portainer for container manager.

With Portainer it easy to tell rebuild container change from use homeassistant/home-assistant:latest to homeassistant/home-assistant:0.107.7

https://hub.docker.com/r/portainer/portainer/

The problem was my /etc/systemd/system/homeassistant.service file. On the ExecStart line it had:

homeassistant/home-assistant:stable

and I needed to change that to:

homeassistant/home-assistant:latest

Then I restarted HA and it was still 0.101.1, but when I restarted it again, I finally got 0.107.7. So I shut HA down again, removed my intesishome custom component, and started HA again, and finally I have it running with the new internal Intesis support.

Hi fe31nz
I seem to have a similar problem. New to HA (and very little Linux). Recently installed HA in Docker on my Synology NAS. Just tried upgrading it for the first time. Original install used the “:stable” tag but today’s Download used the “:latest” tag and yet HA opens with the old version still. So I suspect the tag is the cause.

? Where is the /etc/systemd/system/homeassistant.service file that you mention?
I cannot see that path from within DSM/File Station (but maybe I need root access to see it?)
? How did you update (edit) it? E.g. Within DSM or via SSH?
? Did that fully fix the problem or was more required?

Many thanks, IanBJ