docker / docker/docker-py

pull call doesn't raise an exception when image is not found.

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

stack@vagrant:~$ sudo python
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from docker import Client
cli = Client(base_url='unix:///var/run/docker.sock')
cli.pull('ngout')
u'{"status":"Pulling repository docker.io/library/ngout"}\r\n{"errorDetail":{"message":"Error: image library/ngout not found"},"error":"Error: image library/ngout not found"}\r\n'
cli.create_container('ngout')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 119, in create_container
return self.create_container_from_config(config, name)
File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 130, in create_container_from_config
return self._result(res, True)
File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 150, in _result
self._raise_for_status(response)
File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 145, in _raise_for_status
raise errors.NotFound(e, response, explanation=explanation)
docker.errors.NotFound: 404 Client Error: Not Found ("No such image: ngout:latest")

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 Client.pull('ngout') against the Docker Engine API and trace how the pull response is handled. The issue is done when a missing image causes pull to raise an appropriate exception instead of returning the error response as a string.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.