Docker is not able to start containers anymore because docker-containerd-shim executable was no found in $PATH.
The thing is that docker-containerd-shim executable is not found anywhere on the machine while there is another executable with almost the same name: "containerd-shim" under /usr/bin directory.
I restarted the service and everything is back to normal. Does creating symbolic link "docker-containerd-shim" ---> "container-shim" could solve the problem?
Docker version: 18.09.7
OS: Ubuntu 16.04 LTS
We had a similar error in our Jenkins pipeline.
Reinstalling docker with a stable channel fixed it.
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
(https://docs.docker.com/install/linux/docker-ce/ubuntu/)
So we assume it's a nightly / test build problem.
(don't remember which channel we had before)
This happened to me on an Google Compute Engine. The VM runs an gitlab-runner for CI purpose.
It seems like the nigly upgrade, which is enabled for this image ubuntu-1804-bionic-v20180723 caused a restart which lead to this misbehaviour.
[...]
Jul 9 06:30:59 gitlab-runner systemd[1]: Starting Daily apt upgrade and clean activities...
Jul 9 06:31:22 gitlab-runner systemd[1]: Reloading.
Jul 9 06:31:23 gitlab-runner systemd[1]: Stopping LSB: automatic crash report generation...
Jul 9 06:31:23 gitlab-runner apport[21840]: * Stopping automatic crash report generation: apport
Jul 9 06:31:23 gitlab-runner apport[21840]: ...done.
Jul 9 06:31:23 gitlab-runner systemd[1]: Stopped LSB: automatic crash report generation.
Jul 9 06:31:23 gitlab-runner systemd[1]: Reloading.
Jul 9 06:31:24 gitlab-runner systemd[1]: message repeated 5 times: [ Reloading.]
Jul 9 06:31:25 gitlab-runner systemd[1]: Starting LSB: automatic crash report generation...
Jul 9 06:31:25 gitlab-runner apport[22110]: * Starting automatic crash report generation: apport
Jul 9 06:31:25 gitlab-runner apport[22110]: ...done.
Jul 9 06:31:25 gitlab-runner systemd[1]: Started LSB: automatic crash report generation.
Jul 9 06:31:32 gitlab-runner systemd[1]: Reloading.
Jul 9 06:31:33 gitlab-runner systemd[1]: docker.service: Current command vanished from the unit file, execution of the command list won't be resumed.
Jul 9 06:31:36 gitlab-runner systemd[1]: Reloading.
Jul 9 06:31:36 gitlab-runner systemd[1]: Reloading.
Jul 9 06:31:36 gitlab-runner systemd[1]: Starting containerd container runtime...
Jul 9 06:31:36 gitlab-runner systemd[1]: Started containerd container runtime.
Jul 9 06:31:36 gitlab-runner systemd[1]: Reloading.
[...]
Indeed, rebooting fixed this issue.
Related
Following this page, I have moved the docker data directory and created a symbolic link to it. It works. But everytime after rebooting my computer, the Docker service doesn't start automatically any more. How can I solve this problem?
journalctl -u docker.service returns:
Jun 30 10:29:55 ubuntu systemd[1]: Starting Docker Application Container Engine...
Jun 30 10:29:55 ubuntu dockerd[2358]: time="2022-06-30T10:29:55.426467188+10:00" level=info msg="S>
Jun 30 10:29:55 ubuntu dockerd[2358]: mkdir /var/lib/docker: file exists
Jun 30 10:29:55 ubuntu systemd[1]: docker.service: Main process exited, code=exited, status=1/FAIL>
Jun 30 10:29:55 ubuntu systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 30 10:29:55 ubuntu systemd[1]: Failed to start Docker Application Container Engine.
Jun 30 10:29:57 ubuntu systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Jun 30 10:29:57 ubuntu systemd[1]: Stopped Docker Application Container Engine.
Jun 30 10:29:57 ubuntu systemd[1]: docker.service: Start request repeated too quickly.
Jun 30 10:29:57 ubuntu systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 30 10:29:57 ubuntu systemd[1]: Failed to start Docker Application Container Engine.
Before moving the data directory "/var/lib/docker", it was a directory used by Docker, now it is a symbolic link that points to the external directory where the docker image data is stored. Why there is a mkdir command?
If I run dockerd, it returns:
INFO[2022-06-30T20:53:05.143671302+10:00] Starting up
dockerd needs to be started with root privileges. To run dockerd in rootless mode as an unprivileged user, see https://docs.docker.com/go/rootless/
If I run sudo service docker start, docker can start without error. But I don't want to run this everyday. Docker used to start automatically. Any ideas?
I was able to reproduce the error message with the same configuration:
systemd[1]: Starting Docker Application Container Engine...
dockerd[47623]: time="2022-06-30T16:36:20.047741616Z" level=in..
dockerd[47623]: mkdir /data/docker: file exists
systemd[1]: docker.service: Main process exited, code=exited, ..
The reason was that my external drive wasn't mounted yet.
Adding systemd mount/automount units resolve the issue. Or you can add your external drive to your /etc/fstab (Add nofail for avoid the 90 seconds wait when you don't have it with you).
Also from Docker doc:
You can configure the Docker daemon to use a different directory, using the data-root configuration option.
So editing your /etc/docker/daemon.json with:
{
"data-root": "/data/docker"
}
is probably better than using symlinks.
Following error message appears when doing the steps below
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2017-08-30 09:21:52 CEST; 13s ago
Docs: https://docs.docker.com
Process: 11581 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 11581 (code=exited, status=1/FAILURE)
CPU: 28ms
Aug 30 09:21:52 debian systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 30 09:21:52 debian systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Aug 30 09:21:52 debian systemd[1]: Stopped Docker Application Container Engine.
Aug 30 09:21:52 debian systemd[1]: docker.service: Start request repeated too quickly.
Aug 30 09:21:52 debian systemd[1]: Failed to start Docker Application Container Engine.
Aug 30 09:21:52 debian systemd[1]: docker.service: Unit entered failed state.
Aug 30 09:21:52 debian systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 30 09:22:00 debian systemd[1]: docker.service: Start request repeated too quickly.
Aug 30 09:22:00 debian systemd[1]: Failed to start Docker Application Container Engine.
Aug 30 09:22:00 debian systemd[1]: docker.service: Failed with result 'exit-code'.
I created a fresh Ubuntu 64bit VM on VirtualBox.
Then I used the install script to install docker: https://get.docker.com/
After the installation went successful I tried to configure the daemon to 10.0.2.15:2375 so I can forward it to my Host OS
I ran nano /etc/docker/daemon.json to create the file
I pasted following example into it
{
"debug": true,
"tls": false,
"tlscert": "/var/docker/server.pem",
"tlskey": "/var/docker/serverkey.pem",
"hosts": ["tcp://10.0.2.15:2375"]
}
then I ran service docker restart
running service docker status shows me the message above
Check the docker version of your machine by
docker --version
I was facing the same issue, and it got solved after upgrading the docker to latest version which is available.
Even the documentation available on docker's official website have not mentioned anything like that.
Once you upgrade docker , Restart the docker by
systemctl restart docker
The error will be gone, and new changes will start reflecting
when i am trying to start my newly installed jenkins by
sudo systemctl start jenkins.service
It's giving me this error :
[root#no52 ~]# sudo service jenkins start
Starting jenkins (via systemctl): Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[FAILED]
[root#no52 ~]# systemctl status jenkins.service
● jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-06-15 16:05:14 UTC; 25s ago
Docs: man:systemd-sysv-generator(8)
Process: 8226 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)
Jun 15 16:05:14 no1010042210152.corp.adobe.com jenkins[8226]: at com.sun.akuma.JavaVMArguments.current(JavaVMArguments.java:92)
Jun 15 16:05:14 no1010042210152.corp.adobe.com jenkins[8226]: at com.sun.akuma.Daemon.daemonize(Daemon.java:106)
Jun 15 16:05:14 no1010042210152.corp.adobe.com jenkins[8226]: at com.sun.akuma.Daemon.all(Daemon.java:88)
Jun 15 16:05:14 no1010042210152.corp.adobe.com jenkins[8226]: ... 6 more
Jun 15 16:05:14 no1010042210152.corp.adobe.com runuser[8227]: pam_unix(runuser:session): session closed for user jenkins
Jun 15 16:05:14 no1010042210152.corp.adobe.com jenkins[8226]: [FAILED]
Jun 15 16:05:14 no1010042210152.corp.adobe.com systemd[1]: jenkins.service: control process exited, code=exited status=1
Jun 15 16:05:14 no1010042210152.corp.adobe.com systemd[1]: Failed to start LSB: Jenkins Automation Server.
Jun 15 16:05:14 no1010042210152.corp.adobe.com systemd[1]: Unit jenkins.service entered failed state.
Jun 15 16:05:14 no1010042210152.corp.adobe.com systemd[1]: jenkins.service failed
Can someone please help me with it ?
PS : I do have Java installed
java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)
This error usually shows, when you don't have Java on your machine. Jenkins relay on Java.
Follow these steps to fix the issue:
sudo yum install java-1.8.0-openjdk
systemctl enable jenkins
systemctl start jenkins
systemctl status jenkins
Hopefully it will help.
I have installed and configured jenkins on the centos 7.I have added valid java path i.e "/usr/bin/java" in the file /etc/init.d/jenkins.
Below are the java path detils:
lrwxrwxrwx. 1 root root 22 Dec 24 2015 java -> /etc/alternatives/java
Now, on running "service jenkins start" command from root user, I am getting below error.
● jenkins.service - LSB: Jenkins Continuous Integration Server
Loaded: loaded (/etc/rc.d/init.d/jenkins)
Active: failed (Result: exit-code) since Wed 2016-07-13 18:25:51 IST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 807 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)
Jul 13 18:25:51 localhost systemd[1]: Starting LSB: Jenkins Continuous Integration Server...
Jul 13 18:25:51 localhost runuser[812]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
Jul 13 18:25:51 localhost jenkins[807]: Starting Jenkins bash: /usr/bin/java: Permission denied
Jul 13 18:25:51 localhost runuser[812]: pam_unix(runuser:session): session closed for user jenkins
Jul 13 18:25:51 localhost jenkins[807]: [FAILED]
Jul 13 18:25:51 localhost systemd[1]: jenkins.service: control process exited, code=exited status=1
Jul 13 18:25:51 localhost systemd[1]: Failed to start LSB: Jenkins Continuous Integration Server.
Jul 13 18:25:51 localhost systemd[1]: Unit jenkins.service entered failed state.
Jul 13 18:25:51 localhost systemd[1]: jenkins.service failed.
I am not able to figure out why it's giving me permission denied even though every user having access to the java path.
also on running "journalctl -xe" command it shows below log:
Jul 13 18:45:33 localhost systemd[1]: Unit jenkins.service entered failed state.
Jul 13 18:45:33 localhost systemd[1]: jenkins.service failed.
Jul 13 18:45:33 localhost polkitd[20151]: Unregistered Authentication Agent for unix-process:27889:3161602 (system bus name :1.303, object path /org/freedesktop/PolicyKit1/AuthenticationAgen
Is it like that the Jenkins service does't having permission to access the java path? if not why it's giving that error?
You have two options to solve the problem.
Jenkins service is started by jenkins user. The error says that jenkins user does not have permission to run java. So check orginal java path and give execute permissions to other users.
In jenkins.service unit file, change the owner of the service. Replace User=jenkins with User=root
The default user of service jenkins is "jenkins". So "jenkins" may not have the pemission to access service "java".
So we need to change the use of service jenkins.
From the jenkins service boost script "/etc/init.d/jenkins". We can get the config file path, such as "/etc/sysconfig/jenkins"
Try changing the file, /etc/init.d/jenkins
Specifically look for the JENKINS_USER key and try replacing jenkins with root.
This worked for me on RHEL.
After executing yum install docker on centos7, I want to start docker by executing service docker start, then i can see the error:
Redirecting to /bin/systemctl start docker.service
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
then I execute systemctl status docker.service -l, then the error is:
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
Active: failed (Result: exit-code) since Sun 2015-03-15 03:49:49 EDT; 12min ago
Docs: http://docs.docker.com
Process: 11444 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS (code=exited, status=1/FAILURE)
Main PID: 11444 (code=exited, status=1/FAILURE)
Mar 15 03:49:48 localhost.localdomain docker[11444]: 2015/03/15 03:49:48 docker daemon: 1.3.2 39fa2fa/1.3.2; execdriver: native; graphdriver:
Mar 15 03:49:48 localhost.localdomain docker[11444]: [a25f748b] +job serveapi(fd://)
Mar 15 03:49:48 localhost.localdomain docker[11444]: [info] Listening for HTTP on fd ()
Mar 15 03:49:48 localhost.localdomain docker[11444]: [a25f748b] +job init_networkdriver()
Mar 15 03:49:48 localhost.localdomain docker[11444]: [a25f748b] -job init_networkdriver() = OK (0)
Mar 15 03:49:49 localhost.localdomain docker[11444]: 2015/03/15 03:49:49 write /var/lib/docker/init/dockerinit-1.3.2: no space left on device
Mar 15 03:49:49 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 15 03:49:49 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Mar 15 03:49:49 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
I really have no idea, looking forward to your response, I will be very appreciative!
this error usually occurs because of missing device-mapper-event-libs package.
# yum install device-mapper-event-libs
Thanks for Ben Whaley's advice,When I check my disk space,Indeed it's not enough.I extend my disk space and solve the problem. It's the first time I put forward questions,It's really of help. thanks again.
I upgraded the CentOS 7 kernel from 3 to 4.
NOTE: I upgraded Kernel for other reasons also, first try without upgrading kernel.
delete the folder docker under /var/lib
go to cd /etc/sysconfig
vi docker (before editing copy docker docker.org)
see Line there you find OPTIONS='--selinux-disabled --log-driver=journald'
Remove --selinux-disabled should like OPTIONS='--log-driver=journald'
Now un-comment # setsebool -P docker_transition_unconfined 1 to setsebool -P docker_transition_unconfined 1
reboot the machine or you try only docker start to check for me it works :)