Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1402389

Summary: No error handler on invalid docker registry name
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Irina Gulina <igulina>
Component: ToolsAssignee: RHUI Bug List <rhui-bugs>
Status: CLOSED ERRATA QA Contact: Irina Gulina <igulina>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.0.0CC: pcreech
Target Milestone: ---   
Target Release: 3.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-01 22:14:36 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 Irina Gulina 2016-12-07 12:32:41 UTC
Description of problem:
If '_', [space], '(', ')', '@', etc and non English characters are used in the container's name to search for in the registry, an unexpected error occurs and a traceback is in logs. The error is the same if the entered container's name is alphanumeric (with possible '.', '-' or '/') but doesn't exist in the registry.

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

How reproducible:
always

Steps to Reproduce:
1. 'ad' add a new Red Hat docker container
2. type 'test' or 'rhel10' when prompted for name of the container in the registry
3. also try names with non alphanumeric characters beside '.', '-' and '/'

Actual results:

>> rhui (repo) => ad

Name of the container in the registry: 
rhel10


An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.

2016-12-07 07:11:48,022 - <type 'exceptions.NameError'>
2016-12-07 07:11:48,023 - Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 88, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 127, in listen
    Shell.listen(self)
  File "/usr/lib/python2.7/site-packages/rhui/common/shell.py", line 186, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.7/site-packages/rhui/tools/screens/repo.py", line 205, in add_docker
    if docker_utils.is_valid_docker_upstream(upstream_name):
  File "/usr/lib/python2.7/site-packages/rhui/common/docker_utils.py", line 13, in is_valid_docker_upstream
    LOG.debug(_('Failed to connect to upstream registry %s' % url ))
NameError: global name '_' is not defined

>> rhui (repo) => ad

Name of the container in the registry: 
rhel7(rpms)   


An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.



Expected results:
"There is no such container in the registry."

Comment 3 Patrick Creech 2016-12-15 19:10:37 UTC
This appears to have been fixed as a side effect for BZ1393801

Comment 4 Irina Gulina 2016-12-16 12:00:14 UTC
iso 20161215

>> ad

Name of the container in the registry: 
test

Could not find test on registry https://registry.access.redhat.com, please make sure that the name is valid

Name of the container in the registry: 
rhel10

Could not find rhel10 on registry https://registry.access.redhat.com, please make sure that the name is valid

Name of the container in the registry: 
rhel*y

Could not find rhel*y on registry https://registry.access.redhat.com, please make sure that the name is valid

Name of the container in the registry: 
rhel@6

Could not find rhel@6 on registry https://registry.access.redhat.com, please make sure that the name is valid

Name of the container in the registry: 
rhel7(rpms) 

Could not find rhel7(rpms) on registry https://registry.access.redhat.com, please make sure that the name is valid

Name of the container in the registry:

Comment 5 errata-xmlrpc 2017-03-01 22:14:36 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-2017:0367