Docker breaks after updating DietPi to latest version

Creating a bug report/issue

Required Information

  • DietPi version | cat /boot/dietpi/.version

G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=13
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
G_LIVE_PATCH_STATUS[0]=‘applied’
G_LIVE_PATCH_STATUS[1]=‘not applicable’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN

Bullseye

  • Kernel version | uname -a

Linux DietPi-LocalServices 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

Virtual Machine

Additional Information (if applicable)

  • Software title | Docker/Docker Compose
  • Was the software title installed freshly or updated/migrated? Updated/Migrated
  • Can this issue be replicated on a fresh installation of DietPi? N/A
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. DietPi-Update to latest version
  2. Run docker container ls

Following error message appears

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Expected behaviour

  • It should be listing all my containers and docker should be running

Actual behaviour

  • Docker fails to start

Extra details

  • root@DietPi-LocalServices:~# systemctl status docker -l
    ● docker.service - Docker Application Container Engine
    Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/docker.service.d
    └─dietpi-simple.conf
    Active: failed (Result: exit-code) since Sun 2023-02-12 14:20:31 GMT; 1min 53s ago
    TriggeredBy: ● docker.socket
    Docs: https://docs.docker.com
    Process: 11707 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
    Main PID: 11707 (code=exited, status=1/FAILURE)
    CPU: 87ms

Tried updating Docker using the following command;

apt update
apt install docker-ce containerd.io docker-ce-cli

And also tried to run: dietpi-software reinstall 134

Neither helped and docker does not work correctly.

Thanks for any and all help!

I guess you are hit by following bug of Docker software DietPi-Software | Docker: Service fails to start after upgrade (AppArmor) · Issue #6126 · MichaIng/DietPi · GitHub

1 Like

Did not see that, thank you. I’ll give it a try!

Check this video if it helps you.
[Fixed Dietpi update dropping containers - YouTube]

just to avoid a missunderstanding, this is NOT a DietPi issue. It’s a bug in Docker software directly.

Issue is describe on Docker release notes as known issue Docker Engine 23.0 release notes

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

Thank you for posting this. I’ll give the latest version a go tonight and see if its fixed it for me!

you can update docker by running apt update && apt upgrade

I’m afraid it hasn’t worked for me :frowning:


root@DietPi-LocalServices:~# systemctl status docker -l
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/docker.service.d
             └─dietpi-simple.conf
     Active: activating (auto-restart) (Result: exit-code) since Wed 2023-03-29 17:58:47 BST; 689ms ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 2275 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 2275 (code=exited, status=1/FAILURE)
        CPU: 86ms


root@DietPi-LocalServices:~# docker version
Client: Docker Engine - Community
 Version:           23.0.2
 API version:       1.42
 Go version:        go1.19.7
 Git commit:        569dd73
 Built:             Mon Mar 27 16:16:40 2023
 OS/Arch:           linux/amd64
 Context:           default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@DietPi-LocalServices:~#


Any thoughts of what i can do?

Thank you!

Did you tried to reboot your system?

Yeah tried rebooting and made no difference.

Your issue seems to be completely different from the original one. Can you share system logs please

journalctl -u docker.service
root@DietPi-LocalServices:~# journalctl -u docker.service
-- Journal begins at Thu 2023-03-30 23:20:45 BST, ends at Thu 2023-03-30 23:21:18 BST. --
Mar 30 23:20:49 DietPi-LocalServices systemd[1]: Started Docker Application Container Engine.
Mar 30 23:20:49 DietPi-LocalServices dockerd[464]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character '#' after top-level value
Mar 30 23:20:49 DietPi-LocalServices systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 30 23:20:49 DietPi-LocalServices systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 30 23:20:51 DietPi-LocalServices systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.
Mar 30 23:20:51 DietPi-LocalServices systemd[1]: Stopped Docker Application Container Engine.
Mar 30 23:20:51 DietPi-LocalServices systemd[1]: Started Docker Application Container Engine.
Mar 30 23:20:51 DietPi-LocalServices dockerd[508]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character '#' after top-level value
Mar 30 23:20:51 DietPi-LocalServices systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 30 23:20:51 DietPi-LocalServices systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 30 23:20:54 DietPi-LocalServices systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.
Mar 30 23:20:54 DietPi-LocalServices systemd[1]: Stopped Docker Application Container Engine.
Mar 30 23:20:54 DietPi-LocalServices systemd[1]: Started Docker Application Container Engine.
Mar 30 23:20:54 DietPi-LocalServices dockerd[518]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character '#' after top-level value
Mar 30 23:20:54 DietPi-LocalServices systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 30 23:20:54 DietPi-LocalServices systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 30 23:20:56 DietPi-LocalServices systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Mar 30 23:20:56 DietPi-LocalServices systemd[1]: Stopped Docker Application Container Engine.
Mar 30 23:20:56 DietPi-LocalServices systemd[1]: docker.service: Start request repeated too quickly.
Mar 30 23:20:56 DietPi-LocalServices systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 30 23:20:56 DietPi-LocalServices systemd[1]: Failed to start Docker Application Container Engine.
root@DietPi-LocalServices:~#

Thank you for looking into this.

Looks like there is a typo inside your daemon.json

es if possible, share the content of /etc/docker/daemon.json

{
    "data-root": "/mnt/dietpi_userdata/docker-data",
    "log-driver": "journald",
    "log-level": "warn",
    "debug": false
}
#{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}

The Daemon.json is exactly the same as the working version of docker on my system.

I did try to remove the # but it then just complained about the open bracket { instead.

I think there should be only one { and } in the whole document.
Also # is not allowed. Comments can be written with //

{
“data-root”: “/mnt/dietpi_userdata/docker-data”,
“log-driver”: “journald”,
“log-level”: “warn”,
“debug”: false
//“hosts”: [“tcp://0.0.0.0:2375”, “unix:///var/run/docker.sock”]
}

I’ll give that a go and feedback shortly!

root@DietPi-LocalServices:~# journalctl -u docker.service
-- Journal begins at Fri 2023-03-31 13:02:08 BST, ends at Fri 2023-03-31 13:02:40 BST. --
Mar 31 13:02:10 DietPi-LocalServices systemd[1]: Started Docker Application Container Engine.
Mar 31 13:02:10 DietPi-LocalServices dockerd[466]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character 'â' looking for beginning of object key string
Mar 31 13:02:10 DietPi-LocalServices systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 31 13:02:10 DietPi-LocalServices systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 31 13:02:12 DietPi-LocalServices systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.
Mar 31 13:02:12 DietPi-LocalServices systemd[1]: Stopped Docker Application Container Engine.
Mar 31 13:02:12 DietPi-LocalServices systemd[1]: Started Docker Application Container Engine.
Mar 31 13:02:12 DietPi-LocalServices dockerd[509]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character 'â' looking for beginning of object key string
Mar 31 13:02:12 DietPi-LocalServices systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 31 13:02:12 DietPi-LocalServices systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 31 13:02:15 DietPi-LocalServices systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.
Mar 31 13:02:15 DietPi-LocalServices systemd[1]: Stopped Docker Application Container Engine.
Mar 31 13:02:15 DietPi-LocalServices systemd[1]: Started Docker Application Container Engine.
Mar 31 13:02:15 DietPi-LocalServices dockerd[519]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character 'â' looking for beginning of object key string
Mar 31 13:02:15 DietPi-LocalServices systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 31 13:02:15 DietPi-LocalServices systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 31 13:02:17 DietPi-LocalServices systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Mar 31 13:02:17 DietPi-LocalServices systemd[1]: Stopped Docker Application Container Engine.
Mar 31 13:02:17 DietPi-LocalServices systemd[1]: docker.service: Start request repeated too quickly.
Mar 31 13:02:17 DietPi-LocalServices systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 31 13:02:17 DietPi-LocalServices systemd[1]: Failed to start Docker Application Container Engine.

I’m afraid it didn’t work :frowning:

You still have not valid characters in your .json file