compose
compose copied to clipboard
Errors running up
Hello, when I run docker compose up I get the following errors :
$ docker-compose up -d
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/lib/python3.8/site-packages/docker/transport/unixconn.py", line 43, in connect
sock.connect(self.unix_socket)
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
retries = retries.increment(
File "/usr/lib/python3.8/site-packages/urllib3/util/retry.py", line 403, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3.8/site-packages/urllib3/packages/six.py", line 734, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/lib/python3.8/site-packages/docker/transport/unixconn.py", line 43, in connect
sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 205, in _retrieve_server_version
return self.version(api_version=False)["ApiVersion"]
File "/usr/lib/python3.8/site-packages/docker/api/daemon.py", line 181, in version
return self._result(self._get(url), json=True)
File "/usr/lib/python3.8/site-packages/docker/utils/decorators.py", line 46, in inner
return f(self, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 228, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 33, in <module>
sys.exit(load_entry_point('docker-compose==1.27.4', 'console_scripts', 'docker-compose')())
File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 67, in main
command()
File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 123, in perform_command
project = project_from_options('.', options)
File "/usr/lib/python3.8/site-packages/compose/cli/command.py", line 60, in project_from_options
return get_project(
File "/usr/lib/python3.8/site-packages/compose/cli/command.py", line 131, in get_project
client = get_client(
File "/usr/lib/python3.8/site-packages/compose/cli/docker_client.py", line 41, in get_client
client = docker_client(
File "/usr/lib/python3.8/site-packages/compose/cli/docker_client.py", line 170, in docker_client
client = APIClient(**kwargs)
File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 188, in __init__
self._version = self._retrieve_server_version()
File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 212, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
It seems that some files ares missing? But I don't know which one.
OS : Linux Manjaro
$ docker -v
Docker version 19.03.12-ce, build 48a66213fe
$ docker-compose version
docker-compose version 1.27.4, build unknown
docker-py version: 4.3.1
CPython version: 3.8.5
OpenSSL version: OpenSSL 1.1.1h 22 Sep 2020
I tried by installing compose via pacman, pip, or by taking directly the binary via curl. It seems that all the needed dependencies are installed, exemple by installing with pip:
$ pip install docker-compose
Defaulting to user installation because normal site-packages is not writeable
Collecting docker-compose
Downloading docker_compose-1.27.4-py2.py3-none-any.whl (110 kB)
|████████████████████████████████| 110 kB 2.8 MB/s
Requirement already satisfied: cached-property<2,>=1.2.0 in /usr/lib/python3.8/site-packages (from docker-compose) (1.5.2)
Requirement already satisfied: PyYAML<6,>=3.10 in /usr/lib/python3.8/site-packages (from docker-compose) (5.3.1)
Requirement already satisfied: docopt<1,>=0.6.1 in /usr/lib/python3.8/site-packages (from docker-compose) (0.6.2)
Requirement already satisfied: requests<3,>=2.20.0 in /usr/lib/python3.8/site-packages (from docker-compose) (2.24.0)
Requirement already satisfied: docker[ssh]<5,>=4.3.1 in /usr/lib/python3.8/site-packages (from docker-compose) (4.3.1)
Requirement already satisfied: python-dotenv<1,>=0.13.0 in /usr/lib/python3.8/site-packages (from docker-compose) (0.14.0)
Requirement already satisfied: dockerpty<1,>=0.4.1 in /usr/lib/python3.8/site-packages (from docker-compose) (0.4.1)
Requirement already satisfied: jsonschema<4,>=2.5.1 in /usr/lib/python3.8/site-packages (from docker-compose) (3.2.0)
Requirement already satisfied: texttable<2,>=0.9.0 in /usr/lib/python3.8/site-packages (from docker-compose) (1.6.3)
Requirement already satisfied: distro<2,>=1.5.0 in /usr/lib/python3.8/site-packages (from docker-compose) (1.5.0)
Requirement already satisfied: websocket-client<1,>=0.32.0 in /usr/lib/python3.8/site-packages (from docker-compose) (0.57.0)
Requirement already satisfied: chardet>=3.0.2 in /usr/lib/python3.8/site-packages (from requests<3,>=2.20.0->docker-compose) (3.0.4)
Requirement already satisfied: idna>=2.5 in /usr/lib/python3.8/site-packages (from requests<3,>=2.20.0->docker-compose) (2.10)
Requirement already satisfied: urllib3>=1.21.1 in /usr/lib/python3.8/site-packages (from requests<3,>=2.20.0->docker-compose) (1.25.10)
Requirement already satisfied: six>=1.4.0 in /usr/lib/python3.8/site-packages (from docker[ssh]<5,>=4.3.1->docker-compose) (1.15.0)
Requirement already satisfied: paramiko>=2.4.2 in /usr/lib/python3.8/site-packages (from docker[ssh]<5,>=4.3.1->docker-compose) (2.7.2)
Requirement already satisfied: attrs>=17.4.0 in /usr/lib/python3.8/site-packages (from jsonschema<4,>=2.5.1->docker-compose) (20.2.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/lib/python3.8/site-packages (from jsonschema<4,>=2.5.1->docker-compose) (0.17.3)
Requirement already satisfied: setuptools in /usr/lib/python3.8/site-packages (from jsonschema<4,>=2.5.1->docker-compose) (50.3.0)
Requirement already satisfied: bcrypt>=3.1.3 in /usr/lib/python3.8/site-packages (from paramiko>=2.4.2->docker[ssh]<5,>=4.3.1->docker-compose) (3.2.0)
Requirement already satisfied: cryptography>=2.5 in /usr/lib/python3.8/site-packages (from paramiko>=2.4.2->docker[ssh]<5,>=4.3.1->docker-compose) (3.1.1)
Requirement already satisfied: pynacl>=1.0.1 in /usr/lib/python3.8/site-packages (from paramiko>=2.4.2->docker[ssh]<5,>=4.3.1->docker-compose) (1.4.0)
Requirement already satisfied: cffi>=1.1 in /usr/lib/python3.8/site-packages (from bcrypt>=3.1.3->paramiko>=2.4.2->docker[ssh]<5,>=4.3.1->docker-compose) (1.14.3)
Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi>=1.1->bcrypt>=3.1.3->paramiko>=2.4.2->docker[ssh]<5,>=4.3.1->docker-compose) (2.20)
Installing collected packages: docker-compose
Successfully installed docker-compose-1.27.4
Thanks for your help.
I have run into this exact issue. I solved this by making sure that I run sudo systemctl start docker and then running sudo docker-compose up
Jup this happens if docker is not running (which is the default for arch/manjaro). Instead of some meaningless backtrace it should print some proper error message in this case. As far as I remember, earlier versions of compose did that.
I second this suggestion of proper error message like "Error: Docker process not running"
I have run into this exact issue. I solved this by making sure that I run
sudo systemctl start dockerand then runningsudo docker-compose up
Oh, thanks a lot. It was indeed simply Docker which was not running. I was so sure I already started Docker that I didn't thought about it.
Jup this happens if docker is not running (which is the default for arch/manjaro). Instead of some meaningless backtrace it should print some proper error message in this case. As far as I remember, earlier versions of compose did that.
Yeah I agree too.
You shouldn't close this issue then. This needs proper error message.
You shouldn't close this issue then. This needs proper error message.
Heh you're right, I reopened it.
Receiving the same error message today on docker-compose version 1.27.4, build 40524192 debian 9 x64
Edit: I found it. Turns out that it was actually that I had docker compose installed but not docker itself.
Was very confused getting this error. Just a simple "Are you sure docker is running?" would solve this.
if on a mac, just make sure docker is started.
cmd + space + type "docker" into the search bar + enter
I also wasted time trying to interpret this error message. I had gotten so used to docker always running at startup that I had forgotten I disabled it since even though I wasn't using it it was eating up cpu at times.
Thanks to this page, googling the error message saved me some time.
I have run into this exact issue. I solved this by making sure that I run
sudo systemctl start dockerand then runningsudo docker-compose up
And in Mac, I solved by install Docker.app follow this
Had to come to this issue to understand that my MacOS didn't start Docker on system init. Error message could be as simple as "Please, start your docker service sir, thank you very much and have a good day" instead of a stacktrace full of random stuff.
sudo systemctl start docker
sudo launchctl start docker for mac
I'd like to try contributing to docker-compose, and this seems like a good first issue. Is anyone working on this? If no, can I take it?
@renatoaraujoc That would be awesome!
Future of Docker Compose is taking place on the Go implementation to be bundled with the Docker CLI as a plugin, see https://github.com/docker/compose-cli
You just need to start your Docker :)
You can run this command on macOS to start Docker: open --hide --background -a Docker 🎉
if on a mac, just make sure docker is started.
cmd + space + type "docker" into the search bar + enter
i forgot im running on mac haha thanks for reply
The interviewer asked me to submit the project with the instructions to run the project locally. I used docker to remove the hassle. Now it has become a hassle :angry:
I second this suggestion of proper error message like "Error: Docker process not running"
that's right
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Ubuntu20.04 in WSL2,systemctl is not work,first run: sudo service docker start
This issue has been automatically marked as not stale anymore due to the recent activity.
19 month later, this bug is still there (Alpine Linux 3.15.4 released Apr 04, 2022)
Compose v1 entered the End of Life process, you should switch to compose v2
still an issue, please add helpfull exception msg as stated above, that docker isnt running.
$ docker-compose version
docker-compose version 1.29.2
docker-py version: 5.0.0
CPython version: 3.9.0
OpenSSL version: OpenSSL 1.1.1h 22 Sep 2020
$ docker-compose build
Traceback (most recent call last):
File "urllib3/connectionpool.py", line 670, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1255, in request
File "http/client.py", line 1301, in _send_request
File "http/client.py", line 1250, in endheaders
File "http/client.py", line 1010, in _send_output
File "http/client.py", line 950, in send
File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "requests/adapters.py", line 439, in send
File "urllib3/connectionpool.py", line 726, in urlopen
File "urllib3/util/retry.py", line 410, in increment
File "urllib3/packages/six.py", line 734, in reraise
File "urllib3/connectionpool.py", line 670, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1255, in request
File "http/client.py", line 1301, in _send_request
File "http/client.py", line 1250, in endheaders
File "http/client.py", line 1010, in _send_output
File "http/client.py", line 950, in send
File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker/api/client.py", line 214, in _retrieve_server_version
File "docker/api/daemon.py", line 181, in version
File "docker/utils/decorators.py", line 46, in inner
File "docker/api/client.py", line 237, in _get
File "requests/sessions.py", line 543, in get
File "requests/sessions.py", line 530, in request
File "requests/sessions.py", line 643, in send
File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 81, in main
File "compose/cli/main.py", line 200, in perform_command
File "compose/cli/command.py", line 60, in project_from_options
File "compose/cli/command.py", line 152, in get_project
File "compose/cli/docker_client.py", line 41, in get_client
File "compose/cli/docker_client.py", line 170, in docker_client
File "docker/api/client.py", line 197, in __init__
File "docker/api/client.py", line 221, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[3437] Failed to execute script docker-compose
You just need to start your Docker :)
How do you conculde from this exception that docker is not started ?
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/lib/python3.8/site-packages/docker/transport/unixconn.py", line 43, in connect
sock.connect(self.unix_socket)
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
retries = retries.increment(
File "/usr/lib/python3.8/site-packages/urllib3/util/retry.py", line 403, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3.8/site-packages/urllib3/packages/six.py", line 734, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/lib/python3.8/site-packages/docker/transport/unixconn.py", line 43, in connect
sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 205, in _retrieve_server_version
return self.version(api_version=False)["ApiVersion"]
File "/usr/lib/python3.8/site-packages/docker/api/daemon.py", line 181, in version
return self._result(self._get(url), json=True)
File "/usr/lib/python3.8/site-packages/docker/utils/decorators.py", line 46, in inner
return f(self, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 228, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 33, in <module>
sys.exit(load_entry_point('docker-compose==1.27.4', 'console_scripts', 'docker-compose')())
File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 67, in main
command()
File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 123, in perform_command
project = project_from_options('.', options)
File "/usr/lib/python3.8/site-packages/compose/cli/command.py", line 60, in project_from_options
return get_project(
File "/usr/lib/python3.8/site-packages/compose/cli/command.py", line 131, in get_project
client = get_client(
File "/usr/lib/python3.8/site-packages/compose/cli/docker_client.py", line 41, in get_client
client = docker_client(
File "/usr/lib/python3.8/site-packages/compose/cli/docker_client.py", line 170, in docker_client
client = APIClient(**kwargs)
File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 188, in __init__
self._version = self._retrieve_server_version()
File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 212, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Thanks for this post. Was helpful along with [REF] https://askubuntu.com/questions/1379425/system-has-not-been-booted-with-systemd-as-init-system-pid-1-cant-operate
… to understand what was going on and get to sudo service docker start working to start docker service on ubuntu 20.04 on WSL2 to allow docker compose to work.
Same error, this works for me (ubuntu 18.04)
pip uninstall docker-compose
sudo apt-get install docker-compose