moby: docker.service Failed with result 'start-limit-hit'.
Provisioning a new node with docker-machine on Digital Ocean.
New node created OK Docker installed OK Starting Docker FAILED.
Docker-machine error output:
Error creating machine: Error running provisioning: ssh command error:
command : sudo systemctl -f start docker
err : exit status 1
output : Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
Docker-machine v 0.10.0, build 76ed2a6
Docker installed on the node version Docker version 17.06.0-ce, build 02c1d87
systemctl status docker.service log
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─10-machine.conf
Active: failed (Result: start-limit-hit) since Mon 2017-07-03 17:48:03 UTC; 3min 38s ago
Docs: https://docs.docker.com
Process: 5803 ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/dock
Main PID: 5803 (code=exited, status=1/FAILURE)
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Failed to start Docker Application Container Engine.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Unit entered failed state.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Stopped Docker Application Container Engine.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Start request repeated too quickly.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Failed to start Docker Application Container Engine.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Unit entered failed state.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Failed with result 'start-limit-hit'.
journalctl -xe log
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.service has finished shutting down.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has finished shutting down.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has begun shutting down.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has begun starting up.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has finished starting up.
--
-- The start-up result is done.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Start request repeated too quickly.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.socket: Unit entered failed state.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Unit entered failed state.
Jul 03 17:48:03 swarm-node-demo-16 systemd[1]: docker.service: Failed with result 'start-limit-hit'.
I have previously installed v17.03.0-ce v17.03.1-ce v17.04.0-ce v17.05.0-ce using the same method. This is the first time I install 17.06.0-ce, and first time encounter this issue.
Installation script
docker-machine create --driver digitalocean \
--digitalocean-image ubuntu-16-10-x64 \
--digitalocean-region nyc1 \
--digitalocean-size 4gb \
--digitalocean-access-token $DOTOKEN $NODE_NAME
UPDATE: July 3, 2017 Downgrading to 17.05.0~ce-0~ubuntu-yakkety allows me to restart docker.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 19
- Comments: 61 (19 by maintainers)
I had the same error message once because of an empty
/etc/docker/daemon.json
file. Delete it if you don’t use it!On systemd systems, it’s bad practice to modify directly the service file As reported in control-where-the-docker-daemon-listens-for-connections:
Solution:
sudo systemctl edit docker.service
This will automatically create a file
/etc/systemd/system/docker.service.d/override.conf
then reload and restart docker:
I got this error with a
/etc/docker/daemon.json
file that seemed to have a hard-coded local network IP. When the laptop was connected to a different network, docker failed to start. Removing this file solved the problem.Closing, because this is an issue with docker machine, not docker itself, and should be resolved. Feel free to continue the conversation after I closed
@thaJeztah thx a lot. Success. Drop-in file (/etc/systemd/system/docker.service.d/docker.conf) should have
ExecStart=/usr/bin/dockerd ......
as command, notExecStart=/usr/bin/docker daemon ......
have the same issue after upgrade systemd from 219-30 to systemd-219-67.el7_7.1.x86_64(reboot machine). the docker start error log:
systemctl status docker
docker version: 18.06.0-ce
after comment the value in /usr/lib/systemd/system/docker.service ,the docker can start success. why? #LimitNOFILE=infinity #LimitNPROC=infinity #LimitCORE=infinity
FYI, after upgrading packages on one of our Ubuntu16.04 nodes, we also experienced this behavior … our ExecStart command within /lib/systemd/system/docker.service looked like this:
but Docker refused to start, throwing this error:
Found removing the -H fd:// parameter allowed Docker to start …
@AmplifyDamage check your systemd unit-file; it should have
ExecStart=/usr/bin/dockerd ......
as command, notExecStart=/usr/bin/docker daemon ......
@debragail Likely fixing your systemd service config, but check the logs to see whats up… e.g.
journalctl -fu docker
I apologize, it was my fault. I made a typo You’re correct . The issue is with docker-machine, it uploads 10-machine.conf to
/etc/systemd/system/docker.service.d
and inside it the line is
ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 ...
and it should be
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 ...
@thaJeztah should this issue be referenced on docker-machine forums? What’s the best way to communicate here?
I had the same error because of conflict between
/etc/docker/daemon.json
and/etc/systemd/system/docker.service.d/options.conf
removing the option in one of the files fixed the problem
@AmplifyDamage what error message do you get? If you get the same error message, be sure to check you don’t have a drop-in / override file somewhere
I had extra comma at the end of json, causing problem. Its working now.
Be really really careful when using
-H tcp://0.0.0.0:2375
. That configuration exposes the docker remote API on the public interface of your host, and without access control / not secured with TLS. If the machine you’re running on is accessible from the internet, that port gives unrestrictedroot
access on your host. See Docker daemon attack surface in the documentation.Thanks this helped . i was struggling since 2 days. actually i was trying test connection in jenkins but was giving error
Connection refused: /IP:2375 java.net.ConnectException: Connection refused Caused: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /IP:2375 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:714) at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:352)
i changed from ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
to ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock then sudo systemctl daemon-reload sudo systemctl restart docker
Incase anybody faces same issues . this might help
Solved. This problem came out after I modified daemon.json. I just removed daemon.json and reboot machine, then docker auto started.
Same issue as https://github.com/moby/moby/issues/33931#issuecomment-439934007 and same fix (removing -H fd:// ). I’m on Ubuntu 16.04 and edit /etc/systemd/system/docker.service.d/docker.service.conf from
ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS
toExecStart=/usr/bin/dockerd $DOCKER_OPTS
@thaJeztah I updated my docker-machine as recommended, and I still have this issue. My server is new without prior usage.
lsb_release -a
Is it possible docker installation is wrong for Ubuntu?
Update confirmed /etc/systemd/system/docker.service.d/docker.conf contains
ExecStart=/usr/bin/docker daemon
and notExecStart=/usr/bin/dockerd
. Why is it the case for a fresh installation?