Nuked my Docker install of HASS - help an idiot please

I haven’t had much luck searching for this error code and how to resolve it so apologies in advance if this is an easy fix or common problem.

Here’s my setup:
OpenMediaVault 5.6.16
Docker 20.10.9
HASS latest version running through Docker.

I ran out of space a few months back when I first enabled z-wave and zigbee through Docker containers and made them available to HASS. This locked me out of the OMV front end, stopped all my Docker containers, etc. I fixed this by removing log files to free up space through the command line.

Fast forward to now. I re-enabled z-wave and zigbee and setup a few devices. I started to run out of space pretty quick so I used NCDU from the command line to identify space hogs. But instead of deleting the logs, I accidentally deleted what appears to be the HASS specific folder out of /var/lib/docker/overlay2. Now I can’t get HASS to start. I’m prompted with this error:

Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/init": stat /init: no such file or directory: unknown.
Error:  failed to start containers:  homeassistant-102121

All other Docker containers are running without issue. Only HASS is not starting.

I’ve delete the HASS containers, recreated them, downloaded new images and recreated them, etc, and I still get the same error.

So how can I get HASS to start working again? I’m perfectly fine starting from scratch (concerning HASS, not all of Docker) if necessary. Any help is appreciated.

You likely corrupted an intermediate layer of the HA image.
I think docker rmi -f <image> will remove all layers, then a docker pull should download them back.

Thanks for the response.

No luck. I force removed the image from Portainer, did another pull, same error. Did the same thing from CLI, same error.

I tried switching to a different tag to pull in an older/different image and the same error persists.

Is it just home assistant that’s impacted? Ie can you create any other new containers? You may have actually deleted a file integral to docker itself and need to reinstall docker.

Only HomeAssistant. I haven’t tried to create a new container from scratch yet but all my existing ones (about 10?) are running flawlessly.

I’ve taken the server down multiple times since making the mistake trying things to fix it and the others stand up no problem.

Have you tried running docker system prune --all Make sure all the containers you want running are running or it will delete them.

If that doesn’t work, try and pull a totally new image of something you haven’t run before and create a new container from it and see if you still get the error. If you get an error, you can confirm its a docker problem then.

Unfortunately usually once you start manually messing around with files in /var/lib/docker and things go wrong it usually will corrupt docker and the only way to fix it is to reinstall docker.

The solutions I did find suggested backing up your containers, uninstalling docker, removing /var/lib/docker, reinstalling, etc.

I was hoping not to go that far but I will if I have to. Need to figure out the best way to back up the containers first.

I haven’t tried running prune yet. I’ll try that before the full uninstall after backing up the containers.

You just need to backup the volumes. The images can just be pulled again from the docker hub after a reinstall and the containers can easily be recreated mapping back to the old volumes.

If volumes are mapped directories, ie something like

            - '/home/user/docker/zwave/store:/usr/src/app/store'

The data for the container will persist just fine in the directory it is in outside docker and you just spin up the new container by pulling an image again with the same volume mapping and it will find the files and just run like it did before.

If the volume was defined within docker, like

            - '/var/run/docker.sock:/var/run/docker.sock'
            - 'portainer_data:/data'

Then those volumes should be in /var/lib/docker/volumes . Those will likely need to be manually backed up and copied back after a docker reinstall, and I would be a bit more concerned about those restarting easily after a full docker reinstall.