Help! Home Assistant cannot start after forced reboot: Audio layer cannot be installed?

Hello everyone,

today, after a forced reboot of Home assistant due to a black out, I could not connect anymore to home assistant. After rebooting a couple of more times, I checked
http://homeassistant.local:4357, and it appears as if home assistant is stuck in the following loop:

2024-05-02 16:03:58.642 INFO (MainThread) [supervisor.docker.interface] Downloading docker image ghcr.io/home-assistant/aarch64-hassio-audio with tag 2023.12.0.
2024-05-02 16:03:59.267 ERROR (MainThread) [supervisor.docker.interface] Can't install ghcr.io/home-assistant/aarch64-hassio-audio:2023.12.0: 500 Server Error for http+docker://localhost/v1.42/images/ghcr.io/home-assistant/aarch64-hassio-audio:2023.12.0/json: Internal Server Error ("layer does not exist")
2024-05-02 16:03:59.268 WARNING (MainThread) [supervisor.plugins.base] Error on installing audio plugin, retrying in 30sec

does anyone recognize this error? What do I do now?

Thanks a lot for any help!
Best,
Phil

How is HA installed ?

Normally, open a console and enter

ha supervisor repair

Hi,
Thanks for the quick reply. I installed home assistant as a standalone system on an Raspberry Pi 4, (I believe it is called HA OS?).

While I can connect to the home assistant CLI, when I execute

ha supervisor repair

it only returns:

Processing... Done.

Error: system is not ready with state: setup

Perhaps I can manually unload the faulty audio layer or so?

Best,
Phil

You could try

docker container prune

Also no luck. It doesn’t seem as if the system has taken the command.

Try first with

login
docker container prune
1 Like

Thanks for your reply! After executing login, the command executes. After confirming that I really want to delete unused docker containers, it deleted some docker containers. However the error persists…

In the meantime I google around a bit, I came over this question. However I am unsure if I should go down that road, as I am not a very experienced Linux user. I fear that I might break something which should not be broken.

Unfortunately, Docker has some cases where it just can’t recover. It seems you hit such a case :cry: .

In general, probably taking a full backup and download it, then start from scratch is the easiest way here. In any case, make sure you have a backup before trying anything more exotic :sweat_smile:

I’ve debugged a similar case a while back, and did write a script which was able to recover at least some situation. It may help in your case. You can find the script here: Green: Initial installation fails with "Can't install ghcr.io/home-assistant/green-homeassistant:2023.11.3" (Not Found) · Issue #4738 · home-assistant/supervisor · GitHub

Allright thanks for the advice, I think it is a good idea to first do a back-up.

But, how do you perform an back-up over CLI? Is there a simple command for this? And how do I get this back-up out of the system? Via a USB-stick? Is there a guide for this procedure?

@agners or should I ask this question in a separate topic?

@agners: But how can I create such a backup? When I try

ha backup new

the CLI only returns

Processing... Done.

Error: system is not ready with state: setup

I also tried

core stop

but that also does not work. Is it possible to create a backup in this state?

Hm, right, the Supervisor can’t startup at this point, so it doesn’t allow backup :frowning_face:

I don’t think there is a way to circumvent that.

Since you are running on a Raspberry Pi 4, probably the easiest here is to connect the SD card to a PC and copy the files from a Ubuntu live system. The data is stored in the last partition of the SD card (labeled hassos-data) in a directory named “supervisor”.

Afterwards, I’d try to just blow away the docker directory on the hassos-data partition completely. Home Assistant OS will download all necessary components again. And since all relevant user data is stored in the supervisor directory. I tested this on a Raspberry Pi 5 installation: I plugged the SD card to my Linux PC, and deleted the Docker data store rm -rf /path/to/hassos-data/docker. Then I plugged it back into the Raspberry Pi 5. The initial boot took quite a while, and the shell dropped me into an emergency shell (“Home Assistan CLI not starting!” …). But this is just because the start takes much longer than usual. In the end, I was able to connect to homeassistant via default port 8123 again.

1 Like

I just tested this, and it worked flawlessly as you suggested. For future reference, I performed the following steps:

  1. I created a backup by taking out the SD card from my Raspberry Pi and saving the supervisor folder in the hassos-data partition (A Linux PC is needed for this step)
  2. I then simply erased the complete docker folder in the hasos-data partition (this are a couple of Gb)
  3. Then I reinserted the SD-Card in the Raspberry Pi and started. The system booted up normally. I did not need the

Thanks again @agners for this solution! This is of course much simpler then messing around with the docker layers or scripts :D.

1 Like