Bug 1190224

Summary: Incorrect error message on docker repository creation
Product: Red Hat Satellite Reporter: sthirugn <sthirugn>
Component: HammerAssignee: David Davis <daviddavis>
Status: CLOSED ERRATA QA Contact: sthirugn <sthirugn>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbuckingham, bkearney, daviddavis, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 05:23:53 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:
Bug Depends On:    
Bug Blocks: 1190289    

Description sthirugn@redhat.com 2015-02-06 17:16:03 UTC
Description of problem:
Incorrect error message on docker repository creation

Version-Release number of selected component (if applicable):
Version: Satellite-6.1.0-RHEL-7-20150205.0

How reproducible:
Always

Steps to Reproduce:
hammer> repository create --name='dockerrepo4' --content-type='docker' --url='https://registry.hub.docker.com' --product='testproduct3' --organization-id=1
Could not create the repository:
  Validation failed: Repository URL and Upstream Name cannot be empty. Both are required for syncing from the upstream.


Actual results:
As shown above

Expected results:
Could not create the repository:
  Validation failed: Upstream Name cannot be empty.

Additional info:

Comment 2 David Davis 2015-02-11 17:23:55 UTC
This is the intended behavior I believe. To create a docker repo you must supply either both the upstream name and url:

h repository create --name='dockerrepo4' --content-type='docker' --url='https://registry.hub.docker.com' --product='testproduct3' --organization-id=1 --docker-upstream-name=centos

Or neither:

h repository create --name='dockerrepo4' --content-type='docker' -product='testproduct3' --organization-id=1

Comment 3 sthirugn@redhat.com 2015-02-11 17:30:25 UTC
I expected a more smarter error message for usability:

Current error message for the scenario I mentioned in the bug is:
"Could not create the repository:
  Validation failed: Repository URL and Upstream Name cannot be empty. Both are required for syncing from the upstream."

Note that I already provided Repository URL.  So I expected error message to be something like:
"Could not create the repository:
  Validation failed: Upstream Name cannot be empty when Repository URL is provided. Both are required for syncing from the upstream."

Comment 4 David Davis 2015-02-18 20:37:19 UTC
Talked with sthirugn. The latest compose should say this:

"Validation failed: Docker upstream name cannot be blank. Either provide all or no sync information. Repository URL or Upstream Name is empty. Both are required for syncing from the upstream."

Comment 6 sthirugn@redhat.com 2015-02-18 20:54:21 UTC
Verified.

Version Tested:
Satellite-6.1.0-RHEL-6-20150217.0

hammer> repository create --name='dockerrepo1' --content-type='docker' --product='testproduct1' --organization-id=1 --docker-upstream-name='fedora/ssh'
Could not create the repository:
  Validation failed: Url cannot be blank. Either provide all or no sync information., Repository URL or Upstream Name is empty. Both are required for syncing from the upstream.



hammer> repository create --name='dockerrepo4' --content-type='docker' --url='https://registry.hub.docker.com' --product='testproduct1' --organization-id=1
Could not create the repository:
  Validation failed: Docker upstream name cannot be blank. Either provide all or no sync information., Repository URL or Upstream Name is empty. Both are required for syncing from the upstream.

Comment 7 Bryan Kearney 2015-08-11 13:30:16 UTC
This bug is slated to be released with Satellite 6.1.

Comment 8 errata-xmlrpc 2015-08-12 05:23:53 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/RHSA-2015:1592