Bug 1377258 - rhui-manager crashes if the hostname of a CDS or LB instance which is being added can't be resolved
Summary: rhui-manager crashes if the hostname of a CDS or LB instance which is being a...
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
medium
medium
Target Milestone: ---
: 3.0.0
Assignee: bizhang
QA Contact: Radek Bíba
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-19 10:14 UTC by Radek Bíba
Modified: 2017-03-01 22:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-01 22:13:16 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 Radek Bíba 2016-09-19 10:14:03 UTC
Description of problem:
SSIA. Happened to me because I mistyped the CDS hostname using a non-English keyboard layout.

Version-Release number of selected component (if applicable):
rh-rhui-tools-pre.3.0.21-1.el7ui.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run rhui-manager. Authenticate if necessary.
2. Enter 'c' to go to the CDS settings. (Or 'l' for LB settings.)
3. Enter 'a' to launch the new CDS wizard.
4. Enter a hostname that doesn't resolve. I used 'cdsé02.example.com' by mistake and didn't notice the warning I got immediately.
5. Also enter a (valid) username and path to your SSH private key, as usual.

Actual results:
Failure. rhui-manager stops running and I'm back in the shell. Scrollback buffer:

======
Hostname of the CDS instance to register:
cds02.example.com
======
^ Here the hostname looks correct, but that's only because the backspace key I used to get rid of the erroneously entered é didn't really delete that character from the prompt.

======
/usr/lib/python2.7/site-packages/rhui/tools/screens/instances.py:156: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if hostname in [instance[constants.INSTANCE_HOSTNAME_KEY] for instance in instance_config]:
Username with SSH access to cdsé02.example.com and sudo privileges:
ec2-user

Absolute path to an SSH private key to log into cdsé02.example.com as ec2-user:
/root/.ssh/id_rsa_rhua

/usr/lib/python2.7/site-packages/rhui/tools/screens/instances.py:209: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if hostname in [instance[constants.INSTANCE_HOSTNAME_KEY] for instance in instance_config]:

Checking that instance ports are reachable...
[localhost] local: yum install -y nc
[localhost] local: nc cdsé02.example.com 22 < /dev/null

Fatal error: local() encountered an error (return code 2) while executing 'nc cdsé02.example.com 22 < /dev/null'

Aborting.
[root@rhua ~]#
======

Expected results:
rhui-manager shouldn't be aborted. I should stay at the CDS screen.

Comment 2 Radek Bíba 2016-11-23 12:44:50 UTC
Bihan,

With the update included in ISO 20161122, rhui-manager doesn't terminate, but I get the following output:

====
[localhost] local: nc asd.example.com 22 < /dev/null

Fatal error: local() encountered an error (return code 2) while executing 'nc asd.example.com 22 < /dev/null'

Aborting.

Something happened, check the log file for more information: ~/.rhui/rhui.log
====

The log file then contains a traceback with the same message in a RhuiException. The message doesn't say what kind of error occurred, which one would see if they ran nc by hand:

# nc asd.example.com 22 < /dev/null
Ncat: Could not resolve hostname "asd.example.com": Name or service not known. QUITTING.

Is the unspecified error and the reference to the log file containing only the traceback all that could be reasonably reported to the user? Or could rhui-manager be more informative?

Comment 3 bizhang 2016-12-05 13:56:25 UTC
Radek,

We are currently capture the error message returned from the fabric api. Since it doesn't return the default nc error message there's really no way for us to capture and display the nc error message.

I think the RHUI error message in the log file is sufficient as it does state that it failed to connect to a server... 

RhuiException: Failed to connect to adsf.example.com: local() encountered an error (return code 2) while executing 'nc adsf.example.com 22 < /dev/null'.

Comment 4 Radek Bíba 2016-12-05 14:10:59 UTC
Okay, thanks for clarifying that.

Comment 5 errata-xmlrpc 2017-03-01 22:13:16 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.