docker / docker/docker-py

NotFound where ImageNotFound exception expected

Open
#3,095 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello! If I asked docker-py's container.run() method to launch a container that didn't exist, I'd expect a docker.errors.ImageNotFound exception based on the docs. This holds true if the Docker ID doesn't exist, but when the ID exists and the repo name doesn't, I instead get docker.errors.NotFound.

To reproduce this, run:

self.client.containers.run("<realuser>/<fakerepo>", auto_remove=True, detach=True, name="whatever")

or

self.client.containers.run("<realuser>/<fakerepo>:<whatevertag>", auto_remove=True, detach=True, name="whatever")

I'm running Ubuntu 20.04, Python 3.8.10, docker-py==6.0.1, and docker version:

Client:
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.2
 Git commit:        20.10.12-0ubuntu2~20.04.1
 Built:             Wed Apr  6 02:14:38 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.2
  Git commit:       20.10.12-0ubuntu2~20.04.1
  Built:            Thu Feb 10 15:03:35 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.5.9-0ubuntu1~20.04.6
  GitCommit:        
 runc:
  Version:          1.1.0-0ubuntu1~20.04.2
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        

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 with ContainerCollection.run and the documented ImageNotFound behavior. Reproduce the issue using the real-user/fake-repo image names shown, then trace how the Docker Engine response becomes NotFound. Done means the missing repository case raises ImageNotFound consistently with the documented behavior and is covered by a regression test.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.