docker / docker/docker-py

client.ping() now returns a DockerException rather than a ConnectionError if the Docker daemon cannot be reached

Open
#2,881 3 comments 0 reactions 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

For the last several releases (since 4.3.1), DockerClient.ping() has raised a docker.errors.DockerException rather than the previously seen pass through of the requests.exceptions.ConnectionError.

A git bisect shows the change occurred in commit 727080b3cca846a28d5436bed861359c9742c7e1 which landed between v4.3.0 and v4.3.1. The log for this commit doesn't mention this API change as part of the intent, so I suspect it was accidental.

Would like to know if this should be fixed, or should be considered correct behavior and the handling of requests.exceptions.ConnectionError be removed from consuming code and replaced with docker.errors.DockerException.

Versions Affected: v4.3.1 to v5.0.0
Python Version Tested: 3.9.6
Docker Daemon Version: N/A

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 at DockerClient.ping() and inspect commit 727080b3cca846a28d5436bed861359c9742c7e1, which introduced the changed exception behavior between v4.3.0 and v4.3.1. Compare the current behavior with the previously observed requests.exceptions.ConnectionError handling. Done means the intended public exception behavior is decided and the issue is resolved or documented consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.