'Docker: How to fix "Job for docker.service failed because the control process exited with error code"

I'm trying to use docker in Manjaro (my kernel version is 4.19) and it is not working.

After running sudo pamac install docker I run sudo systemctl start docker.service and receive this message:

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

So sudo systemctl status docker.service returns:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-04-29 12:28:44 -03; 39s ago
     Docs: https://docs.docker.com
  Process: 17769 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 17769 (code=exited, status=1/FAILURE)

abr 29 12:28:44 tamer-pc systemd[1]: docker.service: Service RestartSec=100ms expired, scheduling restart.
abr 29 12:28:44 tamer-pc systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
abr 29 12:28:44 tamer-pc systemd[1]: Stopped Docker Application Container Engine.
abr 29 12:28:44 tamer-pc systemd[1]: docker.service: Start request repeated too quickly.
abr 29 12:28:44 tamer-pc systemd[1]: docker.service: Failed with result 'exit-code'.
abr 29 12:28:44 tamer-pc systemd[1]: Failed to start Docker Application Container Engine.

and journalctl -xe returns:

-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
abr 29 12:28:44 tamer-pc systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: A unidade docker.service falhou
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A unidade docker.service falhou.
-- 
-- O resultado é failed.
abr 29 12:28:44 tamer-pc systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The unit docker.socket has entered the 'failed' state with result 'service-start-limit-hit'.
abr 29 12:29:02 tamer-pc dbus-daemon[650]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='>
abr 29 12:29:02 tamer-pc dbus-daemon[650]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.>
abr 29 12:29:24 tamer-pc sudo[17879]:    tamer : TTY=pts/0 ; PWD=/etc/docker ; USER=root ; COMMAND=/usr/bin/systemctl stat>
abr 29 12:29:24 tamer-pc sudo[17879]: pam_unix(sudo:session): session opened for user root by (uid=0)
abr 29 12:29:24 tamer-pc sudo[17879]: pam_unix(sudo:session): session closed for user root
lines 1703-1725/1725 (END)

I'm looking for resolution for two days but whatever I read seems not to be exactly the same as my problem.



Solution 1:[1]

I really dont know what was happening, but I run sudo dockerd --debug like Zeitounator orients me, reboot my pc and docker works perfectly.

Solution 2:[2]

I had a similar issue when setting up Kubernetes on my local machine:

The error came up when I tried setting up Docker to use the OverlayFS storage driver.

I ran the following commands:

sudo systemctl stop docker
cp -au /var/lib/docker /var/lib/docker.bk

And then when I tried to start docker again using the command below:

sudo systemctl start docker

It was throwing the error:

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

Here's how I solved it:

I ran the command below to inspect the issue following Tâmer Pinheiro answer:

sudo dockerd --debug

And it gave me this information:

INFO[2020-09-02T11:46:15.272833297Z] Starting up                                  
DEBU[2020-09-02T11:46:15.273547501Z] Listener created for HTTP on unix (/var/run/docker.sock) 
failed to start daemon: Unable to get the TempDir under /var/lib/docker: mkdir
/var/lib/docker/tmp: no space left on device

I also checked the disk space of the server:

df -h

which showed that there was no space left on the drive (/dev/sda1 filesystem):

Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           396M   12M  384M   4% /run
/dev/sda1       9.8G  9.8G     0 100% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock

tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           396M     0  396M   0% /run/user/1000

And I realized that the issue had to do with no space left on device.

I had to run the following commands to clear some space for the filesystem:

sudo find /var/log -type f -delete
sudo rm -rf /var/cache/apt/*
sudo apt clean all

And then finally, I removed the /var/lib/docker.bk file, because it was too large for the 9.8GB filesystem of the server:

sudo rm -rf /var/lib/docker.bk

This time when I ran the command:

sudo systemctl restart docker

everything worked fine.

That's all.

I hope this helps

Solution 3:[3]

I had the same problem, but I folow the advise of @Zeitounator, and I run this command sudo dockerd --debug to see the problem. It display this message :

Your Linux kernel version 2.6.32-042stab138.1 is not supported for running docker. Please upgrade your kernel to 3.10.0 or newer.

I've update my kernel and it works perfectly. I hope that help you !

Solution 4:[4]

For me,Stopping the VPN solved the problem

Solution 5:[5]

In my case it was a dangling comma in /etc/docker/daemon.json in the "dns" array/list. I simply removed the comma after the last entry and it worked.

Solution 6:[6]

Facing the same issue Three steps:

1:docker --debug to identify the issue it comes out to be network issue: Failed to program NAT chain: ZONE_CONFLICT: 'docker0' already bound to a zone

2: To resolved this Googled and found the command to run

`firewall-cmd --zone=trusted --remove-interface=docker0`

3: systemctl start docker

Solution 7:[7]

I followed various steps that lead me to this error. Then just restarted my PC and everything worked.

Solution 8:[8]

I had a missing comma in my /etc/docker/daemon.json.

Solution 9:[9]

I got an error "Job for docker.service failed because the control process exited with error code." after installing the Docker on Centos 8. What helped me is:

yum install iptables
iptables -I INPUT -p tcp -m tcp --dport 8080 -j ACCEPT

Then I run "sudo systemctl start docker" with a success.

Solution 10:[10]

I also had the issue, and the debugging command provided by @Zeitounator helped a lot but didn't resolve the issue outright.

The problem turned out to be I didn't have IPTables installed on Centos, which Docker needs. I used the following walkthrough to install, start and test them and docker started no problem afterwards.

https://linuxize.com/post/how-to-install-iptables-on-centos-7/

Solution 11:[11]

For me, updating the kernel version and rebooting solved the issue.

Solution 12:[12]

For me, updating the firewalld solved the problem (personal sandbox, so i just outright disabled the firewall entirely).

Solution 13:[13]

In my case changing the port in docker.service file works for me

file location /etc/systemd/system/multi-user.target.wants

port to change at this line ExecStart

Solution 14:[14]

I had this issue on Debian and I solved it by installing docker.io package - I previously saw in aptitude that it was recommended but not installed so I gave it a try.