docker / docker/docker-py

DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Open
#3,219 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

env
google colab

steps

!apt update
!apt install -y docker.io
pip install -U docker
import docker

execute

client = docker.from_env()
client

result

FileNotFoundError                         Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
    790             # Make the request on the HTTPConnection object
--> 791             response = self._make_request(
    792                 conn,

29 frames
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

ProtocolError                             Traceback (most recent call last)
ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

The above exception was the direct cause of the following exception:

DockerException                           Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/docker/api/client.py](https://localhost:8080/#) in _retrieve_server_version(self)
    218             ) from ke
    219         except Exception as e:
--> 220             raise DockerException(
    221                 f'Error while fetching server API version: {e}'
    222             ) from e

DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

best regards

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Google Colab steps and the client = docker.from_env() entry point. Read docker/api/client.py around _retrieve_server_version and determine whether the failure is caused by the reported environment or by the library. Done means the issue has a confirmed cause and a justified library change or documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.