prisma1 icon indicating copy to clipboard operation
prisma1 copied to clipboard

Docker-compose up printing some error messages on a ubuntu wsl machine

Open foodornt opened this issue 6 years ago • 25 comments

Bug description

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 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 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.', 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 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.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "bin/docker-compose", line 3, in 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.', FileNotFoundError(2, 'No such file or directory'))

How to reproduce

Just running docker-compose up -d causes the issue

Expected behavior

create a database and start the proxy server

Prisma information

Haven't made one yet

Environment & setup

  • OS: WSL Ubuntu 18.04-->
  • Database: MySQL
  • Node.js version: v10.22.0 -->
  • Prisma version: prisma/1.34.10 (linux-x64)

foodornt avatar Sep 12 '20 06:09 foodornt

Do you have the privileges configured correctly for docker? Try running the same command with sudo: $ sudo docker-compose up -d

If that works, try with these steps in order to get docker working without sudo.

MBerguer avatar Sep 15 '20 15:09 MBerguer

I am having the same problem. Just recently installed Ubuntu 20

LLCarlos avatar Sep 18 '20 17:09 LLCarlos

I have same issue on debian.

kendji avatar Sep 19 '20 05:09 kendji

Do you have the privileges configured correctly for docker? Try running the same command with sudo: $ sudo docker-compose up -d

If that works, try with these steps in order to get docker working without sudo.

nope. same error.

foodornt avatar Sep 19 '20 05:09 foodornt

I resolved myself. no docker command was installed lol

kendji avatar Sep 19 '20 05:09 kendji

I resolved myself. no docker command was installed lol

how did you install docker?

foodornt avatar Sep 19 '20 09:09 foodornt

I resolved myself. no docker command was installed lol

how did you install docker?

Like below. curl https://get.docker.com | sh sudo usermod -aG docker $USER sudo reboot sudo systemctl start docker sudo systemctl enable docker Thanks to here<- Written in Japanese.

I installed docker environment once. But the environment conflicted with centos. That is for debian. So, I retried install, but my brain conflicted this turn.

kendji avatar Sep 20 '20 07:09 kendji

Same problem on centos 8

acamenhas avatar Sep 25 '20 10:09 acamenhas

Yeah, i was having the same problem.. turns out i had uninstalled docker and didn't know.. Please, make sure you guys have docker command installed Link to docker install

rezendegc avatar Sep 28 '20 19:09 rezendegc

Alright guys, thank you all, you're answers we're really helpful, I solved the issue.

first I had to upgrade WSL 1 to 2 so docker-compose can run (there's a workaround for WSL 1 as well if you wish to use it). Second thing is installing the docker engine probably (Yeah, I didn't install it correctly somehow). I also installed docker desktop for windows and activated the wsl 2 thingy. that's it for the most part. I'm closing the issue, thank you all.

foodornt avatar Oct 02 '20 14:10 foodornt

I belive the information above might lead to mistake. When Docker Desktop is installed and the WSL 2 based engine is selected, that can be integrated into WSL without the need to install docker engine in WSL. Docker best practices actually recommend against it.

Instead, integration needs to be explicitely enabled: image

See Docker Desktop WSL 2 backend for details.

gilabrantes avatar Nov 24 '20 16:11 gilabrantes

Minor addition for further desperades: It is also possible you have docker installed and just not running, sudo systemctl start docker.service helped me in that case.

Huge avatar Feb 02 '21 12:02 Huge

just ensure that docker daemon is running! how?

$ docker info

if output is like this following:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.5.0)

Server:
ERROR: Error response from daemon: dial unix docker.raw.sock: connect: connection refused
errors pretty printing info

It means docker daemon in not running, then just start it, it depends of how do you installed and of your OS.

when docker daemon is running the docker info command will be like this:

➜  docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.5.0)

Server:
 Containers: 49
  Running: 1
  Paused: 0
  Stopped: 48
 Images: 23
 Server Version: 20.10.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.121-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 1.941GiB
 Name: docker-desktop
 ID: HG3C:BBZ7:KQGC:PLLR:3EJW:LELZ:EERS:G6L7:YCLU:PQQP:HLMU:Y3NJ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: gateway.docker.internal:3128
 HTTPS Proxy: gateway.docker.internal:3129
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Regards.

eriknyk avatar Apr 09 '21 17:04 eriknyk

@gilabrantes I had same problem today and I noticed that enabling Ubuntsu option had turned off after updating docker. 😢 ice_screenshot_20210417-142026

jtanaka avatar Apr 17 '21 05:04 jtanaka

just ensure that docker daemon is running! how?

$ docker info

if output is like this following:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.5.0)

Server:
ERROR: Error response from daemon: dial unix docker.raw.sock: connect: connection refused
errors pretty printing info

It means docker daemon in not running, then just start it, it depends of how do you installed and of your OS.

when docker daemon is running the docker info command will be like this:

➜  docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.5.0)

Server:
 Containers: 49
  Running: 1
  Paused: 0
  Stopped: 48
 Images: 23
 Server Version: 20.10.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.121-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 1.941GiB
 Name: docker-desktop
 ID: HG3C:BBZ7:KQGC:PLLR:3EJW:LELZ:EERS:G6L7:YCLU:PQQP:HLMU:Y3NJ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: gateway.docker.internal:3128
 HTTPS Proxy: gateway.docker.internal:3129
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Regards.

Works for me! Thanks!!!! :D

VolmirF avatar May 04 '21 01:05 VolmirF

Solución

sudo systemctl restart docker

edgarherrerapepe avatar Sep 23 '21 17:09 edgarherrerapepe

try these: 1. Make sure the docker command is installed, you can use docker -h to confirm that. if not, use apt or yum to install it. yum install docker apt install docker.io 2. Make sure the docker service is started systemctl status docker systemctl start docker

Jewel591 avatar Jan 04 '22 11:01 Jewel591

I had the same issue. Turns out I missed some steps in the official installation guide so i re-read and did those

After that i could only run it with sudo like sudo docker-compose up

Then I did the post install guide and it worked without sudo

docker-compose up

lauhon avatar Feb 14 '22 08:02 lauhon

In my case, AWS AMI, the docker.service was inactive (centos),

hence I first enabled the service "sudo systemctl start docker.service" then

"sudo docker-compose up --build"

and then it worked fine for me.

mohammad-mustafa-24ourx avatar Mar 23 '22 19:03 mohammad-mustafa-24ourx

I had the same error in WSL2 with Ubuntu

After installing run sudo service docker start to up the service and then sudo docker-compose up will work

alexjoseps avatar Mar 30 '22 18:03 alexjoseps