0

ERROR

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code)
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 145292 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 145292 (code=exited, status=1/FAILURE)
        CPU: 148ms
dpkg: error processing package docker-ce (--configure):
 installed docker-ce package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

Output of docker version

Client: Docker Engine - Community
 Version:           23.0.3
 API version:       1.42
 Go version:        go1.19.7
 Git commit:        3e7cbfd
 Built:             Tue Apr  4 22:03:23 2023
 OS/Arch:           linux/amd64
 Context:           default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`

Output of docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.17.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info

Could anyone help me with the issue? I can not seem to find any solution on the internet. P.S. I'm not using VPN.

  • Can you check do you have `containerd` is installed? As docker is showing error while installing docker. – Dhaval Gajjar Apr 14 '23 at 18:54
  • @DhavalGajjar, the output of the **dpkg -l containerd***: `ii containerd 1.4.13~ds1-1~deb11u3 amd64 open and reliable container runtime rc containerd.io 1.6.20-1 amd64 An open and reliable container runtime` – BlackAShooter Apr 15 '23 at 12:39
  • All docker packages: `ii docker-buildx-plugin 0.10.4-1~debian.11~bullseye amd64 Docker Buildx cli plugin. rc docker-ce 5:23.0.3-1~debian.11~bullseye amd64 Docker: the open-source application container engine ii docker-ce-cli 5:23.0.3-1~debian.11~bullseye amd64 Docker CLI: the open-source application container engine ii docker-ce-rootless-extras 5:23.0.3-1~debian.11~bullseye amd64 Rootless support for Docker. ii docker-compose-plugin 2.17.2-1~debian.11~bullseye amd64 Docker Compose (V2) plugin for the Docker CLI.` – BlackAShooter Apr 15 '23 at 12:42

1 Answers1

1

I checked daemon logs with the command

journalctl -u docker

and the following error was displayed:

failed to start daemon: Error initializing network controller: 
error obtaining controller instance: 
failed to create NAT chain DOCKER: iptables failed: iptables -t

Then Switching to iptables-legacy helped:

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

Attaching the source for reference.

zforgo
  • 2,508
  • 2
  • 14
  • 22