Bug 1119579 - customize docker pull 404 error
Summary: customize docker pull 404 error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: William Henry
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1109938
TreeView+ depends on / blocked
 
Reported: 2014-07-15 06:07 UTC by Guohua Ouyang
Modified: 2019-03-06 00:46 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-18 20:46:19 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1266 normal SHIPPED_LIVE docker bug fix and enhancement update 2014-09-19 00:45:12 UTC

Description Guohua Ouyang 2014-07-15 06:07:18 UTC
Description of problem:
If the image does not exist, docker pull throws error "HTTP code: 404".
The 404 status code means the request page or resource does not exist, it's not so obviously that docker pull is requesting a web page although it does.  Make it more readable to all users would be better.

Suggest change the error message like git does:
$ git clone non-exist-repo
fatal: repository 'non-exist-repo' does not exist

docker pull current gives error:
# docker pull non-exist-image
2014/07/15 13:33:52 Error: HTTP code: 404

suggest change to:
# docker pull non-exist-image
2014/07/15 13:33:52 Error: image "non-exist-image" does not exist
or
2014/07/15 13:33:52 Error: image "non-exist-image" not found

Version-Release number of selected component (if applicable):
docker-1.0.0-10.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 William Henry 2014-07-15 19:11:31 UTC
So I would assume that it could be some other error besides 404. Should I be checking for other errors?

Right now I have it such that when I catch the error I check to see if it's actually a 404 and if it is I create a image not found message (as described above). And if it's not I just return what came back - presumably some other HTTP error.

Could there be other 40x or 50x errors? Should I have (pseudo):

if err
   if 404
      return "image not found"
   else
      return "unknown error"  // rather than return err

Comment 4 Daniel Walsh 2014-07-15 19:49:18 UTC
If we know of other return codes that are likely and could translate them, I would otherwise I would say.

if err
   if 404
      return "image not found"
   else
      return err

Comment 5 William Henry 2014-07-16 00:53:00 UTC
I have committed and pushed a PR upstream:

https://github.com/dotcloud/docker/pull/7043

Comment 7 Daniel Walsh 2014-07-22 16:22:31 UTC
Ok we will pull this into the next docker package after docker-1.1.1-2

Comment 8 Luwen Su 2014-08-05 09:14:46 UTC
Via docker-1.1.2-6.el7.x86_64

#docker pull not_exist
Pulling repository not_exist
2014/08/05 17:13:51 Error: image not_exist not found

Set Verified

Comment 9 errata-xmlrpc 2014-09-18 20:46:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1266.html


Note You need to log in before you can comment on or make changes to this bug.