0

This is my first setup of Docker-compose. I have followed the steps shows here: https://docs.docker.com/compose/gettingstarted/. Here are the errors im facing, I am not sure how to fix these

Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen  
  File "urllib3/connectionpool.py", line 392, in _make_request  
  File "http/client.py", line 1252, in request  
  File "http/client.py", line 1298, in _send_request  
  File "http/client.py", line 1247, in endheaders  
  File "http/client.py", line 1026, in _send_output  
  File "http/client.py", line 966, in send  
  File "docker/transport/unixconn.py", line 43, in connect   
PermissionError: [Errno 13] Permission denied   

During handling of the above exception, another exception occurred:  

Traceback (most recent call last):  
  File "requests/adapters.py", line 449, in send  
  File "urllib3/connectionpool.py", line 727, in urlopen  
  File "urllib3/util/retry.py", line 403, in increment   
  File "urllib3/packages/six.py", line 734, in reraise   
  File "urllib3/connectionpool.py", line 677, in urlopen  
  File "urllib3/connectionpool.py", line 392, in _make_request  
  File "http/client.py", line 1252, in request  
  File "http/client.py", line 1298, in _send_request  
  File "http/client.py", line 1247, in endheaders  
  File "http/client.py", line 1026, in _send_output  
  File "http/client.py", line 966, in send  
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))  

During handling of the above exception, another exception occurred:  

Traceback (most recent call last):  
  File "docker/api/client.py", line 205, 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 228, 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.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:  

Traceback (most recent call last):  
  File "bin/docker-compose", line 3, in <module>   
  File "compose/cli/main.py", line 67, in main   
  File "compose/cli/main.py", line 123, in perform_command  
  File "compose/cli/command.py", line 69, in project_from_options  
  File "compose/cli/command.py", line 132, in get_project  
  File "compose/cli/docker_client.py", line 43, in get_client  
  File "compose/cli/docker_client.py", line 170, in docker_client  
  File "docker/api/client.py", line 188, in __init__  
  File "docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))  
[13492] Failed to execute script docker-compose  

If anyone could give me some suggestions on what to do, it would be quite helpful.

Infinitypool
  • 1
  • 1
  • 2
  • Are you root or in a group having access to the Docker socket? – Klaus D. Dec 18 '20 at 15:04
  • See also [How to fix docker: Got permission denied issue](https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue). It's very easy to root the host using `docker` commands, so it typically requires `sudo` access, or you can configure a user to not require special permission. – David Maze Dec 18 '20 at 15:14

1 Answers1

0

Looks like docker-compose does not have the right to connect to docker.socket

sudo systemctl restart docker
sudo docker-compose up -d