docker / docker/docker-py

Error response from daemon: rpc error: code = DeadlineExceeded desc = context deadline exceeded

Open
#2,649 0 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

Hello!
Thanks for the Python SDK for Docker. It is much better than bare bash =))
I have faced with an issue: Error response from daemon: rpc error: code = DeadlineExceeded desc = context deadline exceeded

Steps to reproduce:

  1. docker stack deploy ..
DOCKER_HOST = cli_args[1]
branch = cli_args[2]
os.environ['DOCKER_HOST'] = "tcp://{0}".format(DOCKER_HOST)
now = datetime.utcnow()
utc_time = now.strftime("%d/%m/%Y %H:%M:%S")

client = docker.from_env()
services = client.services.list()

for service in services:
    current_labels = service.attrs['Spec']['Labels']
    labels = {**current_labels, **{'branch': branch, 'deploy_time': utc_time}}
    service.update(labels=labels)
    print("Update {0}".format(service.name))
    print(service.attrs['Spec']['Labels'])

System info:

Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:45:36 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.1
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.5
  Git commit:       74b1e89
  Built:            Thu Jul 25 21:19:41 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

P/S it's some kind of heisenbug cause disappears from time to time. probably some timeout issues 🍙

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 reported services.list() and service.update() sequence against the Docker Engine versions and tcp:// host described in the report. Inspect the SDK path used by service.update and compare behavior when the intermittent DeadlineExceeded error occurs; done means identifying a reproducible cause or a confirmed SDK-level fix with coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.