Installing Home Assistant Supervised on a Raspberry Pi using Debian 12

I’m currently running a supervised install still on Debian 10 with Raspberry Pi 4 booting from an attached SSD with USB3 adapter (no MicroSD).

There is a safe way to upgrade to Debian 11 without reinstalling and restoring a snapshot?

Some months ago me and other faced an issue with some 5.9 vs 5.10 files in RASPIFIRM partition that made system unbootable, and we had to reconfig booting to use old 5.9 version. This is stille the case for me.

There is, if you are running Home Assistant Supervised on a Raspberry Pi with Debian 10 (but not for RaspberryOS !).

Look upwards at post 387.

1 Like

Thanks for reply. I made the steps in that post and Pi booted.

However all docker containers failed to start: hassio_supervisor was trying to start every few second without success.

This was the output of docker events

2022-03-11T15:40:23.179487749+01:00 container create a3a47903e3879dc4cd2e0433ab254136bf9e312b0e7cc223a9f983655f68b827 (image=homeassistant/aarch64-hassio-supervisor, io.hass.arch=aarch64, io.hass.base.arch=aarch64, io.hass.base.image=homeassistant/aarch64-base:3.14, io.hass.base.name=python, io.hass.base.version=2022.02.0, io.hass.type=supervisor, io.hass.version=2022.03.3, name=hassio_supervisor, org.opencontainers.image.authors=The Home Assistant Authors, org.opencontainers.image.created=2022-03-10 12:24:42+00:00, org.opencontainers.image.description=Container-based system for managing Home Assistant Core installation, org.opencontainers.image.documentation=https://www.home-assistant.io/docs/, org.opencontainers.image.licenses=Apache License 2.0, org.opencontainers.image.source=https://github.com/home-assistant/supervisor, org.opencontainers.image.title=Home Assistant Supervisor, org.opencontainers.image.url=https://www.home-assistant.io/, org.opencontainers.image.version=2022.03.3)
2022-03-11T15:40:23.182858877+01:00 container attach a3a47903e3879dc4cd2e0433ab254136bf9e312b0e7cc223a9f983655f68b827 (image=homeassistant/aarch64-hassio-supervisor, io.hass.arch=aarch64, io.hass.base.arch=aarch64, io.hass.base.image=homeassistant/aarch64-base:3.14, io.hass.base.name=python, io.hass.base.version=2022.02.0, io.hass.type=supervisor, io.hass.version=2022.03.3, name=hassio_supervisor, org.opencontainers.image.authors=The Home Assistant Authors, org.opencontainers.image.created=2022-03-10 12:24:42+00:00, org.opencontainers.image.description=Container-based system for managing Home Assistant Core installation, org.opencontainers.image.documentation=https://www.home-assistant.io/docs/, org.opencontainers.image.licenses=Apache License 2.0, org.opencontainers.image.source=https://github.com/home-assistant/supervisor, org.opencontainers.image.title=Home Assistant Supervisor, org.opencontainers.image.url=https://www.home-assistant.io/, org.opencontainers.image.version=2022.03.3)
2022-03-11T15:40:23.226870461+01:00 network connect caf4ec5ffcf6e30ae7ce4433a4e1000935c8f2173388a05693f1a58083d81e2c (container=a3a47903e3879dc4cd2e0433ab254136bf9e312b0e7cc223a9f983655f68b827, name=bridge, type=bridge)
2022-03-11T15:40:23.861375470+01:00 network disconnect caf4ec5ffcf6e30ae7ce4433a4e1000935c8f2173388a05693f1a58083d81e2c (container=a3a47903e3879dc4cd2e0433ab254136bf9e312b0e7cc223a9f983655f68b827, name=bridge, type=bridge)
2022-03-11T15:40:29.820824826+01:00 container attach a3a47903e3879dc4cd2e0433ab254136bf9e312b0e7cc223a9f983655f68b827 (image=homeassistant/aarch64-hassio-supervisor, io.hass.arch=aarch64, io.hass.base.arch=aarch64, io.hass.base.image=homeassistant/aarch64-base:3.14, io.hass.base.name=python, io.hass.base.version=2022.02.0, io.hass.type=supervisor, io.hass.version=2022.03.3, name=hassio_supervisor, org.opencontainers.image.authors=The Home Assistant Authors, org.opencontainers.image.created=2022-03-10 12:24:42+00:00, org.opencontainers.image.description=Container-based system for managing Home Assistant Core installation, org.opencontainers.image.documentation=https://www.home-assistant.io/docs/, org.opencontainers.image.licenses=Apache License 2.0, org.opencontainers.image.source=https://github.com/home-assistant/supervisor, org.opencontainers.image.title=Home Assistant Supervisor, org.opencontainers.image.url=https://www.home-assistant.io/, org.opencontainers.image.version=2022.03.3)
2022-03-11T15:40:29.876597305+01:00 network connect caf4ec5ffcf6e30ae7ce4433a4e1000935c8f2173388a05693f1a58083d81e2c (container=a3a47903e3879dc4cd2e0433ab254136bf9e312b0e7cc223a9f983655f68b827, name=bridge, type=bridge)
2022-03-11T15:40:30.065898273+01:00 network disconnect caf4ec5ffcf6e30ae7ce4433a4e1000935c8f2173388a05693f1a58083d81e2c (container=a3a47903e3879dc4cd2e0433ab254136bf9e312b0e7cc223a9f983655f68b827, name=bridge, type=bridge)
2022-03-11T15:40:30.223447089+01:00 container destroy a3a47903e3879dc4cd2e0433ab254136bf9e312b0e7cc223a9f983655f68b827 (image=homeassistant/aarch64-hassio-supervisor, io.hass.arch=aarch64, io.hass.base.arch=aarch64, io.hass.base.image=homeassistant/aarch64-base:3.14, io.hass.base.name=python, io.hass.base.version=2022.02.0, io.hass.type=supervisor, io.hass.version=2022.03.3, name=hassio_supervisor, org.opencontainers.image.authors=The Home Assistant Authors, org.opencontainers.image.created=2022-03-10 12:24:42+00:00, org.opencontainers.image.description=Container-based system for managing Home Assistant Core installation, org.opencontainers.image.documentation=https://www.home-assistant.io/docs/, org.opencontainers.image.licenses=Apache License 2.0, org.opencontainers.image.source=https://github.com/home-assistant/supervisor, org.opencontainers.image.title=Home Assistant Supervisor, org.opencontainers.image.url=https://www.home-assistant.io/, org.opencontainers.image.version=2022.03.3)
2022-03-11T15:40:30.389909659+01:00 container create a6ed97dee7da931940bbad88e6d92385adba2b54225d8280fa564b269243402c (image=homeassistant/aarch64-hassio-supervisor, io.hass.arch=aarch64, io.hass.base.arch=aarch64, io.hass.base.image=homeassistant/aarch64-base:3.14, io.hass.base.name=python, io.hass.base.version=2022.02.0, io.hass.type=supervisor, io.hass.version=2022.03.3, name=hassio_supervisor, org.opencontainers.image.authors=The Home Assistant Authors, org.opencontainers.image.created=2022-03-10 12:24:42+00:00, org.opencontainers.image.description=Container-based system for managing Home Assistant Core installation, org.opencontainers.image.documentation=https://www.home-assistant.io/docs/, org.opencontainers.image.licenses=Apache License 2.0, org.opencontainers.image.source=https://github.com/home-assistant/supervisor, org.opencontainers.image.title=Home Assistant Supervisor, org.opencontainers.image.url=https://www.home-assistant.io/, org.opencontainers.image.version=2022.03.3)

It’s likely I had problems in the past with docker because…

root@homeassistant:~# apt-mark showhold
containerd.io
docker-ce
docker-ce-cli

After unholding these and upgrading, containers now start again.

Unfortunately there are other problems. Home Assistant become unresponsive (http or even SSH) some time after every reboot. It seems it’s busy in something. Maybe MariaDB addon?

It’s this related to the upgrade? How to further diagnose and solve?

If you do a full upgrade between major versions of the OS all packages which were put on hold before have to be set to unhold before initiating the full upgrade to avoid problems with packages for older versions which wont get replaced by newer versions coming with the new OS.

You are running the RPI4 from SSD with an USB3 adapter. There is a known problem about cases where HA is getting very slow or even unresponsive especially when accessing the logs, Logbook and History.

What helped me to overcome this issue effectively you can find here and here.

It seems that my problems were not related to Debian upgrade but to Home Assistant core upgrade and the database schema change. An index creation on statistics table was failing because of duplicates. It turned out that I had around 50million records for 2021-10-31. Wasn’t easy, but I managed to remove those records (losing 2021-10-31 statistics I suppose) and the database schema change seems now successful.

Likely there was a bug handling DST change that caused the problem I didn’t noticed until upgrading HA core. Likely the database schema changing was repsonsible of making at some point my system unresponsive.

At least, I hope so.

Installation of home-assistant / supervised-installer Release 1.1.1 will partially fail:

grep: /etc/default/grub: No such file or directory
[info] Switching to cgroup v1
cp: cannot stat '/etc/default/grub': No such file or directory
dpkg: error processing package homeassistant-supervised (--install):
 installed homeassistant-supervised package post-installation script subprocess returned error exit status 1

The solution as described by fcastilloec is:

If you need to enable cgroups v1, the values cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory must be added to /boot/cmdline.txt.

The above didn’t fix the issue on my clean debian 11 build as the install script still wanted to access grub files. Here’s what I did.

I guess one way to fix the problem is to do the following

touch /etc/default/grub

Then put a script named update-grub in /bin that doesn’t do anything

#!/bin/bash
echo $@ > /tmp/update-grub.out 

Not a good solution but the install will complete and it appears HA is up and working.

1 Like

As I pointed out on github supervised-installer PR #201:

fcastilloec’s recommendation helped me!
But as stated before: Installing the HA supervisor on Raspberry Pi OS is not supported. Doing so has the following consequence:

[...]
1 not fully installed or removed. <--

And each invocation of apt install / remove/ ... leads to these few lines repeated over and over:

[info] Switching to cgroup v1
cp: cannot stat '/etc/default/grub': No such file or directory
dpkg: error processing package homeassistant-supervised (--configure):
 installed homeassistant-supervised package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 homeassistant-supervised
E: Sub-process /usr/bin/dpkg returned an error code (1)

To solve this issue comment the lines concerning grub + cgroup in /var/lib/dpkg/info/homeassistant-supervised.postinst.
Then just run apt autoremove and the installation will successfully conclude and stop nagging.

1 Like

I like your solution. But to be clear I’ve installed on a clean debian bullseye system, not on raspberry os. Looking for grub shouldn’t be something this package does on an arm system. There is no grub on any arm based system I’m aware of. Seems a few lines of code in the package could fix this. My kernel parameters are in /boot/extlinux/extlinux.conf, which I believe is standard on most debian arm installs. When the package see it’s an arm install, or grub file isn’t present, it could just post a message about the need to fix. Thanks for the response.

Where did you get the image from? This?

This site has scripts that builds for a few different boards. I’m using the N2+ builld.

https://github.com/pyavitz/debian-image-builder

You have to build the image on a debian bullseye system and it’ll cross compile anything special required for the specific image you’re building. The guy that runs the site is very responsive and its only a couple commands to get a full image. He has an image build for PI4, but I haven’t used it.

So if I understand you correctly you are installing HA Supervised on an Odroid N2+ but not on a Raspberry Pi?

Yes, I think the N2+ is the best option for HA. If you use a raspberry pi that same guy has a site specifically for Raspberry pi image builds

https://github.com/pyavitz/rpi-img-builder

The guy recommends this builder if you’re going to run on a pi.

He actually has some full images posted here

https://github.com/pyavitz/binary/releases/tag/images

Exclusively for running HA Supervised on a RPI you really should use an image specially cooked for the RPI but not for Odroid.

Note Section 1 – Install Debian 11

1.1) Start by downloading the correct xz-compressed image for your Pi from HERE . For a Pi 4, you will need the image listed as 4 under Family

Then you are posting into the wrong thread. This thread is for Installing Home Assistant Supervised on a Raspberry Pi with Debian 11.

As for installing HA on Odroid there are plenty of instructions on the web like here or here or here and many more.

1 Like

The images I’ve posted are 100% Debian with minimal items installed. Ideally I’d want a bullseye image from the raspberry pi people. I did tried the straight bullseye image for PI4 but it ended up crashing. It seemed to have some issues when I tried it. Anyway the guy that runs that site I mentioned seems pretty committed to getting clean images that work. As you’ve indicated you can’t really find a good image for odroid N2+. There is one available on the hardkernel forum but it had reboot issues. Since HA had a specific release with odroid it would be nice if the HA team has made their debian release available for people that need to do a little more than the basic HA stuff.

While I can understand you frustration you are clogging up a forum thread (Community Guide) for installing and running HA Supervised on the Rasspberry Pi and probably confusing people who don’t read thoughtfully.

I would open a new thread specially about installing HA Supervised on Odroid N2(+). That way you might get more focused support and things here are not getting mixed up.

2 Likes

dist-upgrading from rpi os buster to bullseye worked flawlessly for me. Maybe you should give it a try.

I posted here because I had the same bullseye issue and then I respond to your questions. Seems we don’t agree on who’s clogging who. Have a good day.