Bug 1528613

Summary: Error pushing images with 3 levels of path, but filesystem directories are created
Product: OpenShift Container Platform Reporter: Sergi Jimenez Romero <sjr>
Component: Image RegistryAssignee: Alexey Gladkov <agladkov>
Status: CLOSED ERRATA QA Contact: Dongbo Yan <dyan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.5.1CC: agladkov, aos-bugs, bparees, fmarchio, smunilla
Target Milestone: ---   
Target Release: 3.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: There was no check of the number of components in the path. Consequence: The data was placed in the storage, but could not be written to the database. Fix: An early check of the path is added. Result: The bug is fixed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-28 14:16:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sergi Jimenez Romero 2017-12-22 11:58:20 UTC
Description of problem:

When pushing images that contains 3 slashes in their names,  an error 500 is shown, but the image repository is created in the registry FileSystem.  


Version-Release number of selected component (if applicable):

v3.5.5.31.24

How reproducible:
Always

Steps to Reproduce:
1. docker push registry.domain.tld/username-pusher/secondlevel/busybox:latest
2. received unexpected HTTP status: 500 Internal Server Error
3. oc -n default rsh docker-registry-16-wlg1c
4. ls -l /registry/docker/registry/v2/repositories/username-pusher/secondlevel/busybox


Actual results:

Filesystem directories are created.

Expected results:

Directories wouldn't be created.

Additional info:

Comment 1 Alexey Gladkov 2017-12-22 23:35:11 UTC
The integrated registry does not support multi-slashes in the image name. And never will be.

Comment 2 Sergi Jimenez Romero 2018-01-08 13:55:46 UTC
(In reply to Alexey Gladkov from comment #1)
> The integrated registry does not support multi-slashes in the image name.
> And never will be.

Alexey, thanks for the update, we do understand that, but why are the directories being created? I would assume that if I get an error while pushing the image with multi-slashes the directories wouldn't be created. That's what's being reported on this BZ.

Thanks.

Comment 3 Alexey Gladkov 2018-01-11 15:38:32 UTC
> we do understand that, but why are the directories being created?

Good catch! Thanks!

https://github.com/openshift/image-registry/pull/45

Comment 4 Ben Parees 2018-01-12 18:10:23 UTC
PR merged, moving to modified.

Comment 5 Sergi Jimenez Romero 2018-01-12 19:49:01 UTC
Thanks Ben! I just updated the customer.

Comment 7 Dongbo Yan 2018-01-26 07:58:22 UTC
Verified
openshift v3.9.0-0.24.0
kubernetes v1.9.1+a0ce1bc657
etcd 3.2.8

# docker push docker-registry-default.apps.com/dyan1/openshift3/pod:latest
The push refers to a repository [docker-registry-default.com/dyan1/openshift3/pod]
4cb898d8cb62: Preparing 
5f70bf18a086: Preparing 
unauthorized: repository name "dyan1/openshift3/pod" invalid: it must be of the format <project>/<name>

Comment 8 Dongbo Yan 2018-01-26 08:00:56 UTC
this is fixed in ocp v3.9, please attach in right errata, remove from v3.5 errata.
thanks

Comment 13 errata-xmlrpc 2018-03-28 14:16:17 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:0489