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

Bug 918020

Summary: [RHEVM] [rhevm-log-collector] cannot collect logs if HOST is specified
Product: Red Hat Enterprise Virtualization Manager Reporter: Martin Pavlik <mpavlik>
Component: ovirt-engine-log-collectorAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED ERRATA QA Contact: Ilanit Stein <istein>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: acathrow, alourie, dyasny, gklein, iheim, knesenko, mgoldboi, Rhev-m-bugs, sgrinber, thildred, ykaul
Target Milestone: ---   
Target Release: 3.2.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, using the rhevm-log-collector utility with the "-H" parameter to specify a specific host caused the utility to fail, citing "'str' object has no attribute 'gluster_enabled'". The host list specified with the "-H" parameter was passed with the wrong type to a method in the utility. Now, hosts that are specified to the rhevm-log-collector utility using the "-H" parameter are correctly used to filter the list of possible hosts to collect logs from.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-10 20:08:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Pavlik 2013-03-05 10:22:42 UTC
Description of problem:
if rhevm log collector is used with host specified e.g.
rhevm-log-collector -H dell-05
it ends up with
ERROR: 'str' object has no attribute 'gluster_enabled'
Use the -h option to see usage.

Version-Release number of selected component (if applicable):
rhevm-log-collector-3.2.0-1.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. try to run rhevm-log-collector with -H option
  
Actual results:
ERROR: 'str' object has no attribute 'gluster_enabled'
Use the -h option to see usage.

Expected results:
logs collected

Additional info:

using host IP fails as well

if paramter -H is not used, logs are collected from all hypervisors correctly

[root@mp-rhevm32 ~]# rhevm-log-collector -H dell-05
About to collect information from 1 hypervisors. Continue? (Y/n): y
INFO: Gathering information from selected hypervisors...
ERROR: 'str' object has no attribute 'gluster_enabled'
Use the -h option to see usage.

[root@mp-rhevm32 ~]# rhevm-log-collector -v -H dell-05
DEBUG: found existing pgpass file, fetching DB admin value
DEBUG: found existing pgpass file, fetching DB pass value
DEBUG: found existing pgpass file, fetching DB host value
DEBUG: found existing pgpass file, fetching DB port value
About to collect information from 1 hypervisors. Continue? (Y/n): y
INFO: Gathering information from selected hypervisors...
ERROR: 'str' object has no attribute 'gluster_enabled'
Use the -h option to see usage.
DEBUG: Configuration:
DEBUG: command: collect
DEBUG: Traceback (most recent call last):
DEBUG:   File "/usr/bin/rhevm-log-collector", line 1099, in <module>
DEBUG:     collector.get_hypervisor_data()
DEBUG:   File "/usr/bin/rhevm-log-collector", line 848, in get_hypervisor_data
DEBUG:     gluster_enabled=cluster.gluster_enabled)
DEBUG: AttributeError: 'str' object has no attribute 'gluster_enabled'

Comment 1 Sandro Bonazzola 2013-03-18 16:27:57 UTC
For some reason, the external bug tracker field is not editable.
Patch pushed upstream: http://gerrit.ovirt.org/13149

Comment 3 Ilanit Stein 2013-04-07 10:14:19 UTC
Checked on sf-13:

rhevm-log-collector -H worked OK when using host IP,
but when I used FQDN, It gives the message:
"INFO: No hypervisors were selected, therefore no hypervisor data will be collected."

log:


[root@istein-32 yum.repos.d]# rhevm-log-collector -H cyan-vdse.qa.lab.tlv.redhat.com
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
INFO: No hypervisors were selected, therefore no hypervisor data will be collected.
Please provide the password for the PostgreSQL user, postgres, to dump the engine PostgreSQL database instance (CTRL+D to skip): Exiting on user cancel.

[root@istein-32 yum.repos.d]# rhevm-log-collector -H 10.35.109.14
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
About to collect information from 1 hypervisors. Continue? (Y/n): Y
INFO: Gathering information from selected hypervisors...
INFO: collecting information from 10.35.109.14
INFO: finished collecting information from 10.35.109.14
Please provide the password for the PostgreSQL user, postgres, to dump the engine PostgreSQL database instance (CTRL+D to skip): 
INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost...
INFO: Gathering oVirt Engine information...
INFO: Log files have been collected and placed in /tmp/logcollector-t2Iklx/sosreport-LogCollector-qaredhat.com-20130407130731-1366.tar.xz.
      The MD5 for this file is b4196f38fccf82d2f271ccc106901366 and its size is 74.7M

Comment 4 Sandro Bonazzola 2013-04-08 12:11:24 UTC
Hi Ilanit, I can't reproduce the issue:

# engine-log-collector -H sbonazzo.csb
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
About to collect information from 1 hypervisors. Continue? (Y/n): y
INFO: Gathering information from selected hypervisors...
INFO: collecting information from sbonazzo.csb
INFO: finished collecting information from sbonazzo.csb

Is the hypervisor cyan-vdse.qa.lab.tlv.redhat.com managed by RHEVM ?
Can cyan-vdse.qa.lab.tlv.redhat.com be resolved?

Comment 5 Ilanit Stein 2013-04-08 13:33:01 UTC
Hi Sandro,

I am not aware of any problem with the host fqdn,
but IMHO even if there was such a problem,
There should be an error indicating that, instead of 
"INFO: No hypervisors were selected, therefore no hypervisor data will be collected."
I searched the engine-log-collector.log, or tried run in verbose mode, but I didn't see any failure regarding this host.

Comment 6 Sandro Bonazzola 2013-04-08 14:32:55 UTC
You're right.
log-collector just filter the list of hypervisors provided by the engine, so if in the engine the hypervisor is listed as ip address, it will be collected only if you specify the same ip address. In my case the hypervisor is registered using the fqdn so it match only if i provide the fqdn as -H argument.

I think I'll have to add some logic on resolving fqdn and reverse resolving ip address but I also think this is a separate bug. the original issue is a crash of the application if you used -H. Can you open a new bug about this issue?

As a workaround, I'll add an error message if the specified hosts are not known by the engine.

Comment 7 Cheryn Tan 2013-04-09 04:28:05 UTC
This bug is currently attached to errata RHEA-2013:14554. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.

* Consequence: What happens when the bug presents.

* Fix: What was done to fix the bug.

* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes

Thanks in advance.

Comment 9 Ilanit Stein 2013-04-10 06:36:41 UTC
(In reply to comment #6)
> You're right.
> log-collector just filter the list of hypervisors provided by the engine, so
> if in the engine the hypervisor is listed as ip address, it will be
> collected only if you specify the same ip address. In my case the hypervisor
> is registered using the fqdn so it match only if i provide the fqdn as -H
> argument.
> 
> I think I'll have to add some logic on resolving fqdn and reverse resolving
> ip address but I also think this is a separate bug. the original issue is a
> crash of the application if you used -H. Can you open a new bug about this
> issue?
> 
> As a workaround, I'll add an error message if the specified hosts are not
> known by the engine.

The new bug opened for this - Bug 950336

Comment 10 Sandro Bonazzola 2013-04-10 13:10:19 UTC
patch for ensuring that the hosts specified with -H are listed by the engine merged 
- upstream master: http://gerrit.ovirt.org/gitweb?p=ovirt-log-collector.git;a=commit;h=dd7085ce5054f8306749b81674ab7ef4cb2423b1

- upstream 3.2 branch: http://gerrit.ovirt.org/gitweb?p=ovirt-log-collector.git;a=commit;h=a824a92bb7f6084bf4b8eb59b8fbe9dd77741622

Comment 12 Ilanit Stein 2013-05-21 06:17:54 UTC
Moving bu to verified due to comment #6

Comment 13 errata-xmlrpc 2013-06-10 20:08:25 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.

http://rhn.redhat.com/errata/RHBA-2013-0918.html