Bug 1149882

Summary: docker socket not found errors
Product: [Fedora] Fedora Reporter: Ben Parees <bparees>
Component: docker-ioAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: admiller, dwalsh, eparis, golang-updates, hushan.jia, jperrin, lsm5, mattdm, mgoldman, s, thrcka, vbatts
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: docker-io-1.2.0-5.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-27 03:27:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Parees 2014-10-06 20:11:14 UTC
Description of problem:
When run as a service, I frequently run into issues with the /var/run/docker.sock being reported as not found, but if i shutdown the service, remove /var/run/docker.sock, and run "docker -d" manually instead, I have no such problem.

In addition, systemctl start docker does not appear to consistently create /var/run/docker.sock, though the docker daemon reports as running.


Version-Release number of selected component (if applicable):
docker-io-1.2.0-2.fc20.x86_64

How reproducible:
Intermittent, most consistently recreates when bind mounting the docker socket into a docker container and trying to perform docker operations from within that container.

Additional info:
Disabling selinux has no effect on the results.

Sample output:

running as a service:

[bparees@bparees ~]$ ps ax | grep docker
10731 ?        Ssl    0:00 /usr/bin/docker -d -H fd:// --selinux-enabled
11021 pts/6    S+     0:00 grep --color=auto docker
[bparees@bparees ~]$ ls -l /var/run/docker*
-rw-r--r--. 1 root root 5 Oct  6 16:08 /var/run/docker.pid
[bparees@bparees ~]$ docker ps
2014/10/06 16:10:03 Get http:///var/run/docker.sock/v1.14/containers/json: dial unix /var/run/docker.sock: no such file or directory

restarting manually:

[bparees@bparees ~]$ sudo systemctl stop docker
[sudo] password for bparees: 
Warning: Stopping docker, but it can still be activated by:
  docker.socket
[bparees@bparees ~]$ sudo docker -d >& /tmp/out &
[1] 11343
[bparees@bparees ~]$ ls -l /var/run/docker.*
-rw-r--r--. 1 root root   5 Oct  6 16:10 /var/run/docker.pid
srw-rw----. 1 root docker 0 Oct  6 16:10 /var/run/docker.sock
[bparees@bparees ~]$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Comment 1 Daniel Walsh 2014-10-06 20:36:18 UTC
The socket should be created by the systemd if docker.socket is enabled.

Comment 2 Lokesh Mandvekar 2014-10-06 23:45:37 UTC
Ben, could you check if things work better after a 'systemctl restart docker.socket' ?


fwiw, this seems to work best on my rawhide machine. I stopped docker and rm'd docker.sock prior to below steps.

lsm5 @ naruto : /var/run $ ls -al | grep docker
lsm5 @ naruto : /var/run $ systemctl start docker
lsm5 @ naruto : /var/run $ ls -al | grep docker  
-rw-r--r--.  1 root  root     5 Oct  6 18:41 docker.pid
lsm5 @ naruto : /var/run $ systemctl restart docker
lsm5 @ naruto : /var/run $ ls -al | grep docker    
-rw-r--r--.  1 root  root     5 Oct  6 18:41 docker.pid
lsm5 @ naruto : /var/run $ systemctl restart docker.socket
lsm5 @ naruto : /var/run $ ls -al | grep docker           
-rw-r--r--.  1 root  root      5 Oct  6 18:41 docker.pid
srw-rw----.  1 root  docker    0 Oct  6 18:41 docker.sock
lsm5 @ naruto : /var/run $

Comment 3 Eric Paris 2014-10-07 02:40:13 UTC
A little bit of systemd knowledge was dropped on my and I have this working now.  I'll try to get patches everywhere tomorrow.  Below look good?  Socket activation works.  Service enablement works.  Deleting the /var/run/docker.sock is fine the next time you restart the docker.socket or start the docker.service.  But for now, sleep.

# systemctl stop docker.service

# rm /var/run/docker.sock
rm: remove socket ‘/var/run/docker.sock’? y

# docker ps
2014/10/06 22:34:23 Get http:///var/run/docker.sock/v1.14/containers/json: dial unix /var/run/docker.sock: no such file or directory

# systemctl start docker.service

# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

# systemctl stop docker.service

# systemctl start docker.socket

# ps -ef | grep docker
root      4618  3922  0 22:34 pts/0    00:00:00 grep --color=auto docker

# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

# ps -ef | grep docker
root      4626     1  0 22:35 ?        00:00:00 /usr/bin/docker -d -H fd:// --selinux-enabled
root      4692  3922  0 22:35 pts/0    00:00:00 grep --color=auto docker

Comment 4 Ben Parees 2014-10-07 13:47:39 UTC
lokesh's suggestion does fix the issue, btw (vincent helped me w/ that yesterday)

Comment 5 Vincent Batts 2014-10-07 19:31:14 UTC
https://github.com/docker/docker/pull/8451

Comment 6 Fedora Update System 2014-10-09 18:16:45 UTC
docker-io-1.2.0-5.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/docker-io-1.2.0-5.fc21

Comment 7 Fedora Update System 2014-10-09 18:34:09 UTC
docker-io-1.2.0-5.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/docker-io-1.2.0-5.fc20

Comment 8 Fedora Update System 2014-10-11 06:58:24 UTC
Package docker-io-1.2.0-5.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing docker-io-1.2.0-5.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-12635/docker-io-1.2.0-5.fc20
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2014-10-23 01:13:30 UTC
docker-io-1.3.0-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/docker-io-1.3.0-1.fc20

Comment 10 Fedora Update System 2014-10-27 03:27:53 UTC
docker-io-1.3.0-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2014-11-01 16:55:40 UTC
docker-io-1.2.0-5.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.