Bug 1593795 - Registry returns 500 instead of 404 when image stream does not exist
Summary: Registry returns 500 instead of 404 when image stream does not exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 3.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.10.z
Assignee: Alexey Gladkov
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-21 15:22 UTC by Clayton Coleman
Modified: 2018-10-17 06:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-31 06:18:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2376 0 None None None 2018-08-31 06:18:58 UTC

Description Clayton Coleman 2018-06-21 15:22:26 UTC
Tried to pull an image from an image stream that didn't exist.  Got a 500 untyped error instead of a typed 404 error.

time="2018-06-21T15:16:04.856071022Z" level=error msg="failed to get image stream: imagestreams.image.openshift.io \"stable\" not found" go.version=go1.9 instance.id=6b13d0eb-3395-4aab-b127-8353c94afe5a
time="2018-06-21T15:16:04.856210061Z" level=error msg="response completed with error" err.code=unknown err.detail="unknown repository name=ci-op-km7lxqdt/stable" err.message="unknown error" go.version=go1.9 http.request.host=registry.svc.ci.openshift.org http.request.id=c49af069-97e8-4ba0-9158-7fcc54408053 http.request.method=GET http.request.remoteaddr=172.16.226.1 http.request.uri=/v2/ci-op-km7lxqdt/stable/manifests/base http.request.useragent="docker/1.13.1 go/go1.8.3 kernel/3.10.0-693.11.6.el7.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/1.13.1 \(darwin\))" http.response.contenttype="application/json; charset=utf-8" http.response.duration=9.54911ms http.response.status=500 http.response.written=100 instance.id=6b13d0eb-3395-4aab-b127-8353c94afe5a openshift.auth.user=smarterclayton openshift.auth.userid=06420fc6-3224-11e8-9696-42010a8e0003 vars.name=ci-op-km7lxqdt/stable vars.reference=base

High severity because this regresses the API.

I consider this either a release blocker or a must fix for the first z stream.  Don't know if it happens on 3.10

Comment 3 Wenjing Zheng 2018-08-22 10:11:41 UTC
Ben, there is no 500 return if cannot get imagestream, but I didn't set 404.

time="2018-08-22T09:32:38.752812984Z" level=error msg="remoteGet: unable to get image sha256:1388835bdf99817a746e1bf32c6398ec0c969c079ac650024ca933c59d44e2d6 in imagestream wzheng1/ruby-ex: ImageStream:NotFound: ResolveImageID: failed to get image stream wzheng1/ruby-ex: ImageStreamGetter:NotFound: wzheng1/ruby-ex: imagestreams.image.openshift.io \"ruby-ex\" not found" go.version=go1.9.4 http.request.host="docker-registry.default.svc:5000" http.request.id=0eb8765d-c346-422e-b1a8-0c8556a1e9d3 http.request.method=GET http.request.remoteaddr="10.129.0.1:33828" http.request.uri="/v2/wzheng1/ruby-ex/manifests/sha256:1388835bdf99817a746e1bf32c6398ec0c969c079ac650024ca933c59d44e2d6" http.request.useragent="docker/1.13.1 go/go1.8.3 kernel/3.10.0-693.21.1.el7.x86_64 os/linux arch/amd64 UpstreamClient(Go-http-client/1.1)" instance.id=4758c6c8-9f38-4b94-9454-88adf5bdc360 openshift.auth.user="system:serviceaccount:wzheng1:default" openshift.auth.userid=4138a592-a5ed-11e8-8c7a-42010af00015 vars.name=wzheng1/ruby-ex vars.reference="sha256:1388835bdf99817a746e1bf32c6398ec0c969c079ac650024ca933c59d44e2d6"

Here are my steps:
1. Import an image
2. Delete imagestream
3. Try to docker pull the imagestream

Comment 4 Ben Parees 2018-08-22 14:05:31 UTC
if you didn't get a 500 and you didn't get a 404, what did you get?

what is the docker pull output?

Comment 5 Wenjing Zheng 2018-08-23 07:31:37 UTC
I can get 404 if pull an unexcited images stream:
time="2018-08-23T07:28:19.09181677Z" level=error msg="response completed with error" err.code="name unknown" err.message="repository name not known to registry" go.version=go1.9.4 http.request.host="docker-registry.default.svc:5000" http.request.id=e4f97013-0d09-4d3d-87f2-62a8f25ce9fc http.request.method=GET http.request.remoteaddr="10.128.0.1:34506" http.request.uri=/v2/bug/test/manifests/latest http.request.useragent="docker/1.13.1 go/go1.8.3 kernel/3.10.0-693.21.1.el7.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/1.13.1 \(linux\))" http.response.contenttype="application/json; charset=utf-8" http.response.duration=12.368281ms http.response.status=404 http.response.written=87 instance.id=f2e29789-7fa2-48f3-8daf-a0aa592ebc66 openshift.auth.user=wzheng openshift.auth.userid=85c159a4-a6a5-11e8-98eb-42010af0003b vars.name=bug/test vars.reference=latest

Verified on v3.11.0-0.20.0.

Comment 7 errata-xmlrpc 2018-08-31 06:18:10 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.

https://access.redhat.com/errata/RHBA-2018:2376


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