`bundle: command not found` in systemd script - ruby-on-rails

I'm trying to run a rails server using the below systemd script:
[Unit]
Description=vue-chat-app
Requires=network.target
[Service]
Type=simple
User=ubuntu
Group=ubuntu
WorkingDirectory=/var/www/vue-chat-app.lizardgizzards.com/vue-chat-app/backend-rails/
ExecStart=/bin/bash -lc 'bundle exec rails s -e production -b 0.0.0.0 -p 3010'
TimeoutSec=60s
RestartSec=30s
Restart=always
[Install]
WantedBy=multi-user.target
This is the output I get from journalctl -xe
Sep 16 16:11:28 lab sudo[27454]: ubuntu : TTY=pts/6 ; PWD=/var/www/vue-chat-app.lizardgizzards.com/vue-chat-app/backend-rails ; USER=root ; COMMAND=/usr/bin/vi /etc/systemd/system/vue-chat-app.service
Sep 16 16:11:28 lab sudo[27454]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
Sep 16 16:11:46 lab sudo[27454]: pam_unix(sudo:session): session closed for user root
Sep 16 16:11:56 lab systemd[1]: vue-chat-app.service: Service hold-off time over, scheduling restart.
Sep 16 16:11:56 lab systemd[1]: vue-chat-app.service: Scheduled restart job, restart counter is at 69.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit vue-chat-app.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Sep 16 16:11:56 lab systemd[1]: Stopped vue-chat-app.
-- Subject: Unit vue-chat-app.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit vue-chat-app.service has finished shutting down.
Sep 16 16:11:56 lab systemd[1]: Started vue-chat-app.
-- Subject: Unit vue-chat-app.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit vue-chat-app.service has finished starting up.
--
-- The start-up result is RESULT.
Sep 16 16:11:56 lab bash[27526]: /bin/bash: bundle: command not found
Sep 16 16:11:56 lab systemd[1]: vue-chat-app.service: Main process exited, code=exited, status=127/n/a
Sep 16 16:11:56 lab systemd[1]: vue-chat-app.service: Failed with result 'exit-code'.
I can run the command /bin/bash -lc 'bundle exec rails s -e production -b 0.0.0.0 -p 3010' just fine in my terminal, as the user ubuntu, but for some reason it isn't running as a systemd script.

Related

Failed to start Docker Service because the control process exited with error code

I'm trying to install docker on my virtual machine:
Update the apt package index and install Docker
$sudo apt update
$sudo apt install docker.io -y
Add current user to the docker group:
$sudo usermod -aG docker ${USER}
$su - ${USER}
Check whether you can access and download images from Docker Hub
$docker run hello-world
When I start docker, I get this error
liaomei#liaomei-virtualbox:~$ systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
This is systemctl status docker output
liaomei#liaomei-virtualbox:~$ systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-11-08 09:15:06 +07; 3h 25min ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 26449 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, stat>
Main PID: 26449 (code=exited, status=1/FAILURE)
Thg 11 08 09:15:03 liaomei-virtualbox systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Thg 11 08 09:15:03 liaomei-virtualbox systemd[1]: docker.service: Failed with result 'exit-code'.
Thg 11 08 09:15:03 liaomei-virtualbox systemd[1]: Failed to start Docker Application Container Engine.
Thg 11 08 09:15:06 liaomei-virtualbox systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Thg 11 08 09:15:06 liaomei-virtualbox systemd[1]: Stopped Docker Application Container Engine.
Thg 11 08 09:15:06 liaomei-virtualbox systemd[1]: docker.service: Start request repeated too quickly.
Thg 11 08 09:15:06 liaomei-virtualbox systemd[1]: docker.service: Failed with result 'exit-code'.
Thg 11 08 09:15:06 liaomei-virtualbox systemd[1]: Failed to start Docker Application Container Engine.
This is journalctl -xe output
liaomei#liaomei-virtualbox:~$ journalctl -xe
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Thg 11 08 12:41:02 liaomei-virtualbox systemd[1]: Stopped Docker Application Container Engine.
-- Subject: A stop job for unit docker.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit docker.service has finished.
--
-- The job identifier is 2298 and the job result is done.
Thg 11 08 12:41:02 liaomei-virtualbox systemd[1]: docker.service: Start request repeated too quickly.
Thg 11 08 12:41:02 liaomei-virtualbox systemd[1]: docker.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
Thg 11 08 12:41:02 liaomei-virtualbox systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: A start job for unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit docker.service has finished with a failure.
--
-- The job identifier is 2298 and the job result is failed.
Thg 11 08 12:41:02 liaomei-virtualbox systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit docker.socket has entered the 'failed' state with result 'service-start-limit-hit'.
This is my machine info
liaomei#liaomei-virtualbox:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
liaomei#liaomei-virtualbox:~$ uname -r
5.15.0-rc7+
liaomei#liaomei-virtualbox:~$ hostnamectl
Static hostname: liaomei-virtualbox
Icon name: computer-vm
Chassis: vm
Machine ID: 65805268c46b491797a9463a127e30ba
Boot ID: 6d9543a77b884bea97da01da1f690e74
Virtualization: oracle
Operating System: Ubuntu 20.04.3 LTS
Kernel: Linux 5.15.0-rc7+
Architecture: x86-64
I can't find the actual error in these output. Could you tell me where the problem is and how to fix it.

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. (CKAD)

I'm following the Certified Kubernetes Application Developer (CKAD) Certification, and in their manual they are providing a bash file to deploy a master node using Kubeadm, and this is it's content :
https://gofile.io/d/d2l1UJ
But when I run this bash file using: sudo bash deploy.sh I get an error message as shown in this screenshot:
I tried to start docker using: sudo systemctl start docker but I get this error:
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
So then I run systemctl status docker.service and I get this:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-07-21 05:31:17 PDT; 1min 0s ago
Docs: https://docs.docker.com
Process: 10196 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 10196 (code=exited, status=1/FAILURE)
Jul 21 05:31:15 master systemd[1]: Failed to start Docker Application Container Engine.
Jul 21 05:31:17 master systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 21 05:31:17 master systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Jul 21 05:31:17 master systemd[1]: Stopped Docker Application Container Engine.
Jul 21 05:31:17 master systemd[1]: docker.service: Start request repeated too quickly.
Jul 21 05:31:17 master systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 21 05:31:17 master systemd[1]: Failed to start Docker Application Container Engine.
And when I run journalctl -xe:
-- Unit kubelet.service has finished starting up.
--
-- The start-up result is RESULT.
Jul 21 05:32:46 master kubelet[10531]: F0721 05:32:46.664769 10531 server.go:199] failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml",
Jul 21 05:32:46 master systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Jul 21 05:32:46 master systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 21 05:32:56 master systemd[1]: kubelet.service: Service hold-off time over, scheduling restart.
Jul 21 05:32:56 master systemd[1]: kubelet.service: Scheduled restart job, restart counter is at 189.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit kubelet.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jul 21 05:32:56 master systemd[1]: Stopped kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit kubelet.service has finished shutting down.
Jul 21 05:32:56 master systemd[1]: Started kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit kubelet.service has finished starting up.
--
-- The start-up result is RESULT.
Jul 21 05:32:56 master kubelet[10562]: F0721 05:32:56.915762 10562 server.go:199] failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml",
Jul 21 05:32:56 master systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Jul 21 05:32:56 master systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 21 05:33:07 master systemd[1]: kubelet.service: Service hold-off time over, scheduling restart.
Jul 21 05:33:07 master systemd[1]: kubelet.service: Scheduled restart job, restart counter is at 190.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit kubelet.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jul 21 05:33:07 master systemd[1]: Stopped kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit kubelet.service has finished shutting down.
Jul 21 05:33:07 master systemd[1]: Started kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit kubelet.service has finished starting up.
--
-- The start-up result is RESULT.
Jul 21 05:33:07 master kubelet[10594]: F0721 05:33:07.167571 10594 server.go:199] failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml",
Jul 21 05:33:07 master systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Jul 21 05:33:07 master systemd[1]: kubelet.service: Failed with result 'exit-code'.
#Edit:
It seems that my host configuration is fine, when I run the bash file to check for the host config before starting the CKAD course I get this:
Checking that this computer is suitable for LFD459: Kubernetes for App Developers
--------------------------------------------------------------------------------
PASS: CPU architecture is x86_64
PASS: 4 core CPU
PASS: Your CPU appears powerful enough (currently at 28800 BogoMIPS cumulatively)
PASS: 8 GiB RAM
PASS: 18 GiB free disk space in /home/student
PASS: 18544 MiB free disk space in /boot
PASS: Linux distribution architecture is x86_64
NOTE: Currently running Ubuntu 18.04.4 LTS (supported)
PASS: Internet is available (which is required in this case)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
NOTE: Verifying LFD459_V1.18.1_SOLUTIONS.tar.bz2...
LFD459_V1.18.1_SOLUTIONS.tar.bz2 can be found in /home/student/LFT (matches md5sum)
--------------------------------------------------------------------------------
PASS: You are ready for the course! W00t!
NOTE: Make sure to follow the instructions above to fix any issues found

Error installing docker on other partition

I installed Kubuntu 18 about 3 weeks ago on partition in 28G(sdb5), but after installing of docker seems this space is not enough for my root partition
I found that /var/lib/docker/ takes 11.1 GiB.
I found a decision of using sdb7 partition for docker which is not used now.
So after I formatted /sdb7 into ext4 and used /sdb7 in /etc/fstab and restarted OS I run:
cd /var/lib
sudo rsync -av docker /mnt/_work_sdb7
sudo mv docker docker.old
sudo ln -s /mnt/_work_sdb7/docker
and next :
$ docker-compose up -d --build
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
I found a way of fixing such error:
sudo usermod -aG docker $USER
sudo newgrp - docker
But it did not help. Next :
Some configation/permittions missing?
# docker-compose --version
docker-compose version 1.17.1, build unknown
# docker --version
Docker version 19.03.2, build 6a30dfc
MODIFIED :
I run command and see messages in console :
$ sudo dockerd --data-root=/mnt/_work_sdb7
INFO[2019-09-14T14:56:26.394402307+03:00] Starting up
INFO[2019-09-14T14:56:26.395196810+03:00] detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf
INFO[2019-09-14T14:56:26.444127000+03:00] parsed scheme: "unix" module=grpc
INFO[2019-09-14T14:56:26.444152461+03:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2019-09-14T14:56:26.444179994+03:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 <nil>}] } module=grpc
INFO[2019-09-14T14:56:26.444193376+03:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2019-09-14T14:56:26.444651765+03:00] pickfirstBalancer: HandleSubConnStateChange: 0xc000143020, CONNECTING module=grpc
INFO[2019-09-14T14:56:26.444710232+03:00] blockingPicker: the picked transport is not ready, loop back to repick module=grpc
INFO[2019-09-14T14:56:26.463935589+03:00] pickfirstBalancer: HandleSubConnStateChange: 0xc000143020, READY module=grpc
INFO[2019-09-14T14:56:26.503211493+03:00] parsed scheme: "unix" module=grpc
INFO[2019-09-14T14:56:26.503236499+03:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2019-09-14T14:56:26.503253831+03:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 <nil>}] } module=grpc
INFO[2019-09-14T14:56:26.503264403+03:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2019-09-14T14:56:26.503334016+03:00] pickfirstBalancer: HandleSubConnStateChange: 0xc000143420, CONNECTING module=grpc
INFO[2019-09-14T14:56:26.503354596+03:00] blockingPicker: the picked transport is not ready, loop back to repick module=grpc
INFO[2019-09-14T14:56:26.503629147+03:00] pickfirstBalancer: HandleSubConnStateChange: 0xc000143420, READY module=grpc
WARN[2019-09-14T14:56:26.584401464+03:00] Your kernel does not support swap memory limit
WARN[2019-09-14T14:56:26.584423249+03:00] Your kernel does not support cgroup rt period
WARN[2019-09-14T14:56:26.584431948+03:00] Your kernel does not support cgroup rt runtime
INFO[2019-09-14T14:56:26.584832727+03:00] Loading containers: start.
INFO[2019-09-14T14:56:26.861388365+03:00] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address
INFO[2019-09-14T14:56:27.120567034+03:00] Loading containers: done.
INFO[2019-09-14T14:56:27.294102345+03:00] Docker daemon commit=6a30dfc graphdriver(s)=overlay2 version=19.03.2
INFO[2019-09-14T14:56:27.294224407+03:00] Daemon has completed initialization
INFO[2019-09-14T14:56:27.366695106+03:00] API listen on /var/run/docker.sock
The command above did not finish and was working:
I opened console in other tab and run :
$ sudo usermod -aG docker $USER
$ sudo newgrp - docker
# cd /mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker
# sudo systemctl enable docker
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker
# sudo systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2019-09-14 15:00:34 EEST; 8s ago
Docs: https://docs.docker.com
Process: 14694 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 14694 (code=exited, status=1/FAILURE)
Sep 14 15:00:34 serge-at-hoe systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Sep 14 15:00:34 serge-at-hoe systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Sep 14 15:00:34 serge-at-hoe systemd[1]: Stopped Docker Application Container Engine.
Sep 14 15:00:34 serge-at-hoe systemd[1]: docker.service: Start request repeated too quickly.
Sep 14 15:00:34 serge-at-hoe systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 14 15:00:34 serge-at-hoe systemd[1]: Failed to start Docker Application Container Engine.
# journalctl -xe
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Sep 14 15:00:34 serge-at-hoe 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.
Sep 14 15:00:34 serge-at-hoe 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.
Sep 14 15:00:34 serge-at-hoe 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.
Sep 14 15:00:34 serge-at-hoe 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.
Sep 14 15:00:34 serge-at-hoe 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 RESULT.
Sep 14 15:00:34 serge-at-hoe systemd[1]: docker.service: Start request repeated too quickly.
Sep 14 15:00:34 serge-at-hoe systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 14 15:00:34 serge-at-hoe 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 RESULT.
Sep 14 15:00:34 serge-at-hoe systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
Sep 14 15:00:42 serge-at-hoe systemd[1]: Started Run anacron jobs.
-- Subject: Unit anacron.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit anacron.service has finished starting up.
--
-- The start-up result is RESULT.
Sep 14 15:00:42 serge-at-hoe anacron[14760]: Anacron 2.3 started on 2019-09-14
Sep 14 15:00:42 serge-at-hoe anacron[14760]: Normal exit (0 jobs run)
What is wrong ?
MODIFIED 2 :
I did not find existing file, so I created new file /etc/docker/daemon.json
with content :
{
"data-root": "/mnt/_work_sdb7/docker" ,
"storage-driver": "overlay2"
}
/etc/docker# ls -la
total 24
drwxr-xr-x 2 root root 4096 вер 14 16:52 .
drwxr-xr-x 150 root root 12288 вер 14 16:05 ..
-rwxrwxrwx 1 root root 81 вер 14 16:52 daemon.json
-rw------- 1 root root 244 вер 6 18:12 key.json
In my /etc/fstab :
/dev/sdb7 /mnt/_work_sdb7 ext4 defaults 0 0
and restarted the OS.
After that in my docker project I run :
$ sudo systemctl enable docker
[sudo] password for serge:
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker
serge#serge-at-hoe:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ sudo systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
serge#serge-at-hoe:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2019-09-14 16:54:09 EEST; 2s ago
Docs: https://docs.docker.com
Process: 5199 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 5199 (code=exited, status=1/FAILURE)
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.service: Service hold-off time over, scheduling restart.
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
вер 14 16:54:09 serge-at-hoe systemd[1]: Stopped Docker Application Container Engine.
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.service: Start request repeated too quickly.
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.service: Failed with result 'exit-code'.
вер 14 16:54:09 serge-at-hoe systemd[1]: Failed to start Docker Application Container Engine.
serge#serge-at-hoe:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ journalctl -xe
--
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
вер 14 16:54:09 serge-at-hoe 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.
вер 14 16:54:09 serge-at-hoe 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.
вер 14 16:54:09 serge-at-hoe 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.
вер 14 16:54:09 serge-at-hoe 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.
вер 14 16:54:09 serge-at-hoe 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 RESULT.
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.service: Start request repeated too quickly.
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.service: Failed with result 'exit-code'.
вер 14 16:54:09 serge-at-hoe 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 RESULT.
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
вер 14 16:54:10 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=01:00:5e:00:00:01:c8:e7:f0:6e:fc:29:08:00 SRC=100.103.0.1 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=40300 PROTO=2
вер 14 16:54:10 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=44:8a:5b:ee:2a:dd:c8:e7:f0:6e:fc:29:08:00 SRC=213.109.129.134 DST=213.109.234.130 LEN=44 TOS=0x00 PREC=0x00 TTL=250 ID=15541 DF PROTO=TCP SPT=35673 DPT=23 WINDOW=14600 R
вер 14 16:54:11 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=44:8a:5b:ee:2a:dd:c8:e7:f0:6e:fc:29:08:00 SRC=36.63.165.72 DST=213.109.234.130 LEN=52 TOS=0x00 PREC=0x00 TTL=115 ID=901 DF PROTO=TCP SPT=44000 DPT=1433 WINDOW=8192 RES=0
вер 14 16:54:12 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=01:00:5e:00:00:01:c8:e7:f0:6e:fc:29:08:00 SRC=100.103.0.1 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=48963 PROTO=2
вер 14 16:54:23 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=44:8a:5b:ee:2a:dd:c8:e7:f0:6e:fc:29:08:00 SRC=159.224.38.32 DST=213.109.234.130 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=26239 DF PROTO=TCP SPT=34959 DPT=6881 WINDOW=7300 RES
вер 14 16:54:23 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=44:8a:5b:ee:2a:dd:c8:e7:f0:6e:fc:29:08:00 SRC=185.222.211.54 DST=213.109.234.130 LEN=40 TOS=0x00 PREC=0x00 TTL=251 ID=1768 PROTO=TCP SPT=41109 DPT=8321 WINDOW=1024 RES=0
вер 14 16:54:23 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=44:8a:5b:ee:2a:dd:c8:e7:f0:6e:fc:29:08:00 SRC=87.122.153.155 DST=213.109.234.130 LEN=60 TOS=0x00 PREC=0x00 TTL=57 ID=2867 DF PROTO=TCP SPT=47437 DPT=6881 WINDOW=7300 RES
вер 14 16:54:24 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=44:8a:5b:ee:2a:dd:c8:e7:f0:6e:fc:29:08:00 SRC=159.224.38.32 DST=213.109.234.130 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=26240 DF PROTO=TCP SPT=34959 DPT=6881 WINDOW=7300 RES
вер 14 16:54:24 serge-at-hoe kernel: [UFW BLOCK] IN=enp4s0 OUT= MAC=44:8a:5b:ee:2a:dd:c8:e7:f0:6e:fc:29:08:00 SRC=87.122.153.155 DST=213.109.234.130 LEN=60 TOS=0x00 PREC=0x00 TTL=57 ID=2868 DF PROTO=TCP SPT=47437 DPT=6881 WINDOW=7300 RES
lines 2823-2877/2877 (END)
I see errors :
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.service: Start request repeated too quickly.
вер 14 16:54:09 serge-at-hoe systemd[1]: docker.service: Failed with result 'exit-code'.
вер 14 16:54:09 serge-at-hoe systemd[1]: Failed to start Docker Application Container Engine.
?
MODIFIED 3 :
I found /etc/systemd/system.conf in which all parameters were commented
I uncommented or added parameters with some values, incrementing them and restarting OS. I made so several times and at least I have :
DefaultStartLimitIntervalSec=350s
DefaultStartLimitBurst=260
StartLimitInterval=350s
StartLimitBurst=260
StartLimitIntervalSec=260
while all the rest parameters commented, But any way I see errors :
вер 14 18:05:44 serge-at-hoe systemd[1]: docker.service: Start request repeated too quickly.
вер 14 18:05:44 serge-at-hoe systemd[1]: docker.service: Failed with result 'exit-code'.
вер 14 18:05:44 serge-at-hoe systemd[1]: Failed to start Docker Application Container Engine.
Which values must have these(or some others) values ?
MODIFIED # 4 :
I tried in /etc/systemd/system.conf to change some values to zero, as I googled such possible decision:
DefaultStartLimitIntervalSec=0
DefaultStartLimitBurst=260
StartLimitInterval=350
StartLimitBurst=260
StartLimitIntervalSec=0
But restarting OS I failed to login into the system and has a lot of flash messages on the screen.
I modified the file with all 0 :
DefaultStartLimitIntervalSec=0
DefaultStartLimitBurst=0
StartLimitInterval=0
StartLimitBurst=0
StartLimitIntervalSec=0
I reloaded ok but running docker I still have "Start request repeated too quickly" errors:
$ sudo usermod -aG docker $USER
#:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ sudo newgrp - docker
#:/root# cd /mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker
#:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker# sudo systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
#:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker# sudo systemctl enable docker
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker
#:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker# sudo systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
#:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-09-16 14:30:07 EEST; 298ms ago
Docs: https://docs.docker.com
Process: 5183 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 5183 (code=exited, status=1/FAILURE)
Sep 16 14:30:07 s systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Sep 16 14:30:07 s systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Sep 16 14:30:07 s systemd[1]: Stopped Docker Application Container Engine.
Sep 16 14:30:07 s systemd[1]: docker.service: Start request repeated too quickly.
Sep 16 14:30:07 s systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 16 14:30:07 s systemd[1]: Failed to start Docker Application Container Engine.
#:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker# journalctl -xe
-- Support: http://www.ubuntu.com/support
--
-- Unit snapd.service has finished shutting down.
Sep 16 14:30:15 s systemd[1]: Starting Snappy daemon...
-- Subject: Unit snapd.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snapd.service has begun starting up.
Sep 16 14:30:15 s snapd[6435]: AppArmor status: apparmor is enabled and all features are available
Sep 16 14:30:15 s snapd[6435]: cannot run daemon: assert storage root unexpectedly world-writable: /var/lib/snapd/assertions/asserts-v0
Sep 16 14:30:15 s systemd[1]: snapd.service: Main process exited, code=exited, status=1/FAILURE
Sep 16 14:30:15 s systemd[1]: snapd.service: Failed with result 'exit-code'.
Sep 16 14:30:15 s systemd[1]: Failed to start Snappy daemon.
-- Subject: Unit snapd.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snapd.service has failed.
--
-- The result is RESULT.
Sep 16 14:30:15 s systemd[1]: snapd.service: Triggering OnFailure= dependencies.
Sep 16 14:30:15 s systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Sep 16 14:30:15 s systemd[1]: snapd.service: Scheduled restart job, restart counter is at 25663.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit snapd.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Sep 16 14:30:15 s systemd[1]: Stopped Snappy daemon.
-- Subject: Unit snapd.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snapd.service has finished shutting down.
Sep 16 14:30:15 s systemd[1]: Starting Snappy daemon...
-- Subject: Unit snapd.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snapd.service has begun starting up.
Sep 16 14:30:15 s snapd[6467]: AppArmor status: apparmor is enabled and all features are available
Sep 16 14:30:15 s snapd[6467]: cannot run daemon: assert storage root unexpectedly world-writable: /var/lib/snapd/assertions/asserts-v0
Sep 16 14:30:15 s systemd[1]: snapd.service: Main process exited, code=exited, status=1/FAILURE
Sep 16 14:30:15 s systemd[1]: snapd.service: Failed with result 'exit-code'.
Sep 16 14:30:15 s systemd[1]: Failed to start Snappy daemon.
-- Subject: Unit snapd.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snapd.service has failed.
--
-- The result is RESULT.
Sep 16 14:30:15 s systemd[1]: snapd.service: Triggering OnFailure= dependencies.
I am not sure if that valid options in /etc/systemd/system.conf or some other issue?
Did you typed:
sudo systemctl start docker
sudo systemctl enable docker
?
The way you are trying to install docker on another partition is not correct.
You need a partition (sdb7 in your case). Suppose its mounted at /mnt/sdb7
Docker by default store all its data (containers, images and so on) in /var/lib/docker you need to change this in your case to something like /mnt/sdb7/docker using data-root option of docker.
While starting docker deamon use --data-root option.
dockerd --data-root=/mnt/sdb7/docker
Hope this helps.
Update:
The dockerd command will run in foreground.
You need to set --data-root option permanently for docker.service that you start/stop using systemctl.
To set that option permanently refer this.
You need to add this line "data-root": "/mnt/docker-data" in /etc/docker/daemon.json file.
Update-2:
docker.socket: Failed with result 'service-start-limit-hit' means docker.service seems to fail and restart to fast. The is explained here.
You need to edit systemd file for docker using systemctl edit docker.service as mentioned here and tweak the values of StartLimitIntervalSec= and StartLimitBurst= as mentioned here so that the docker.service will not fail to quickly.
Update-3:
Editing /etc/systemd/system.conf file is dangerous it might cause serious problem with your VM. What I suggested was to change make change using systemctl edit docker.service.
The docker.service systemd file contents should be similar to this.
Also refer this.

docker can't launch

I want to install docker-ce,but it cannot launch
I install docker-ce in this way:
sudo yum install docker-ce
My system type:
Linux version 3.10.107-1-tlinux2_kvm_guest-0046 (root#TENCENT64.site) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Wed Dec 27 10:57:04 CST 2017
docker version:
docker version
Client:
Version: 18.09.7
API version: 1.39
Go version: go1.10.8
Git commit: 2d0083d
Built: Thu Jun 27 17:56:06 2019
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
error info detail:
systemctl status docker.service
* docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/docker.service.d
`-override.conf
Active: failed (Result: start-limit) since Wed 2019-07-31 10:12:15 CST; 921ms ago
Docs: https://docs.docker.com
Process: 15961 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 15961 (code=exited, status=1/FAILURE)
Jul 31 10:12:13 TENCENT64.site systemd[1]: Failed to start Docker Application Container Engine.
Jul 31 10:12:13 TENCENT64.site systemd[1]: Unit docker.service entered failed state.
Jul 31 10:12:13 TENCENT64.site systemd[1]: docker.service failed.
Jul 31 10:12:15 TENCENT64.site systemd[1]: docker.service holdoff time over, scheduling restart.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Stopped Docker Application Container Engine.
Jul 31 10:12:15 TENCENT64.site systemd[1]: start request repeated too quickly for docker.service
Jul 31 10:12:15 TENCENT64.site systemd[1]: Failed to start Docker Application Container Engine.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Unit docker.service entered failed state.
Jul 31 10:12:15 TENCENT64.site systemd[1]: docker.service failed.
journalctl -xe
Jul 31 10:12:13 TENCENT64.site systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jul 31 10:12:13 TENCENT64.site systemd[1]: Unit docker.service entered failed state.
Jul 31 10:12:13 TENCENT64.site systemd[1]: docker.service failed.
Jul 31 10:12:15 TENCENT64.site systemd[1]: docker.service holdoff time over, scheduling restart.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has finished shutting down.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has finished shutting down.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has begun shutting down.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has begun starting up.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has finished starting up.
--
-- The start-up result is done.
Jul 31 10:12:15 TENCENT64.site systemd[1]: start request repeated too quickly for docker.service
Jul 31 10:12:15 TENCENT64.site systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Unit docker.service entered failed state.
Jul 31 10:12:15 TENCENT64.site systemd[1]: docker.service failed.
my daemon.json(/etc/docker/daemon.json)is not exist, when i create a daemon.json with its content '{}',also error
I have tried some ways:
clear /var/lib/docker
reinstall docker-ce
docker's old version docker and docker-io is normal,but it no ip and port mapping, so i use docker-ce now.
how to fix this question?
Docker can be started with two different methods :
Via systemctl, which is the recommanded way
Directly via the docker daemon bin : dockerd which is not the recommanded way
However, when you start the docker daemon directly (ie not with systemctl), systemctl has no way to know the current status of the daemon.
So my guess is that, after the install, the docker daemon was somehow partially started and failed.
To check if that's the case, just run :
sudo ps -aux | grep dockerd
Then kill all the process attached to the docker daemon.
When it is done, you should be able to start docker directly via systemctl.

Job for docker.service failed because the control process exited with error code

So I installed docker engine on RHEL 7
Now when I do a
service docker start
I get the following error:
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
and when I go to "systemctl status docker.service" and "journalctl -xe"
I get:
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/docker.service.d
└─docker.conf
Active: failed (Result: exit-code) since Thu 2016-09-08 22:15:53 EDT; 10s ago
Docs: https://docs.docker.com
Process: 13504 ExecStart=/usr/bin/docker daemon -H fd:// --mtu 1400 --exec-opt native.cgroupdriver=systemd (code=exited, status=1/FAILURE)
Main PID: 13504 (code=exited, status=1/FAILURE)
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: Starting Docker Application Container Engine...
Sep 08 22:15:53 app-linux2.app-netapp.lab.com docker[13504]: time="2016-09-08T22:15:53.227074798-04:00" level=fatal msg="no sockets found via socket activation: make sure the service ...by systemd"
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: Failed to start Docker Application Container Engine.
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: Unit docker.service entered failed state.
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: docker.service failed.
And
--
-- The start-up result is done.
Sep 08 22:10:01 app-linux2.app-netapp.lab.com CROND[12753]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Sep 08 22:10:01 app-linux2.app-netapp.lab.com systemd[1]: Starting Session 58 of user root.
-- Subject: Unit session-58.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-58.scope has begun starting up.
Sep 08 22:10:53 app-linux2.app-netapp.lab.com polkitd[766]: Registered Authentication Agent for unix-process:12878:2674931 (system bus name :1.173 [/usr/bin/pkttyagent --notify-fd 5 --fallback], ob
Sep 08 22:10:53 app-linux2.app-netapp.lab.com systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has begun starting up.
Sep 08 22:10:53 app-linux2.app-netapp.lab.com docker[12895]: time="2016-09-08T22:10:53.413304246-04:00" level=fatal msg="no sockets found via socket activation: make sure the service was started by
Sep 08 22:10:53 app-linux2.app-netapp.lab.com systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Sep 08 22:10:53 app-linux2.app-netapp.lab.com systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Sep 08 22:10:53 app-linux2.app-netapp.lab.com systemd[1]: Unit docker.service entered failed state.
Sep 08 22:10:53 app-linux2.app-netapp.lab.com systemd[1]: docker.service failed.
Sep 08 22:10:53 app-linux2.app-netapp.lab.com polkitd[766]: Unregistered Authentication Agent for unix-process:12878:2674931 (system bus name :1.173, object path /org/freedesktop/PolicyKit1/Authent
Sep 08 22:13:36 app-linux2.app-netapp.lab.com polkitd[766]: Registered Authentication Agent for unix-process:13214:2691210 (system bus name :1.174 [/usr/bin/pkttyagent --notify-fd 5 --fallback], ob
Sep 08 22:13:36 app-linux2.app-netapp.lab.com polkitd[766]: Unregistered Authentication Agent for unix-process:13214:2691210 (system bus name :1.174, object path /org/freedesktop/PolicyKit1/Authent
Sep 08 22:15:53 app-linux2.app-netapp.lab.com polkitd[766]: Registered Authentication Agent for unix-process:13489:2704913 (system bus name :1.175 [/usr/bin/pkttyagent --notify-fd 5 --fallback], ob
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has begun starting up.
Sep 08 22:15:53 app-linux2.app-netapp.lab.com docker[13504]: time="2016-09-08T22:15:53.227074798-04:00" level=fatal msg="no sockets found via socket activation: make sure the service was started by
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: Unit docker.service entered failed state.
Sep 08 22:15:53 app-linux2.app-netapp.lab.com systemd[1]: docker.service failed.
Sep 08 22:15:53 app-linux2.app-netapp.lab.com polkitd[766]: Unregistered Authentication Agent for unix-process:13489:2704913 (system bus name :1.175, object path /org/freedesktop/PolicyKit1/Authent
lines 3473-3523/3523 (END)
I tried to search solution for this
but could not find any.
Just Remove Docker Lib and restart it again with:
sudo rm -rf /var/lib/docker
then
sudo systemctl enable docker
sudo systemctl start docker
Check your OS logs files for warning or error messages.
Probably you have made a mistake in the config files of docker and when the service starts it gets an error.
The log's location depends on your OS.
On Linux system logs are often in:
/var/log/daemon.log
/var/log/docker
/var/log/messages
/var/log/syslog
/var/log/upstart/docker.log
Some useful linux console commands to inspect docker logs:
sudo systemctl status docker.service
sudo journalctl -fu docker.service
cat /var/log/daemon.log | grep docker
cat /var/log/messages | grep docker
If you are using Windows this article might be helpful
Here are more details
What version of Docker do you use? If you are not locked to the elder one, consider use of the most recent version (currently it's 1.12). Here's my startup options (Debian 8, /etc/systemd/system/docker.service):
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
[Service]
Type=notify
ExecStart=/usr/bin/docker daemon -H fd:// --dns=10.240.116.7 --dns 8.8.8.8 --bip=172.17.42.1/24
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
Also try to start Docker in debug mode (-D) without systemd, just like if it was a common program. This will help to find out why daemon doesn't start.
Fixing the Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. problem, for me this worked:
create daemon.json in /etc/docker/
put this in it:
{
"exec-root": "/path/to/docker/run",
"storage-driver": "overlay",
"graph": "/path/to/docker/lib"
}
then try: docker daemon
reboot
docker run hello-world should succeed now
There are many reasons for docker service failing to run. One of them that I encountered is using single quotes instead of double quotes for the key value pairs in the json file.
It fails
sudo cat > /etc/docker/daemon.json << '_EOF'
{
'registry-mirrors': ['https://docker.io']
}
_EOF
It works!
sudo cat > /etc/docker/daemon.json << '_EOF'
{
"registry-mirrors": ["https://docker.io"]
}
_EOF
For more info see here
I came across same issue in my Linux VM(virtual machine).
System details : ubuntu 18.04
I had to just delete my daemon.json and then do a service docker start this worked for me.
Note: I had put insecure registry in my daemon.json file and i didn't want that as well hence i deleted it. I don't know it's usage though.

Resources