After dietpi update docker does not start

Hope that someone can help me. I updated my raspberry pi 4 with dietpi-update and docker does not start again.

Here is the service logs:

Feb 03 11:26:45 DietPi dockerd[462]: time="2023-02-03T11:26:45.228754882Z" level=error msg="[graphdriver] prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/
 for more information"
Feb 03 11:26:45 DietPi dockerd[462]: failed to start daemon: error initializing graphdriver: prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more inf
ormation
Feb 03 11:26:45 DietPi systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 11:26:45 DietPi systemd[1]: docker.service: Failed with result 'exit-code'.
Feb 03 11:26:47 DietPi systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
Feb 03 11:26:47 DietPi systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.
Feb 03 11:26:47 DietPi systemd[1]: Stopped Docker Application Container Engine.
Feb 03 11:26:47 DietPi systemd[1]: Started Docker Application Container Engine.
Feb 03 11:26:47 DietPi dockerd[581]: time="2023-02-03T11:26:47.919622473Z" level=warning msg="Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man dockerd` to refer to dm.thinpooldev section." storage-driver=devicemapper
Feb 03 11:26:48 DietPi dockerd[581]: time="2023-02-03T11:26:48.055395917Z" level=warning msg="Base device already exists and has filesystem ext4 on it. User specified filesystem  will be ignored." storage-driver=devicemapper
Feb 03 11:26:48 DietPi dockerd[581]: time="2023-02-03T11:26:48.135999824Z" level=error msg="[graphdriver] prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/
 for more information"
Feb 03 11:26:48 DietPi dockerd[581]: failed to start daemon: error initializing graphdriver: prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more inf
ormation
Feb 03 11:26:48 DietPi systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 11:26:48 DietPi systemd[1]: docker.service: Failed with result 'exit-code'.
Feb 03 11:26:50 DietPi systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
Feb 03 11:26:50 DietPi systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.
Feb 03 11:26:50 DietPi systemd[1]: Stopped Docker Application Container Engine.
Feb 03 11:26:50 DietPi systemd[1]: Started Docker Application Container Engine.
Feb 03 11:26:50 DietPi dockerd[599]: time="2023-02-03T11:26:50.746280045Z" level=warning msg="Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man dockerd` to refer to dm.thinpooldev section." storage-driver=devicemapper
Feb 03 11:26:50 DietPi dockerd[599]: time="2023-02-03T11:26:50.885199267Z" level=warning msg="Base device already exists and has filesystem ext4 on it. User specified filesystem  will be ignored." storage-driver=devicemapper
Feb 03 11:26:50 DietPi dockerd[599]: time="2023-02-03T11:26:50.956943563Z" level=error msg="[graphdriver] prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/
 for more information"
Feb 03 11:26:50 DietPi dockerd[599]: failed to start daemon: error initializing graphdriver: prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more inf
ormation

Can someone help please?

looks like something related to storage driver. Can you check if there was anything set specifically?

cat /etc/docker/daemon.json
{
    "data-root": "/mnt/dietpi_userdata/docker-data",
    "log-driver": "journald",
    "log-level": "warn",
    "debug": false
}

Does this mean anything? Everything was working fine before the update

So I think I found the problem.
For Dietpi version v8.13.2 docker version is 23.0.0, build e92dd87.
If you check the engine deprecation features in Docker documentation you can see that Device mapper storage driver was disabled in this version (more details here).
So to force this driver I just added the line:

"storage-driver": "devicemapper"

in /etc/docker/daemon.json

But now the documentation says that I should migrate to overlay2. I still don’t know how to do this.

Docker version has nothing to do with DietPi version. Docker is an own software title installed via apt package manager. What happen, during DietPi update we force an apt package update as well. Therefore, new Docher version has been installed in parallel.

Usually, overlay2 should be the default nowadays. Not sure why your system is running devicemapper. Maybe due to historical reason?

Not sure if there is a direct way to move from devicemapper to overlay2. In worst case, this would mean to drop all images and container, set overlay2 and recreate all container.

The same thing happens to me and if I do a docker ps I only get 1 docker out of the 30 that I have

 apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  linux-image-5.10.0-21-amd64
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 318 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 72244 files and directories currently installed.)
Removing linux-image-5.10.0-21-amd64 (5.10.162-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.10.0-21-amd64
/etc/kernel/postrm.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 9: /etc/default/grub: splash: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.10.0-21-amd64 (--remove):
 installed linux-image-5.10.0-21-amd64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.10.0-21-amd64
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

@cenizo your issue seems to be unrelated. The error above is pointing into issues to finalize the kernel update. @MichaIng can you have a look.

I also updated dietpi and since then no docker starts, I show the error.

docker start portainer
Error response from daemon: AppArmor enabled on system but the docker-default profile could not be loaded: running `apparmor_parser apparmor_parser --version` failed with output:
error: exec: "apparmor_parser": executable file not found in $PATH
Error: failed to start containers: portainer

If I do a docker ps it only shows me 1 of the 30 dockers that I have

This has nothing to do with DietPi. Docker 5.23 has some challenges DietPi-Software | Docker: Service fails to start after upgrade (AppArmor) · Issue #6126 · MichaIng/DietPi · GitHub

I too have a problem with docker/portainer, as they don’t start. I think it happened after the latest-recent apt update of docker and not after the upgrade of DietPi, which was several days before.

From my logs, it seems that I have the apparmor problem:

root@DietPi:~# journalctl -u docker -u containerd
-- Journal begins at Sun 2023-02-05 17:20:55 EET, ends at Sun 2023-02-05 17:25:49 EET. --
Feb 05 17:20:57 DietPi systemd[1]: Starting containerd container runtime...
Feb 05 17:20:58 DietPi containerd[514]: time="2023-02-05T17:20:58+02:00" level=warning msg="containerd config version `1` has been deprecated and will be removed in containerd v2.0, please switch to version `2`, see https://github.com/containerd/containerd/blob/94934e1a478c20ba844d1963ba3a8580ebaf763f/docs/PLUGINS.md#version-header"
Feb 05 17:20:58 DietPi containerd[514]: time="2023-02-05T17:20:58.229595234+02:00" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"
Feb 05 17:20:58 DietPi containerd[514]: time="2023-02-05T17:20:58.231738065+02:00" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"
Feb 05 17:20:58 DietPi containerd[514]: time="2023-02-05T17:20:58.241290129+02:00" level=error msg="failed to initialize a tracing processor \"otlp\"" error="no OpenTelemetry endpoint: skip plugin"
Feb 05 17:20:58 DietPi systemd[1]: Started containerd container runtime.
Feb 05 17:20:59 DietPi systemd[1]: Started Docker Application Container Engine.
Feb 05 17:20:59 DietPi dockerd[634]: time="2023-02-05T17:20:59.799064067+02:00" level=error msg="AppArmor enabled on system but the docker-default profile could not be loaded: running `apparmor_parser apparmor_parser --version` failed with output: \nerror: exec: \"apparmor_parser\": executable file not found in $PATH"
Feb 05 17:21:01 DietPi dockerd[634]: time="2023-02-05T17:21:01.076056093+02:00" level=error msg="0eaef5d6bfd3a0278e168dd15eda681d789f5c7a940b700194e818ede018a4f5 cleanup: failed to delete container from containerd: no such container"
Feb 05 17:21:01 DietPi dockerd[634]: time="2023-02-05T17:21:01.076116904+02:00" level=error msg="failed to start container" container=0eaef5d6bfd3a0278e168dd15eda681d789f5c7a940b700194e818ede018a4f5 error="AppArmor enabled on system but the docker-default profile could not be loaded: running `apparmor_parser apparmor_parser --version` failed with output: \nerror: exec: \"apparmor_parser\": executable file not found in $PATH"
Feb 05 17:21:01 DietPi dockerd[634]: time="2023-02-05T17:21:01.165650135+02:00" level=error msg="c607f3656942440b7c03faa4ff42a61029ec6723b3eb77c94d5bf6bfcd381519 cleanup: failed to delete container from containerd: no such container"
Feb 05 17:21:01 DietPi dockerd[634]: time="2023-02-05T17:21:01.165702125+02:00" level=error msg="failed to start container" container=c607f3656942440b7c03faa4ff42a61029ec6723b3eb77c94d5bf6bfcd381519 error="AppArmor enabled on system but the docker-default profile could not be loaded: running `apparmor_parser apparmor_parser --version` failed with output: \nerror: exec: \"apparmor_parser\": executable file not found in $PATH"
Feb 05 17:21:01 DietPi dockerd[634]: time="2023-02-05T17:21:01.180188444+02:00" level=error msg="5dfef709f5d164c632dd4c7a4a2026bf07d3d5a8a6af55e95a4d30a3741d8ecd cleanup: failed to delete container from containerd: no such container"
Feb 05 17:21:01 DietPi dockerd[634]: time="2023-02-05T17:21:01.180483191+02:00" level=error msg="failed to start container" container=5dfef709f5d164c632dd4c7a4a2026bf07d3d5a8a6af55e95a4d30a3741d8ecd error="AppArmor enabled on system but the docker-default profile could not be loaded: running `apparmor_parser apparmor_parser --version` failed with output: \nerror: exec: \"apparmor_parser\": executable file not found in $PATH"
Feb 05 17:21:01 DietPi dockerd[634]: time="2023-02-05T17:21:01.270447785+02:00" level=error msg="75ccd5448774bfc12bf76d47cdd244f7c9c6697ddff9629ae4cf1c02fae5a4e7 cleanup: failed to delete container from containerd: no such container"

Should I do the following:

apt install apparmor
systemctl stop apparmor

or is there another best-suggested solution?

For the record, it is a VM x86 AMD64

Yes that’s the way forward.

1 Like

Ok, did exactly that and docker is working again, thanks Joulinar

Should they also disable the apparmor service so it doesn’t restart on reboot?

Finally, Docker 23.0.2 has been released fixing the issue on x86 Docker Engine 23.0 release notes