Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

640
Visualizações
docker.errors.DockerException: Error while fetching server API version

I want to install this module but there is something wrong when I try the step docker-compose build ...

I tried to update the Docker version and restart Docker many times. But it didn't work.

git clone https://github.com/uhh-lt/158.git
cd 158
docker-compose build
File "/home/ming/.local/bin/docker-compose", line 8, in <module>
    sys.exit(main())
  File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/main.py", line 67, in main
    command()
  File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/main.py", line 123, in perform_command
    project = project_from_options('.', options)
  File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
  File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/command.py", line 131, in get_project
    client = get_client(
  File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/docker_client.py", line 41, in get_client
    client = docker_client(
  File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/docker_client.py", line 170, in docker_client
    client = APIClient(**kwargs)
  File "/home/ming/.local/lib/python3.8/site-packages/docker/api/client.py", line 188, in __init__
    self._version = self._retrieve_server_version()
  File "/home/ming/.local/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'))

Update 2020-11-23

Thanks for two of you helping me with the error! I tried the commend but can't connect to my Docker:

ming@KITM-7664:~$ sudo /etc/init.d/docker start
[sudo] password for ming:
 * Starting Docker: docker                                                                                       [ OK ]

ming@KITM-7664:~$ which docker
/usr/bin/docker

ming@KITM-7664:~$ docker version
Client: Docker Engine - Community
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:02:52 2020
 OS/Arch:           linux/amd64
 Experimental:      false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

ming@KITM-7664:~$ systemctl status docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

ming@KITM-7664:~$ systemctl start docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

ming@KITM-7664:~$ sudo /etc/init.d/docker start
 * Starting Docker: docker                                                                                       [ OK ]

ming@KITM-7664:~$ docker version
Client: Docker Engine - Community
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:02:52 2020
 OS/Arch:           linux/amd64
 Experimental:      false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
over 4 years ago · Hanz Gallego
12 Respostas
Responde à pergunta

0

I'm also get this error when i try to run the docker-compose and docker desktop is turn off, i think that is bug in docker-compose that not notify the user it that the problem is becuse the docker service is down, same as the docker cli that throw correct error:

C:\Users\x\IdeaProjects\mongo-exmple>docker pull node
Using default tag: latest
error during connect: This error may indicate that the docker daemon is not running.: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/images/create?fromImage=node&tag=latest": open //./pipe/docker_engine: The system cannot find 
the file specified.
over 4 years ago · Hanz Gallego Relatório

0

I had a similar issue and it turned out to be due to Docker server not running. I started the app and then ran docker-compose up and it started working fine. Hope it helps anyone who's caught in a similar situation. :-)

over 4 years ago · Hanz Gallego Relatório

0

sudo service docker start or
sudo service docker restart

over 4 years ago · Hanz Gallego Relatório

0

I had the same problem but I managed to solve it when I ran docker server.

over 4 years ago · Hanz Gallego Relatório

0

set the permission like this,

sudo chmod 666 /var/run/docker.sock
over 4 years ago · Hanz Gallego Relatório

0

By default, the docker command can only be run the root user or by a user in the docker group, which is automatically created during Docker’s installation process. If you want to avoid typing sudo whenever you run the docker command, add your username to the docker group:

sudo usermod -aG docker ${USER}

To apply the new group membership, log out of the server and back in, or type the following:

su - ${USER}

You will be prompted to enter your user’s password to continue.

over 4 years ago · Hanz Gallego Relatório

0

You don't have permission to use the docker socket, by default only the docker group can access it. You can verify this with ls -l /var/run/docker.sock, which will print something like:

srw-rw----. 1 root docker 0 Oct  4 18:04 /var/run/docker.sock

To be able to access the socket and use Docker, add yourself to the Docker group with the following command:

sudo usermod -a -G docker $(whoami)

Then logout and back in. Docker will now work.

over 4 years ago · Hanz Gallego Relatório

0

At Linux (at least Ubuntu 18.04.x), you sometimes need to log out and re-login your X user session. Logging out of bash or out of the terminal window and re-logging in is not enough, see for example https://askubuntu.com/questions/1161020/groups-and-groups-user-show-different-groups-dialout-is-missing

over 4 years ago · Hanz Gallego Relatório

0

Are you sure docker is running on your system? You can get that error when compose is not able to connect to docker via docker socket (if any other way for connection is not defined).

If you are running on linux, usually you can run systemctl status docker to check if docker daemon is running and systemctl start docker to start it.

It would help to tell what OS and docker version are you using.

over 4 years ago · Hanz Gallego Relatório

0

In Windows exiting from Docker and running it again sometimes helps. Apparently not always docker starts up properly.

over 4 years ago · Hanz Gallego Relatório

0

Just had the same issue after updating Windows Docker desktop to it's latest version (20.10.2, build 2291f61). It happened that this update disabled the WSL2 integration with my virtual Ubuntu 18.04, which I use to run most projects.

I solved it this way:

  1. Open Docker Desktop
  2. Go to Settings > Resources > WSL Integration
  3. Make sure that your distribution is enabled
  4. Restart Docker
  5. Without the need of restarting WSL2, docker should work again

Docker Desktop distro integration

over 4 years ago · Hanz Gallego Relatório

0

When used WSL (Windows Subsystem for Linux) need to enable 'WSL Integration' for required distro in Windows Docker Desktop (Settings -> Resources-> WSL Integration -> Enable integration with required distros).

WSL Integration

over 4 years ago · Hanz Gallego Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda