moby: Docker does not start

Description I installed the docker, and it was running perfectly, but one day I started getting the error after starting the docker. I uninstalled the docker deleted its conf file and still the issue persists.

After running

systemctl restart docker

I started getting Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.

and the output of

systemctl status docker.service 

● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: inactive (dead) (Result: exit-code) since Fri 2017-07-14 05:35:02 IST; 5min ago Docs: https://docs.docker.com Process: 15149 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE) Main PID: 15149 (code=exited, status=1/FAILURE)

Jul 14 05:35:02 iblldevrahulb systemd[1]: Failed to start Docker Application Container Engine. Jul 14 05:35:02 iblldevrahulb systemd[1]: docker.service: Unit entered failed state. Jul 14 05:35:02 iblldevrahulb systemd[1]: docker.service: Failed with result ‘exit-code’. Jul 14 05:35:02 iblldevrahulb systemd[1]: docker.service: Service hold-off time over, scheduling restart. Jul 14 05:35:02 iblldevrahulb systemd[1]: Stopped Docker Application Container Engine. Jul 14 05:35:02 iblldevrahulb systemd[1]: docker.service: Start request repeated too quickly. Jul 14 05:35:02 iblldevrahulb systemd[1]: Failed to start Docker Application Container Engine. docker

Results expected: Docker Startup

Results got: Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details

Output of docker version:

 Docker version 17.06.0-ce, build 02c1d87

Output of docker info:

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

** Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS Release: 16.04 Codename: xenial **

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 7
  • Comments: 35 (8 by maintainers)

Most upvoted comments

You can see if you have this issue by checking if the running kernel version reported by uname -r does not match the installed version reported by pacman -Q linux. Issues relating to a kernel version mismatch can often be solved by installing the old kernel from pacman’s cache (pacman -U /var/cache/pacman/pkg/linux-VERSION-x86_64.pkg.tar.xz). You might need to restart the misbehaving program (in this case, the Docker daemon). If that does not work, install the new kernel again and reboot.

My advice is to always reboot when you have updated the kernel. If you can not reboot, do not update the kernel. If you do not reboot, your flash drives or other USB-connected external storage devices will not work, and other things will mysteriously stop working (for example, a while ago, it caused a graphics driver issue and I could not start my OpenGL program).

@yonathanF I hope that helps!

Ok… Finally.

Its the same issue as @r-a-x I use daemon.json to open up for secure remote access. But when docker-ce is installed it will by default have ExecStart=/usr/bin/dockerd -H fd:// in /lib/systemd/system/docker.service.

If I change that to ExecStart=/usr/bin/dockerd then it starts again.

The output from journalctl -fu docker when the error occurs is this:

-- Logs begin at Thu 2017-10-05 15:43:10 CEST. --
Oct 05 15:49:30 engine1 systemd[1]: Starting Docker Application Container Engine...
Oct 05 15:49:30 engine1 dockerd[2067]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: hosts: (from flag: [fd://], from file: [fd:// tcp://0.0.0.0:2376])
Oct 05 15:49:30 engine1 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Oct 05 15:49:30 engine1 systemd[1]: Failed to start Docker Application Container Engine.
Oct 05 15:49:30 engine1 systemd[1]: docker.service: Unit entered failed state.
Oct 05 15:49:30 engine1 systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 05 15:49:30 engine1 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Oct 05 15:49:30 engine1 systemd[1]: Stopped Docker Application Container Engine.
Oct 05 15:49:30 engine1 systemd[1]: docker.service: Start request repeated too quickly.
Oct 05 15:49:30 engine1 systemd[1]: Failed to start Docker Application Container Engine.

That the double config prevents the daemon from starting I think must be something new between 17.05 and 17.09. I did not have the issue when on 17.05 with the same config. I still had the warning as I recall, but it started anyway.

I have the same problem. And /etc/docker/daemon.json existed. delete it , and systemctl start docker.service works.

Having this issue too! To those stumbling upon this, try to start Docker directly like so:

sudo /usr/bin/dockerd

It should show you a bit more information on why it may be failing.

I removed /etc/docker/daemon.json then it works again ! sudo rm /etc/docker/daemon.json

I had this issue, it was a typo in my /etc/docker/daemon.json file

Thanks for the help! Learned “reboot after a kernel update” the hard way. Rebooting fixed the issue.

Ran into this with Ubuntu 18. As mentioned, the conflict between the ExecStart line in /lib/systemd/system/docker.service and my daemon.json for “hosts” was the issue. In Ubuntu 18, docker.service has unix:// and in my daemon.json I had fd:// and a tcp socket. Changing my config from fd:// to unix:// allowed docker to start.

I had this problem on Arch when the installed Linux version did not match the running Linux version (a frequent source of issues)

I found that there are two ways to have config files in docker files, and I was using both at the same time. so If you use only one way to configure docker it should work. I will update more details soon.

Had the same problem, but I solved it by: sudo rm -rf /var/run/docker.pid

@thaJeztah I agree that it was a config issue, but is there a reason that the default installation on ubuntu has a flag for listening on fd:// instead of using daemon.json? I think it would less confusing for those who want to have secure remote access.

Right now, in order to enable secure remote access, one have to edit both /etc/docker/daemon.json and /lib/systemd/system/docker.service as I understand it.

Please provide the docker logs journalctl -fu docker

@karl-gustav I’d strongly discourage giving “world” permissions to the docker socket; anyone that has access to that socket effectively has full root access on the host; in your case; every user will get root access; see “docker daemon attack surface” in the docs https://docs.docker.com/engine/security/security/

You can see if you have this issue by checking if the running kernel version reported by uname -r does not match the installed version reported by pacman -Q linux. Issues relating to a kernel version mismatch can often be solved by installing the old kernel from pacman’s cache (pacman -U /var/cache/pacman/pkg/linux-VERSION-x86_64.pkg.tar.xz). You might need to restart the misbehaving program (in this case, the Docker daemon). If that does not work, install the new kernel again and reboot.

My advice is to always reboot when you have updated the kernel. If you can not reboot, do not update the kernel. If you do not reboot, your flash drives or other USB-connected external storage devices will not work, and other things will mysteriously stop working (for example, a while ago, it caused a graphics driver issue and I could not start my OpenGL program).

@yonathanF I hope that helps!

That worked on Manjaro Linux 18/Arch.

The only thing is , I had to go to the Manjaro Settings Manager and actually Remove all other kernels, leaving just the one reported by uname -r.

Thanks a lot !

Hi guys, I had same problem finally executed /usr/bin/dockerd to start docker daemon manually , it failed and at the end of log there was this message : “Your Linux kernel version 2.6.32-042stab130.1 is not supported for running docker. Please upgrade your kernel to 3.10.0 or newer” if you see something like this , just upgrade to newer kernel and it will be solved.

Please do not post a “me too” unless you can post logs from journalctl: journalctl -fu docker