docker / docker/docker-py

Container.wait with timeout raises Connection Error

Open
#1,966 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

    container = docker_client.containers.run(image = image, 
                                             command = cmd,
                                             detach = True, 
                                             auto_remove = False,
                                             )

container.wait(timeout = 10)

Without a timeout, everything works fine. With a timeout I get the following Exception:
ConnectionError(ReadTimeoutError('None: None',),)

The API says it should be raising a requests.exceptions.ReadTimeout

Name: docker
Version: 2.7.0
Summary: A Python library for the Docker Engine API.
Home-page: https://github.com/docker/docker-py
Author: Joffrey F
Author-email: joffrey@docker.com
License: Apache License 2.0
Location: /usr/local/lib/python3.6/site-packages
Requires: six, websocket-client, requests, docker-pycreds

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 the Container.wait entry point and reproduce the behavior with the shown detached container and timeout=10 example. Trace the timeout exception handling and verify that a timed-out wait raises requests.exceptions.ReadTimeout rather than ConnectionError.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.