Bug 1609667 - rhv-log-collector-analyzer does not provide any content in html report
Summary: rhv-log-collector-analyzer does not provide any content in html report
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-db-query
Version: 4.2.5
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ovirt-4.2.6
: ---
Assignee: Douglas Schilling Landgraf
QA Contact: Jiri Belka
URL:
Whiteboard:
Depends On:
Blocks: 1608328
TreeView+ depends on / blocked
 
Reported: 2018-07-30 07:16 UTC by Jiri Belka
Modified: 2018-09-04 13:47 UTC (History)
4 users (show)

Fixed In Version: engine-db-query-1.1.0-1.el7ev
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 13:47:08 UTC
oVirt Team: Integration
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1596009 0 high CLOSED [Rebase] rhv-log-collector-analyzer 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2018:2640 0 None None None 2018-09-04 13:47:13 UTC

Internal Links: 1596009

Description Jiri Belka 2018-07-30 07:16:17 UTC
Description of problem:

split from BZ1596009

---%>---
$ rhv-log-collector-analyzer /tmp/sosreport-LogCollector-20180725114347.tar.xz                                                                                                                                                                                         
/bin/rhv-log-collector-analyzer: line 126: [: : integer expression expected
Preparing environment:
======================
Temporary working directory is /temp/tmp.YPWDCNjf6J
Unpacking postgres data. This can take up to several minutes.
sos-report extracted into: /temp/tmp.YPWDCNjf6J/unpacked_sosreport
pgdump extracted into: /temp/tmp.YPWDCNjf6J/pg_dump_dir
Welcome to unpackHostsSosReports script!
Extracting sosreport from hypervisor slot-1.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-1.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-5a.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-5a.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-5c.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-5c.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-5d.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-5d.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-6a.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-6a.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-6b.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-6b.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-6c.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-6c.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-6d.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-6d.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-7a.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-7a.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-7b.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-7b.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-7c.rhev.lab.eng.brq.redhat.com in /temp/ovirt-log-collector-analyzer-hosts/slot-7c.rhev.lab.eng.brq.redhat.com

Creating a temporary database in /temp/tmp.YPWDCNjf6J/postgresDb/pgdata. Log of initdb is in /temp/tmp.YPWDCNjf6J/initdb.log

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
LOG:  redirecting log output to logging collector process
HINT:  Future log output will appear in directory "pg_log".
Importing the dump into a temporary database. Log of the restore process is in /temp/tmp.YPWDCNjf6J/db-restore.log

Generating reports:
===================
Generated analyzer_report.html

Cleaning up:
============
Stopping temporary database
Removing temporary directory /temp/tmp.YPWDCNjf6J

$ ls -l analyzer_report.html 
-rw-r--r--. 1 postgres postgres 30189 Jul 25 12:55 analyzer_report.html
# sed -n '/<body/,/<\/body/p' /var/lib/pgsql/analyzer_report.html 
<body class="article toc2 toc-left">
<div id="header">
<div id="toc" class="toc2">
<div id="toctitle">Table of Contents</div>

</div>
</div>
<div id="content">

</div>
<div id="footer">
<div id="footer-text">
Last updated 2018-07-25 12:55:26 CEST
</div>
</div>
</body>

# rpm -qf /bin/rhv-log-collector-analyzer
rhv-log-collector-analyzer-0.1.2-0.el7ev.noarch

Comment 1 Douglas Schilling Landgraf 2018-07-30 19:52:58 UTC
Hi Jiri, can I have access to sosreport file?

Comment 3 Douglas Schilling Landgraf 2018-08-07 03:25:43 UTC
Hi Jiri,

I tried to reproduce several times but still not able, I can see the HTML report  generated all time. Which version of engine-db-query are you using?

# su postgres
bash-4.2$ cd /tmp/
bash-4.2$ rhv-log-collector-analyzer sosreport-LogCollector-20180725114347.tar.xz
Preparing environment:
======================
Temporary working directory is /tmp/tmp.ieb7ixCiB5
Unpacking postgres data. This can take up to several minutes.
sos-report extracted into: /tmp/tmp.ieb7ixCiB5/unpacked_sosreport
pgdump extracted into: /tmp/tmp.ieb7ixCiB5/pg_dump_dir
Welcome to unpackHostsSosReports script!
Extracting sosreport from hypervisor slot-1.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-1.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-5a.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-5a.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-5c.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-5c.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-5d.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-5d.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-6a.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-6a.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-6b.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-6b.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-6c.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-6c.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-6d.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-6d.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-7a.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-7a.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-7b.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-7b.rhev.lab.eng.brq.redhat.com

Extracting sosreport from hypervisor slot-7c.rhev.lab.eng.brq.redhat.com in /tmp/ovirt-log-collector-analyzer-hosts/slot-7c.rhev.lab.eng.brq.redhat.com

Creating a temporary database in /tmp/tmp.ieb7ixCiB5/postgresDb/pgdata. Log of initdb is in /tmp/tmp.ieb7ixCiB5/initdb.log

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
LOG:  redirecting log output to logging collector process
HINT:  Future log output will appear in directory "pg_log".
Importing the dump into a temporary database. Log of the restore process is in /tmp/tmp.ieb7ixCiB5/db-restore.log

Generating reports:
===================
Generated analyzer_report.html

Cleaning up:
============
Stopping temporary database
Removing temporary directory /tmp/tmp.ieb7ixCiB5

$ du -sh analyzer_report.html 
232K	analyzer_report.html

$ elinks analyzer_report.html

$ rpm -qa | grep rhv-log-collector-analyzer
rhv-log-collector-analyzer-0.1.2-0.el7ev.noarch

$ rpm -qa | grep engine-db-query
engine-db-query-1.1.0-0.el7ev.noarch

Comment 4 Douglas Schilling Landgraf 2018-08-08 20:37:54 UTC
Looks like I have reproduced the issue.

Basically, if users run **in sequence**:

# rhv-log-collector-analyzer --live
(generated as root:root /tmp/engine-db-query.log)

and later:

# su postgres
$ rhv-log-collector-analyzer sosreport-file.tar.xz

(will fail to write into /tmp/engine-db-query.log) and will stop
the script as our bash script contain -e.  

Jiri, a simple test is:

Remove the -e from /usr/share/rhv-log-collector-analyzer/analyzer/produceReport/produceReport.sh and execute above, you will see errors like:

"""
IOError: [Errno 13] Permission denied: '/tmp/engine-db-query.log'
"""

I am already working in this enhancement for engine-db-query/rhv-log-collector-analyzer but please let me know if this is the same issue.

Thanks!

Comment 5 Jiri Belka 2018-08-13 07:28:31 UTC
(In reply to Douglas Schilling Landgraf from comment #4)
> Looks like I have reproduced the issue.
> 
> Basically, if users run **in sequence**:
> 
> # rhv-log-collector-analyzer --live
> (generated as root:root /tmp/engine-db-query.log)
> 
> and later:
> 
> # su postgres
> $ rhv-log-collector-analyzer sosreport-file.tar.xz
> 
> (will fail to write into /tmp/engine-db-query.log) and will stop
> the script as our bash script contain -e.  
> 
> Jiri, a simple test is:
> 
> Remove the -e from
> /usr/share/rhv-log-collector-analyzer/analyzer/produceReport/produceReport.
> sh and execute above, you will see errors like:
> 
> """
> IOError: [Errno 13] Permission denied: '/tmp/engine-db-query.log'
> """
> 
> I am already working in this enhancement for
> engine-db-query/rhv-log-collector-analyzer but please let me know if this is
> the same issue.
> 
> Thanks!

There's no point to test this - /tmp is world writtable, you _must_ use unique filename and not to assume your filename won't be there. An assumption is always wrong.

Comment 8 Jiri Belka 2018-08-17 13:05:16 UTC
ok, rhv-log-collector-analyzer-0.1.5-0.el7ev.noarch

# elinks -dump 1 /var/lib/pgsql/analyzer_report.html | sed -n '/Approximate version of initially installed engine/,+2p'
   Approximate version of initially installed engine

   3.1

Comment 10 errata-xmlrpc 2018-09-04 13:47:08 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-2018:2640


Note You need to log in before you can comment on or make changes to this bug.