WatchTower not updating HA

I have setup watchtower to auto update all my containers. It work perfectly for all but homeassistant. I see the following error in the logs

level=info msg="Unable to update container \"/homeassistant\": exposed ports does not match port bindings. Proceeding to next."

My HA docker instance is running on ports 8123:8123 .

Appreciate any help.

I installed watchtower on a supervised install, and they system complained. HA will not update if watchtower is running, The latest version of some HA containers are not guaranteed to work.

The documentation recomends running home assistant in host network mode.

The auto discovery features rely on host network mode Host network driver | Docker Docs and searches for devices on many other ports beside 8123. Not sure if this is creating your error in Watchtower. I don’t use watchtower myself and just install the home assistant updates manually through portainer.

Watchtower definitely wont work with a supervised install since it will conflict with the supervisor, but should work with the stand alone docker container install.

Personally, I wouldn’t want to use watchtower to automatically update home assistant. There are way too many breaking changes with each new release that I want to double check would impact my install, so i’d rather manually do the updates after all is verified ok and backed up

1 Like

Agree 100%. I just run a shell script to update HA after reading, and understanding all breaking changes!

### update.sh ###
#!/bin/bash

echo -e "\e[1;33m Pulling New Stable Version... \e[0m"
docker pull homeassistant/home-assistant:stable
echo -e "\e[1;33m Stopping Home Assistant... \e[0m"
docker stop homeassistant
echo -e "\e[1;33m Removing Home Assistant... \e[0m"
docker rm homeassistant
echo -e "\e[1;33m Starting Home Assistant... \e[0m"
docker run -d --name homeassistant --restart unless-stopped -v hass-config:/config -e TZ=US/Eastern --net=host homeassistant/home-assistant:stable
echo -e "\e[1;33m Removing Old Image... \e[0m"
docker image prune -f
echo -e "\e[1;33m Finished Update! \e[0m"

Thanks avd, mwav3 and tteck for all answers and suggestions. I would also stick to manual update :slight_smile: It seems to be better option for HA.

I’m running a non-supervised HA as its docker image.

2 Likes

I have the same error from Watchtower.
It worked in the past but I changed NAS and I can’t get it to work. I understand your reluctance to update HomeAssistant automatically, but I liked it or I would like to choose.
Thanks everyone for the help.

Your script returns this error to me:
“WARNING: Error loading config file: .dockercfg: $HOME is not defined”
How can I fix it?
I’m sorry but I’m a rookie.
Thanks a lot

What’s the scripts URL?

I don’t understand. I run the script via task scheduler of DSM

It appears there was a bug in the docker CLI itself, which was fixed back in January

How to update the CLI depends on the host OS you are running on. Once you update it hopefully it resolves this error.

Install and update instructions should be here - just select your OS/Distro

1 Like

Oh, you’re referencing the update shell script :man_facepalming: my bad.
@mwav3’s excellent memory has your solution.

1 Like

Thanks to all. I Will try soon.

1 Like

Hopefully its an easy fix. I run Ubuntu and this CLI update got installed automatically for me with the included “software updater” program. On a “headless” machine, updating would be going into the machine by SSH and just running sudo apt-get update from the command line.

Where it could be more complicated is if you are running a NAS that uses a custom OS. Those can be more difficult to update, and may require the manufacturer of the device to release a new OS update.

While on the subject of Watchtower, I recently learned of an alternative called “What’s up Docker” mentioned in this post

It integrates into MQTT so can create entities in Home Assistant showing the status of updates for containers. You then can create notification automations in Home Assistant based on when an update is available.

You can further configure What’s Up Docker for which containers you want to update automatically, which ones you want to get notifications on, and more. Seems to give you much more control then Watchtower. I don’t do the auto updates and use Portainer to create a new container when there is an update, but What’s Up Docker is great because before I used to have manually check each container’s Github page for an update. Thanks to @Burningstone for this info - his linked post has some example automations for this as well. Still playing around with it but here’s a Lovelace card I created to inform me of container updates - “On” means there is an update, “Off” means up to date

Screenshot from 2021-11-04 09-53-11

And suddenly everything works.
Watchtower also updates HA.
I have not done anything. Even the script despite the error did its dirty job.
Magic? Mah !!!
:roll_eyes: