Update: This github post says that the failed to register layer: open /var/lib/docker/aufs/layers/
problem is a known bug with Docker, which happens almost randomly, and suggested that the only way to fix it was “manually removing /var/lib/docker.” But I realized that all of HomeAssistant’s data is located inside /var/lib/docker
.
In hindsight, I should have just gone to my snapshots page in HASS.IO
and done a “Wipe & Restore” from my most recent snapshot. That should fix the problem.
But read on if you’re curious …or dumb like I was, lol…
Instead of doing a Wipe & Restore
of my installation from my HASS.IO
snapshot, I did the following procedures to attempt (unsuccessfully) to fix Docker. I later realized I couldn’t fix Docker, so backed up my Pi SD card and re-installed HASS.IO
from scratch:
Before anything, I backed up my HASS.IO
install by making a snapshot.
Then I gained root access to my Pi (see the above post for how to do that). Then I tried to follow the github poster’s instructions for refreshing Docker from command-line by removing all images and packages and re-installing. This proved impossible without nuking HASS.IO
, since HASS.IO
itself is a Docker image:
root@hassio:~# docker stop $(docker ps -a -q)
730e3e1e2b90
9b03a0f78e15
4bd8a665b163
6b7bf6db836e
b491c23ce2c0
1191da06437a
23473138bc9c
root@hassio:~# docker rm $(docker ps -a -q)
730e3e1e2b90
9b03a0f78e15
4bd8a665b163
6b7bf6db836e
b491c23ce2c0
1191da06437a
Error response from daemon: You cannot remove a running container 23473138bc9c289d6c5d67e6e8abb62992b6f5100f5145940a8c00cb6c6448fb. Stop the container before attempting removal or force remove
root@hassio:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
23473138bc9c homeassistant/armhf-hassio-supervisor "/usr/bin/entry.sh..." 2 weeks ago Up 1 second resin_supervisor
root@hassio:~# docker stop 23473138bc9c289d6c5d67e6e8abb62992b6f5100f5145940a8c00cb6c6448fb
23473138bc9c289d6c5d67e6e8abb62992b6f5100f5145940a8c00cb6c6448fb
root@hassio:~# docker rm 23473138bc9c289d6c5d67e6e8abb62992b6f5100f5145940a8c00cb6c6448fb
23473138bc9c289d6c5d67e6e8abb62992b6f5100f5145940a8c00cb6c6448fb
root@hassio:~# docker rmi $(docker images -q)
Untagged: homeassistant/resinos-hassio:1.3-raspberrypi3
Untagged: homeassistant/resinos-hassio@sha256:ad6e69914a0d1b6c13a412c7393b4435752ba03174b4a9a7fd5aee7ab7b7627f
Deleted: sha256:ac4f51d200ffa3f2a8470d3241bf4ace42267b24ec36028c928155b3065417e8
Deleted: sha256:1a55c1dd95631cecf2167483e2b54e934a4d3f39ad187d4a3a8856c8ad7644c0
Error response from daemon: conflict: unable to delete 57374809c1c4 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 57374809c1c4 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 512f3c9a457e (cannot be forced) - image is being used by running container c7d26c040236
Error response from daemon: conflict: unable to delete 512f3c9a457e (cannot be forced) - image is being used by running container c7d26c040236
Error response from daemon: conflict: unable to delete b308b1e8c494 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete b308b1e8c494 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 03bfae73187c (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 03bfae73187c (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete ad26a83bbbf5 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete ad26a83bbbf5 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 863cdeccb471 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 863cdeccb471 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete b6d3ba2c0d20 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete b6d3ba2c0d20 (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 8e00a799120c (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 8e00a799120c (must be forced) - image is referenced in multiple repositories
root@hassio:~# service docker stop #
-sh: service: command not found
root@hassio:~# service docker stop
-sh: service: command not found
root@hassio:~# rm -rf /var/lib/docker/overlay2
root@hassio:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c7d26c040236 homeassistant/armhf-hassio-supervisor "/usr/bin/entry.sh..." 4 minutes ago Up 3 minutes resin_supervisor
root@hassio:~# docker pull homeassistant/armhf-addon-samba:latest
latest: Pulling from homeassistant/armhf-addon-samba
95d54dd4bdad: Already exists
72bf7d76c392: Already exists
0da33bb3490c: Already exists
a8ece121d40c: Already exists
308601741197: Already exists
e22c64886831: Extracting [==================================================>] 11.44MB/11.44MB
919bd02cb95e: Ready to download
830e5d54a26b: Ready to download
d4e12538e0b5: Ready to download
failed to register layer: open /var/lib/docker/aufs/layers/861f3ea040dcb36042ef8a9d3ee54705b4a4b6f9ecf91713e7f2a7f2d4020d94: no such file or directory
root@hassio:~# service docker stop
-sh: service: command not found
root@hassio:~# docker system prune
WARNING! This will remove:
- all stopped containers
- all volumes not used by at least one container
- all networks not used by at least one container
- all dangling images
Are you sure you want to continue? [y/N] n
root@hassio:~# docker system prune
WARNING! This will remove:
- all stopped containers
- all volumes not used by at least one container
- all networks not used by at least one container
- all dangling images
Are you sure you want to continue? [y/N] y
error during connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.31/networks/prune: EOF
root@hassio:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
homeassistant/raspberrypi3-homeassistant 0.67.1 57374809c1c4 11 days ago 1.02GB
homeassistant/raspberrypi3-homeassistant latest 57374809c1c4 11 days ago 1.02GB
homeassistant/armhf-hassio-supervisor 0.101 512f3c9a457e 2 weeks ago 122MB
homeassistant/armhf-hassio-supervisor latest 512f3c9a457e 2 weeks ago 122MB
homeassistant/armhf-addon-duckdns 1.3 b308b1e8c494 4 weeks ago 18.9MB
homeassistant/armhf-addon-duckdns latest b308b1e8c494 4 weeks ago 18.9MB
homeassistant/armhf-addon-ssh 3.4 03bfae73187c 2 months ago 71MB
homeassistant/armhf-addon-ssh latest 03bfae73187c 2 months ago 71MB
homeassistant/armhf-addon-rpc_shutdown 0.3 ad26a83bbbf5 6 months ago 41.3MB
homeassistant/armhf-addon-rpc_shutdown latest ad26a83bbbf5 6 months ago 41.3MB
homeassistant/armhf-addon-letsencrypt 1.2 863cdeccb471 9 months ago 72.3MB
homeassistant/armhf-addon-letsencrypt latest 863cdeccb471 9 months ago 72.3MB
homeassistant/armhf-addon-mosquitto 1.0 b6d3ba2c0d20 9 months ago 14.6MB
homeassistant/armhf-addon-mosquitto latest b6d3ba2c0d20 9 months ago 14.6MB
vkorn/armhf-ps4waker 0.0.2 8e00a799120c 10 months ago 64.6MB
vkorn/armhf-ps4waker latest 8e00a799120c 10 months ago 64.6MB
root@hassio:~# docker pull homeassistant/armhf-addon-samba:latest
latest: Pulling from homeassistant/armhf-addon-samba
95d54dd4bdad: Already exists
72bf7d76c392: Already exists
0da33bb3490c: Already exists
a8ece121d40c: Already exists
308601741197: Already exists
e22c64886831: Extracting [==================================================>] 11.44MB/11.44MB
919bd02cb95e: Ready to download
830e5d54a26b: Ready to download
d4e12538e0b5: Ready to download
failed to register layer: open /var/lib/docker/aufs/layers/861f3ea040dcb36042ef8a9d3ee54705b4a4b6f9ecf91713e7f2a7f2d4020d94: no such file or directory
root@hassio:~# cd var
-sh: cd: var: No such file or directory
root@hassio:~# ls
root@hassio:~# bash
root@hassio:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
085c3209479c homeassistant/armhf-hassio-supervisor "/usr/bin/entry.sh..." 2 minutes ago Up 2 minutes resin_supervisor
root@hassio:~#
Realizing I would have to re-install HASS.IO
to truly “refresh” Docker manually, I backed up my SD Card onto my Windows PC. resin-boot
(Drive D: in my case) is the only partition readable by Windows and does not contain HomeAssistant configuration data. I backed up my authorized_keys
file from here.
I put my Pi SD card into my Windows PC and opened DiskInternals Linux Reader to read the Linux partitions on my Pi SD card attached to my Windows PC. I navigated to /var/lib/docker\resin-data\
, saved my backup
, share
, ssl
, and homeassistant
folders.
Then I downloaded the HASS.IO
install image, wiped my current Pi SD card by going to Windows\Control Panel\System and Security\Administrative Tools\Computer Management > Disk Management
and deleting all volumes on my Pi’s SD card.
I used Win32DiskImager to write the HASS.IO
install image onto my SD card. I then closed DiskInternals Linux Reader
and re-opened it. I put the authorized_keys
file back into resin-boot
. I put the Pi SD card back into my Pi, turned on the Pi, waited a few minutes, found the IP of my Pi in my router’s “attached devices” list, logged in using HASSIO_IP_HERE:8123
(hassio.local:8123
didn’t work for me).
Once HASS.IO
was running again, i installed Samba Share from the HASS.IO > Addons
tab (thank Jesus, Samba finally installed correctly from Docker, lol), started Samba Share.
I then found my HASS.IO
Pi on my LAN in Windows File Explorer (now that Samba Share was turned on), copied my latest backed-up HomeAssistant system “snapshot” from my Windows desktop to the “backup” folder on my Pi’s samba share.
I then logged into HASS.IO
via Internet Explorer, installed that “snapshot” through HASS.IO
(I didn’t choose to restore the faulty Let’s Encrypt - idk if that matters). Then installed, configured, and ran the Let’s Encrypt Addon. Then rebooted the Pi.
Interestingly, refreshing my install manually like this made my custom PS4 component not available anymore, but I think that will be an easy re-install.