Can't find docker.sock after system upgrade to 10.11.5

Expected behavior

The “docker version” command should give me the server version of the Docker engine.

Actual behavior

$ docker version
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:20 2016
OS/Arch: darwin/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Information

$ /Applications/Docker.app/Contents/Resources/bin/pinata.bin diagnose -u
OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta12
Running diagnostic tests:
[ERROR] docker-cli /var/run/docker.sock does not exist
[ERROR] docker-cli Unexpected error (No such file or directory) connecting to /var/run/docker.sock
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160524-101941.tar.gz
Most specific failure is: Unexpected error (No such file or directory) connecting to /var/run/docker.sock
Your unique id is: 6BD99A28-98D3-45F5-BAEC-44914C395AFD
Please quote this in all correspondence.

All was well until I updated to El Capitan 10.11.5. As you can see above, the engine is still running (I do have a container running on localhost that I can still reach, too).

No env variables are set:

$ env | grep DOCKER
$

I have Docker Toolbox installed as well, so it looks like the sock file link reverted back to the toolbox’s file?
$ ls -la /var/run/docker.sock
lrwxr-xr-x 1 root daemon 56 May 24 09:56 /var/run/docker.sock -> /var/setup/Library/Containers/com.docker.docker/Data/s60

Steps to reproduce the behavior

  1. Install Docker for Mac on 10.11.4 alongside Docker Toolbox
  2. Test commands against engine to ensure it’s not using a docker-machine engine, run a container.
  3. Upgrade to 10.11.5.
  4. Docker version fails to connect to Docker for Mac’s engine.
1 Like

Just upgraded to OSX 10.11.5 too, and it is not possible to use the Docker beta. So now I am trying to boot a VM with docker-machine and I get this:

Check network to re-create if needed... Error setting up host only network on machine start: VirtualBox is configured with multiple host-only adapters with the same IP "172.17.8.1". Please remove one.

Does anyone have suggestions? I am really blocked here.

Exact same issue on OS X 10.11.5:

$ pinata diagnose
OS X: version 10.11.5 (build: 15F24b)
Docker.app: version v1.11.1-beta12
Running diagnostic tests:
[ERROR]   docker-cli       /var/run/docker.sock does not exist
[ERROR]   docker-cli       Permission denied (EACCES) connecting to /var/run/docker.sock: check permissions
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      menubar
[OK]      environment
[OK]      Docker
[OK]      VT-x
Docker logs are being collected into /tmp/20160524-232423.tar.gz
Most specific failure is: Permission denied (EACCES) connecting to /var/run/docker.sock: check permissions
Would you like to upload log files? [Y/n]: y

Your unique id is: 723F7090-466E-4D52-9AD1-021A6A6E1AF5
Please quote this in all correspondence.

Same as OP, no Docker environment variables set, same Docker version. Docker.app reports Docker as running. Resetting Docker.app does not help.

Hi, for me I see the following;

ls -l /var/run/docker.sock

lrwxr-xr-x 1 root daemon 59 May 23 18:24 /var/run/docker.sock ->
/Users/rkazak/Library/Containers/com.docker.docker/Data/s60

ls -l /Users/rkazak/Library/Containers/com.docker.docker/Data/s60

srwxr-xr-x 1 rkazak staff 0 May 23 18:24
/Users/rkazak/Library/Containers/com.docker.docker/Data/s60

maybe check that the target directory is accessiable? And that docker
startup can create the socket?

Same as OP, I get:

$ pinata diagnose
...
Running diagnostic tests:
[ERROR]   docker-cli       /var/run/docker.sock does not exist
[ERROR]   docker-cli       Unexpected error (No such file or directory) connecting to /var/run/docker.sock
[OK]      Moby booted
...

Digging in I get:

$ ls -l /var/run/docker.sock
lrwxr-xr-x  1 root  daemon  56 25 May 09:10 /var/run/docker.sock -> /var/setup/Library/Containers/com.docker.docker/Data/s60

and

$ ls -l /var/setup/Library/Containers/com.docker.docker/Data/s60
ls: /var/setup/Library/Containers/com.docker.docker/Data/s60: No such file or directory

and then…

ls -l /var/setup                    
ls: /var/setup: No such file or directory

I don’t know what the remedy should be though.

Digging further…

$ find / -type d -name "Containers"
/Users/peterrichards/Library/Containers

And then

$ ls -l /Users/peterrichards/Library/Containers/com.docker.docker/Data/s60 
srwxr-xr-x  1 peterrichards  staff  0 25 May 09:10 /Users/peterrichards/Library/Containers/com.docker.docker/Data/s60

So it looks like the sym link is just pointing to the wrong place, but I still don’t know what the “correct” fix should be - just change the sym link? Why did this happen, and are other things likely to be affected? Maybe it is worth uninstalling & re-installing Docker for Mac…

I resolved this by uninstalling and re-installing Docker for Mac.

However, I had only just migrated from Docker Terminal so all of my machines got migrated over again - I suspect any new config I’d had in Docker for Mac would have been lost.

After clean install I now get:

$ ls -l /var/run/docker.sock
lrwxr-xr-x  1 root  daemon  66 25 May 10:48 /var/run/docker.sock -> /Users/peterrichards/Library/Containers/com.docker.docker/Data/s60

So it looks like a less severe fix would have been to run:

$ ln -sf /Users/peterrichards/Library/Containers/com.docker.docker/Data/s60 /var/run/docker.sock

NOTE: I did not try this.

2 Likes

Thanks, @brightchimp

I didn’t uninstall native docker and replace the link directly.

It is a hack which links the sock to personal home directory, but at least, my docker works fine now.

Problem Description
I’m also running into this problem. OSX informed me that my system was going to reboot due to automatically installing an update and after rebooting when I run any “docker” command I now get:

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Bummer that I ran into this, as this beta had fixed my issue of using a Cisco software VPN and being able to use the docker commands. I was actually able to get work done on my laptop without having to SSH into a remote CoreOS system.

System Info
$ pinata diagnose -u
OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta12
Running diagnostic tests:
[ERROR] docker-cli /var/run/docker.sock does not exist
[ERROR] docker-cli Unexpected error (No such file or directory) connecting to /var/run/docker.sock
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160525-043326.tar.gz
Most specific failure is: Unexpected error (No such file or directory) connecting to /var/run/docker.sock

Workaround:

  1. ls -l /var/run/docker.sock (points at /var/setup/...)
  2. sudo rm /var/run/docker.sock
  3. :whale: → Quit Docker
  4. Restart Docker application
  5. ls -l /var/run/docker.sock (points at $HOME/Library/...)
  6. docker version
1 Like

I also ran into a similar issue after upgrading to OS X 10.11.5. After upgrading my symlinks for docker, docker-machine, and docker-compose from /usr/local/bin no longer pointed to /Applications/Docker.app/Contents/Resources/bin files. After re-creating those three symlinks using ln -sf, I was able to use my docker containers just fine. Your mileage of course may vary.

This did not work for me, but sudo ln -sf $HOME/Library/Containers/com.docker.docker/Data/s60 /var/run/docker.sock (a bit dirtier) did. Restarting Docker.app breaks the symlink again.

1 Like

Looks like upgrading to v1.11.1-beta13 and restarting Docker my symlink was restored:

$ ls -la /var/run/docker.sock
lrwxr-xr-x 1 root daemon 63 May 25 16:31 /var/run/docker.sock -> /Users/aschroeter/Library/Containers/com.docker.docker/Data/s60

Same here, update to latest Version 1.11.1-beta13 (build: 7975) beta fixed this (so far) for me. I even tried soft VPN and it still worked.

Tried this and it worked flawlessly. Thanks!

  1. sudo ln -sf $HOME/Library/Containers/com.docker.docker/Data/s60 /var/run/docker.sock
  2. Restarting Docker.app breaks the symlink again.

It works well again. Thanks!