Bug 1705019

Summary: Avoid error when collecting logs on data-centers with no hosts active
Product: Red Hat Enterprise Virtualization Manager Reporter: Germano Veit Michel <gveitmic>
Component: ovirt-log-collectorAssignee: Douglas Schilling Landgraf <dougsland>
Status: CLOSED ERRATA QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.3.1CC: dougsland, lleistne, mgoldboi
Target Milestone: ovirt-4.3.5Keywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-log-collector-4.3.3-1.el7ev Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-12 11:55:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1723789    

Description Germano Veit Michel 2019-05-01 06:48:26 UTC
Description of problem:

Due to my own https://gerrit.ovirt.org/#/c/91979/, if a DC has no hosts in Up state, ovirt-log-collector will print an error message on the screen due to the dump_chains dictionary not containing the key with the data center name.

Just the collection thread for the host raises the exception, log collection seems to work regardless. But the error on the screen is not nice.

Version-Release number of selected component (if applicable):
ovirt-log-collector-4.3.2-1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create DC
2. Add a host to DC, keep it in maintenance

Actual results:

About to collect information from 3 hypervisors. Continue? (Y/n): INFO: Data center 'Default' volume chains to be collected by 'host1.rhvlab'
INFO: Gathering information from selected hypervisors...
INFO: collecting information from host3.rhvlab
INFO: collecting information from host1.rhvlab
ERROR: 'EmptyDC'
Use the -h option to see usage.

Comment 1 Germano Veit Michel 2019-05-01 06:49:25 UTC
I have the patch ready, just let me run some more tests with empty DCs/Clusters and things in down state to ensure there are no other problems with this. Will send it to gerrit soon.

Comment 2 Germano Veit Michel 2019-05-01 06:55:38 UTC
Patch up for review, but I want to run more tests.

Comment 3 Germano Veit Michel 2019-05-02 02:35:15 UTC
I ran same more tests and it looks fine.

Douglas, could you please help with the reviews and 4.3.z this? I'm going on leave in a few hours.

Comment 4 Sandro Bonazzola 2019-06-21 13:53:41 UTC
Douglas, anything missing for closing this bug? all referenced patches are merged.

Comment 6 Lucie Leistnerova 2019-07-16 12:26:25 UTC
Logs collected with no error on DC with no UP host.

verified in ovirt-log-collector-4.3.3-1.el7ev.noarch

Comment 8 errata-xmlrpc 2019-08-12 11:55:10 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/RHEA-2019:2443