Bug 1402389 - No error handler on invalid docker registry name
Summary: No error handler on invalid docker registry name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.0.0
Assignee: RHUI Bug List
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-07 12:32 UTC by Irina Gulina
Modified: 2017-03-01 22:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-01 22:14:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0367 0 normal SHIPPED_LIVE Red Hat Update Infrastructure 3.0 Release 2017-03-02 03:05:22 UTC

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


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