Bug 1150073

Summary: Running hosted-engine --vm-status, when ovirt-ha-broker service stopped, drop exception
Product: Red Hat Enterprise Virtualization Manager Reporter: Artyom <alukiano>
Component: ovirt-hosted-engine-haAssignee: Doron Fediuck <dfediuck>
Status: CLOSED ERRATA QA Contact: Artyom <alukiano>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: bgraveno, dfediuck, gklein, jcoscia, lbopf, lsurette, mavital, msivak, sherold, ykaul
Target Milestone: ovirt-3.6.0-rcKeywords: Triaged, ZStream
Target Release: 3.6.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
When a self-hosted engine is unable to connect to the high availability daemon it now prints an error message instead of a stack trace.
Story Points: ---
Clone Of:
: 1219051 (view as bug list) Environment:
Last Closed: 2016-03-09 19:48:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1208458, 1213878, 1227466    
Bug Blocks: 1219051    

Description Artyom 2014-10-07 11:54:41 UTC
Description of problem:
Running hosted-engine --vm-status, when ovirt-ha-broker service stopped, drop exception

Version-Release number of selected component (if applicable):
ovirt-hosted-engine-ha-1.2.2-2.el6ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install hosted-engine environment with one host
2. Stop service ovirt-ha-broker
3. Run hosted-engine --vm-status

Actual results:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.6/site-packages/ovirt_hosted_engine_setup/vm_status.py", line 111, in <module>
    if not status_checker.print_status():
  File "/usr/lib/python2.6/site-packages/ovirt_hosted_engine_setup/vm_status.py", line 58, in print_status
    all_host_stats = ha_cli.get_all_host_stats()
  File "/usr/lib/python2.6/site-packages/ovirt_hosted_engine_ha/client/client.py", line 155, in get_all_host_stats
    return self.get_all_stats(self.StatModes.HOST)
  File "/usr/lib/python2.6/site-packages/ovirt_hosted_engine_ha/client/client.py", line 97, in get_all_stats
    with broker.connection():
  File "/usr/lib64/python2.6/contextlib.py", line 16, in __enter__
    return self.gen.next()
  File "/usr/lib/python2.6/site-packages/ovirt_hosted_engine_ha/lib/brokerlink.py", line 99, in connection
    self.connect()
  File "/usr/lib/python2.6/site-packages/ovirt_hosted_engine_ha/lib/brokerlink.py", line 78, in connect
    raise BrokerConnectionError(error_msg)
ovirt_hosted_engine_ha.lib.exceptions.BrokerConnectionError: Failed to connect to broker, the number of errors has exceeded the limit (5)


Expected results:
Some error message about that service down and impossible to run hosted-engine commands.

Additional info:

Comment 1 Jiri Moskovcak 2014-10-08 07:41:37 UTC
Like Artyom says, it should rather print some error message than the full exception.

Comment 3 Eyal Edri 2015-02-25 08:45:30 UTC
3.5.1 is already full with bugs (over 80), and since none of these bugs were added as urgent for 3.5.1 release in the tracker bug, moving to 3.5.2

Comment 4 Artyom 2015-04-26 14:19:29 UTC
Verified on: 
ovirt-hosted-engine-ha-1.3.0-0.0.master.20150316142823.20150316142819.git0c1bea5.el7.noarch

Run hosted-engine --vm-status, when ovirt-ha-broker stopped return:
Failed to connect to broker, the number of errors has exceeded the limit (5)
Cannot connect to the HA daemon, please check the logs.

Comment 9 errata-xmlrpc 2016-03-09 19:48:34 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://rhn.redhat.com/errata/RHEA-2016-0422.html