Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't connect to Docker daemon #2495

Closed
lovio opened this issue Dec 3, 2015 · 11 comments
Closed

Couldn't connect to Docker daemon #2495

lovio opened this issue Dec 3, 2015 · 11 comments
Labels

Comments

@lovio
Copy link

lovio commented Dec 3, 2015

>$ eval "$(docker-machine env default)"

>$ docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 17:56:04 UTC 2015
 OS/Arch:      darwin/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 17:56:04 UTC 2015
 OS/Arch:      linux/amd64

>$ docker-compose up
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.

>$ docker-machine start default
Machine "default" is already running.

>$ docker-machine version
docker-compose version: 1.5.1
docker-py version: 1.5.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.2a 19 Mar 2015

docker-compose is broken and no detailed error message is given. How to make it works?

@dnephin
Copy link

dnephin commented Dec 3, 2015

We've seen some cases where TLS settings are causing TLS errors, which result in a bad conenction failued error.

Can you include the output of env | grep DOCKER and docker-compose --verbose up

@lovio
Copy link
Author

lovio commented Dec 4, 2015

>$ env | grep DOCKER
DOCKER_TLS_VERIFY=1
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_CERT_PATH=/Users/kris/.docker/machine/machines/default
DOCKER_MACHINE_NAME=default

>$ docker-compose --verbose up
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: Trying /Users/kris/.docker/config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying /Users/kris/.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/compose/compose/cli/main.py", line 54, in main
  File "/compose/compose/cli/docopt_command.py", line 23, in sys_dispatch
  File "/compose/compose/cli/docopt_command.py", line 26, in dispatch
  File "/compose/compose/cli/main.py", line 169, in perform_command
  File "/compose/compose/cli/command.py", line 54, in project_from_options
  File "/compose/compose/cli/command.py", line 91, in get_project
  File "/compose/compose/cli/command.py", line 73, in get_client
  File "/compose/venv/lib/python2.7/site-packages/docker/api/daemon.py", line 78, in version
  File "/compose/venv/lib/python2.7/site-packages/docker/client.py", line 110, in _get
  File "/compose/venv/lib/python2.7/site-packages/requests/sessions.py", line 477, in get
  File "/compose/venv/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
  File "/compose/venv/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
  File "/compose/venv/lib/python2.7/site-packages/requests/adapters.py", line 424, in send
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='192.168.99.100', port=2376): Max retries exceeded with url: /v1.19/version (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',)))
docker-compose returned -1

@dnephin
Copy link

dnephin commented Dec 4, 2015

Caused by ProxyError('Cannot connect to proxy.

It looks like maybe you have some PROXY environment variables set that are preventing you from hitting the daemon.

What's the output of env | grep PROXY ?

@lovio
Copy link
Author

lovio commented Dec 7, 2015

Close the proxy and fix.

@jochenmanz
Copy link

I do have the same problem. I'm running on mac 10.11.2, installed via brew.

docker-machine ls

NAME ACTIVE DRIVER STATE URL SWARM
default * virtualbox Running tcp://192.168.99.100:2376

docker-compose -v

docker-compose version 1.5.2, build unknown

env | grep DOCKER

DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_MACHINE_NAME=default
DOCKER_TLS_VERIFY=1
DOCKER_CERT_PATH=/Users/jochenmanz/.docker/machine/machines/default

docker-compose --verbose up:

....
php_1 | [20-Dec-2015 01:45:13] NOTICE: fpm is running, pid 1
php_1 | [20-Dec-2015 01:45:13] NOTICE: ready to handle connections
php_1 | [20-Dec-2015 01:45:13] NOTICE: systemd monitor interval set to 10000ms
ERROR: compose.cli.main.main: Couldn't connect to Docker daemon - you might need to run docker-machine start default.

docker-compose.yml

http://pastebin.com/N0rvAhcF

@kimptoc
Copy link

kimptoc commented Dec 30, 2015

Also getting this problem too. I had tried to setup a machine using a proxy, following this suggestion - docker-archive/toolbox#102 (comment) .

But ever since then, I get this issue with docker-compose.

I have recreated my default machine, without specifying the proxy, but it seems like the config is being held somewhere.

TIA

@kimptoc
Copy link

kimptoc commented Dec 30, 2015

DOH - fixed it, I had the proxy settings set in the OSX system preferences. I guess the browser falls back to none if it cannot connect.

@dnephin dnephin closed this as completed Jan 15, 2016
@dnephin
Copy link

dnephin commented Jan 15, 2016

This is being tracked by #903

@dernotte
Copy link

I had this problem fix with this command "export no_proxy=192.168.99.100"

@b3h3rkz
Copy link

b3h3rkz commented Sep 9, 2016

after adding @dernotte solution, it didn't work for me until I added eval $(docker-machine env dev)
My machine name was dev in this case

@pablorq
Copy link

pablorq commented Aug 13, 2019

On Windows 7, add the NO_PROXY variable to local variables (besides the internal variables of the virtual machine).

Run this in a CMD:

set NO_PROXY=%DOCKER_HOST%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants