Duplicate events due to multiple homeassistant containers

I got duplicate events due to multiple homeassistant containers.

I tried stopping the 2021.2.3 version (docker id ‘homeassistant’), alas to no avail. It keeps restarting:

docker update --restart=no homeassistant 
docker stop homeassistant

What else could I do to fix this?

$ docker ps

CONTAINER ID   IMAGE                                               COMMAND                  CREATED      
47dcf40ad2a7   homeassistant/armv7-hassio-audio:2021.04.0          "/init"                  About an hour
12ca87521c91   homeassistant/armv7-addon-configurator:3.6          "/run.sh"                3 hours ago  
3580538dabcb   poeschl/hassio-picotts-armv7:1.0.8                  "/init /run.sh"          3 hours ago  
ed37abfd4bcf   homeassistant/armv7-hassio-multicast:2021.04.0      "/init"                  3 hours ago  
ae3cd50b7b51   ghcr.io/home-assistant/armv7-hassio-cli:2021.05.0   "/init /bin/bash -c …"   3 hours ago  
8dc3b9ae7513   homeassistant/armv7-hassio-dns:2021.04.0            "/init"                  3 hours ago  
3a4df3a3ff72   homeassistant/armv7-hassio-observer:2020.10.1       "/init"                  38 hours ago 
0c571e062b25   homeassistant/armv7-hassio-supervisor               "/init"                  4 days ago   
a7eae802088f   homeassistant/raspberrypi3-homeassistant:2021.2.3   "/init"                  5 days ago  ..homeassistant 
f9c46f5a2b14   homeassistant/raspberrypi3-homeassistant:stable     "/init"                  9 days ago   ..home-assistant

Are you using Home Assistant Container (where you use a startup script or docker-compose to start Home Assistant) or Home Assistant Supervisor?

If you are uncertain, go to Configuration > Info > System Health > Installation Type.

If it’s Container then you should have complete control over which containers are started, including the ability to delete the image file that is used to spawn the container having the older version.

docker stop a7eae802088f should do.
You can docker rm a7eae802088f to remove the container forever.

  1. Came here to mark your reply as solution
  2. docker ps reveals 2021.2.3 is back again using a new docker id

Installation Type : Home Assistant Container

delete the image file that is used to spawn the container having the older version

Thank you. How?

This lists all docker images. Use it to get the image_id of the image file you wish to remove.

docker images

Once you have identified the image_id (let’s say it’s 7b4ef2etcetc) use this command to remove it:

docker rmi 7b4ef2etcetc

You indicated you are using Home Assistant Container. What are you using to start it?

Where in the doc should I start reading about Stop docker to spawn other docker container ?

Look like homeassistant:2021.2.3 is actually the one spawned by the supervisor, so it’s the other one one you should remove. Do you know where it comes from?

If you want to get rid of the supervisor, remove 0c571e062b25 (actually, all the hassio ones)

If you want the latest supervised version, update it through the supervisor.

I have no clue. Will try removing all containers except homeassistant/raspberrypi3-homeassistant:stable

Sure that’s want you want?
You will have to manage the container and updates all by yourself, then, and you don’t seem super at ease with docker…

Thank you for asking. No, I’m not sure at all, though haven’t seen (nor missed) the supervisor in the sidebar anymore after updating (apparently installing) as described here: Raspberry Pi - Home Assistant

# if this returns "Image is up to date" then you can stop here
docker pull homeassistant/raspberrypi3-homeassistant:stable

# stop the running container
docker stop homeassistant

# remove it from Docker's list of containers
docker rm homeassistant

# finally, start a new one
docker run --init -d \
  --name homeassistant \
  --restart=unless-stopped \
  -v /PATH_TO_YOUR_CONFIG:/config \
  -v /etc/localtime:/etc/localtime:ro \
  --network=host \
  homeassistant/raspberrypi3-homeassistant:stable

Fair enough.
Just do the procedure above each time you want to update HA.

1 Like

You appear to have used Home Assistant Supervised and have switched to Home Assistant Container. However, you didn’t remove the installation of Home Assistant Supervised.

May I ask why you switched to Container? It requires more knowledge of docker management and, based on your questions, it’s clear you aren’t familiar with it.

Yeah, I was thinking the same thing. That’s why I linked to the docs.

But to address the issue…

The supervisor, when installed, takes special control over with your system. One of those controls is that it totally controls the HA containers (but only the ones related to the Supervised installation). So, for example, if the HA container itself gets removed, it reinstalls it. If the supervisor container gets stopped it restarts it, if it gets removed it reinstalls it.

the way it does that is by running a service in the background of your OS. The only way to stop that from happening is to stop the supervisor background service.

you can that by doing the following;

sudo systemctl stop hassio-supervisor.service
sudo systemctl stop hassio-apparmor.service

At least that’s how I did it during my testing of the Supervised install. things may have changed…but I doubt it.

then you can remove those same services and remove all of the associated containers and images for the Supervised install.