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

Bug 1525859

Summary: Clean metadata command raises Traceback
Product: [oVirt] ovirt-hosted-engine-setup Reporter: Artyom <alukiano>
Component: Plugins.GeneralAssignee: Denis Chaplygin <dchaplyg>
Status: CLOSED CURRENTRELEASE QA Contact: Polina <pagranat>
Severity: low Docs Contact:
Priority: medium    
Version: 2.2.1CC: bugs, lveyde, mgoldboi
Target Milestone: ovirt-4.2.2Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-hosted-engine-setup-2.2.10 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-29 11:14:54 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:

Description Artyom 2017-12-14 08:53:37 UTC
Description of problem:
Clean metadata command raises Traceback
ERROR:ovirt_hosted_engine_ha.agent.agent.Agent:Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/agent.py", line 131, in _run_agent
    return action(he)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/agent.py", line 58, in action_clean
    return he.clean(options.force_cleanup)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/hosted_engine.py", line 396, in clean
    if self._broker and self._broker.is_connected():
AttributeError: 'BrokerLink' object has no attribute 'is_connected'

Version-Release number of selected component (if applicable):
ovirt-hosted-engine-setup-2.2.1-1.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run hosted-engine --clean-metadata
2.
3.

Actual results:
ERROR:ovirt_hosted_engine_ha.agent.agent.Agent:Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/agent.py", line 131, in _run_agent
    return action(he)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/agent.py", line 58, in action_clean
    return he.clean(options.force_cleanup)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/hosted_engine.py", line 396, in clean
    if self._broker and self._broker.is_connected():
AttributeError: 'BrokerLink' object has no attribute 'is_connected'

Expected results:
No Tracebacks

Additional info:
I did not recognize that it somehow affect functionality of the command

Comment 1 Martin Sivák 2017-12-15 10:21:05 UTC
I think something similar will happen for reinitialize lockspace as well.

Comment 3 Polina 2018-02-20 07:25:14 UTC
verified on version rhv-release-4.2.2-1-001.noarch & rhel 7.5

hosted-engine --clean-metadata
INFO:ovirt_hosted_engine_ha.agent.agent.Agent:ovirt-hosted-engine-ha agent 2.2.5 started
INFO:ovirt_hosted_engine_ha.agent.hosted_engine.HostedEngine:Found certificate common name: 10.35.92.7
INFO:ovirt_hosted_engine_ha.agent.hosted_engine.HostedEngine:Initializing ha-broker connection
INFO:ovirt_hosted_engine_ha.agent.hosted_engine.HostedEngine:Broker initialized, all submonitors started
ERROR:ovirt_hosted_engine_ha.agent.hosted_engine.HostedEngine:Cannot clean unclean metadata block. Consider --force-clean.
INFO:ovirt_hosted_engine_ha.agent.agent.Agent:Agent shutting down
[root@alma07 ~]# systemctl status ovirt-ha-agent
● ovirt-ha-agent.service - oVirt Hosted Engine High Availability Monitoring Agent
   Loaded: loaded (/usr/lib/systemd/system/ovirt-ha-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-02-20 00:28:36 IST; 8h ago
 Main PID: 32045 (ovirt-ha-agent)
    Tasks: 2
   CGroup: /system.slice/ovirt-ha-agent.service
           └─32045 /usr/bin/python /usr/share/ovirt-hosted-engine-ha/ovirt-ha-agent

Comment 4 Sandro Bonazzola 2018-03-29 11:14:54 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.