Bug 1039747 - rhevm-log-collector does not collect database dump
Summary: rhevm-log-collector does not collect database dump
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-log-collector
Version: 3.3.0
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: 3.3.0
Assignee: Sandro Bonazzola
QA Contact: Dušan Kajan
URL:
Whiteboard: integration
Depends On:
Blocks: GSS_RHEV_33_BETA
TreeView+ depends on / blocked
 
Reported: 2013-12-09 21:55 UTC by Derrick Ornelas
Modified: 2014-03-31 01:27 UTC (History)
11 users (show)

Fixed In Version: rhevm-log-collector-3.3.1-5.el6ev
Doc Type: Bug Fix
Doc Text:
Previously it was possible to access the database through a UNIX socket as the PostgreSQL sosreport plugin did not handle identity authentication correctly. As a result, the rhevm-log-collector did not correctly gather an engine database dump. Now the access for the 'engine' user is limited to TCP connections, and the rhevm-log-collector always uses the database host.
Clone Of:
Environment:
Last Closed: 2014-01-21 17:01:12 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0039 0 normal SHIPPED_LIVE rhevm-log-collector bug fix and enhancement update 2014-01-21 21:52:46 UTC
oVirt gerrit 22245 0 None None None Never
oVirt gerrit 22317 0 None None None Never

Description Derrick Ornelas 2013-12-09 21:55:38 UTC
Description of problem:  The rhevm-log-collector utility does not correctly gather an 'engine' database dump because the postgresql sos plugin does not handle ident auth correctly


Version-Release number of selected component (if applicable):
rhevm-log-collector-3.3.1-4.el6ev (is26)


How reproducible:  100%


Steps to Reproduce:
1. Install is26
2. Configure engine with rhevm-setup
3. Run 'rhevm-log-collector'


Actual results:
archive created by rhevm-log-collector does not contain engine database dump

Expected results:
archive created by rhevm-log-collector contains engine database dump


Additional info:

Here's the output of running rhevm-log-collector with the verbose flag:
---
# rhevm-log-collector -v
INFO: Gathering oVirt Engine information...
DEBUG: calling(['sosreport', '--batch', '--report', '--build', '--tmp-dir=/tmp/logcollector-zlIcO8', '-o', 'engine,rpm,libvirt,general,networking,hardware,process,yum,filesys,devicemapper,selinux,kernel,apache,memory', '-k', 'rpm.rpmva=off', '-k', 'general.all_logs=True', '-k', 'apache.log=True'])
DEBUG: returncode(0)
DEBUG: STDOUT(
sosreport (version 2.2)


  This command will collect diagnostic and configuration
information from this Red Hat Enterprise Linux system and
installed applications.

  An archive containing the collected information will be
generated in /tmp/logcollector-zlIcO8 and may be provided
to a Red Hat support representative.

  Any information provided to Red Hat will be treated in
accordance with the published support policies at:


  https://access.redhat.com/support/

  The generated archive may contain data considered
sensitive and its content should be reviewed by the
originating organization before being passed to any third
party.

  No changes will be made to system configuration.


  Running plugins. Please wait ...

  Completed [14/14] ...      

  sosreport build tree is located at : /tmp/logcollector-zlIcO8/rhevdm33-2013120916071386623238

)
DEBUG: STDERR()
INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost...
DEBUG: calling(['/usr/sbin/sosreport', '--batch', '--report', '-o', 'postgresql', '--tmp-dir=/tmp/logcollector-zlIcO8/log-collector-data', '-k', 'postgresql.dbname=engine', '-k', 'postgresql.username=engine', '-k', 'postgresql.password=QjytYXZa'])
DEBUG: returncode(0)
DEBUG: STDOUT(
sosreport (version 2.2)


  This command will collect diagnostic and configuration
information from this Red Hat Enterprise Linux system and
installed applications.

  An archive containing the collected information will be
generated in /tmp/logcollector-zlIcO8/log-collector-data
and may be provided to a Red Hat support representative.

  Any information provided to Red Hat will be treated in
accordance with the published support policies at:


  https://access.redhat.com/support/

  The generated archive may contain data considered
sensitive and its content should be reviewed by the
originating organization before being passed to any third
party.

  No changes will be made to system configuration.


  Running plugins. Please wait ...

  Completed [1/1] ...      
Creating compressed archive...

Your sosreport has been generated and saved in:
  /tmp/logcollector-zlIcO8/log-collector-data/sosreport-rhn-support-dornelas-20131209160752-7ac2.tar.xz

The md5sum is: f78f03c975364e057f8e9fd711a97ac2

Please send this file to your support representative.

)
DEBUG: STDERR(Unable to execute pg_dump. Error(pg_dump: [archiver (db)] connection to database "engine" failed: FATAL:  Ident authentication failed for user "engine")
)
DEBUG: filename(sosreport-rhn-support-dornelas-20131209160752-7ac2.tar.xz)
DEBUG: path(/tmp/logcollector-zlIcO8/log-collector-data/sosreport-rhn-support-dornelas-20131209160752-7ac2.tar.xz)
DEBUG: checksum(f78f03c975364e057f8e9fd711a97ac2)
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
DEBUG: API Vendor(Red Hat)	API Version(3.3.0)
INFO: No hypervisors were selected, therefore no hypervisor data will be collected.
Creating compressed archive...
DEBUG: calling(['xz', '--version'])
DEBUG: returncode(0)
DEBUG: STDOUT(xz (XZ Utils) 4.999.9beta
liblzma 4.999.9beta
)
DEBUG: STDERR()
DEBUG: calling(['tar', '-cf', '/tmp/sosreport-LogCollector-20131209161327.tar', '-C', '/tmp/logcollector-zlIcO8', '.'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()
DEBUG: calling(['xz', '-1', '/tmp/sosreport-LogCollector-20131209161327.tar'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()
DEBUG: calling(['md5sum', '/tmp/sosreport-LogCollector-20131209161327.tar.xz'])
DEBUG: returncode(0)
DEBUG: STDOUT(5f06c762ab7f243ed8da831eb6b2533f  /tmp/sosreport-LogCollector-20131209161327.tar.xz
)
DEBUG: STDERR()
INFO: Log files have been collected and placed in /tmp/sosreport-LogCollector-20131209161327.tar.xz.
The MD5 for this file is 5f06c762ab7f243ed8da831eb6b2533f and its size is 5.9M
---


Here's the output of running the sosreport command used by rhevm-log-collector:
---
# /usr/sbin/sosreport --batch --report -o postgresql --tmp-dir=/tmp/logcollector-zlIcO8/log-collector-data -k postgresql.dbname=engine -k postgresql.username=engine -k postgresql.password=QjytYXZa

sosreport (version 2.2)


  This command will collect diagnostic and configuration
information from this Red Hat Enterprise Linux system and
installed applications.

  An archive containing the collected information will be
generated in /tmp/logcollector-zlIcO8/log-collector-data
and may be provided to a Red Hat support representative.

  Any information provided to Red Hat will be treated in
accordance with the published support policies at:


  https://access.redhat.com/support/

  The generated archive may contain data considered
sensitive and its content should be reviewed by the
originating organization before being passed to any third
party.

  No changes will be made to system configuration.


Unable to execute pg_dump. Error(pg_dump: [archiver (db)] connection to database "engine" failed: FATAL:  Ident authentication failed for user "engine")
  Running plugins. Please wait ...

  Completed [1/1] ...      
Creating compressed archive...

Your sosreport has been generated and saved in:
  /tmp/logcollector-zlIcO8/log-collector-data/sosreport-rhn-support-dornelas-20131209164723-65b0.tar.xz

The md5sum is: d8e799ae3f8d381ca63c2d19674165b0

Please send this file to your support representative.
---

Comment 1 Derrick Ornelas 2013-12-09 22:02:35 UTC
# PGPASSWORD="QjytYXZa" pg_dump -C -U engine -w -f /tmp/blah.tar -F t engine
pg_dump: [archiver (db)] connection to database "engine" failed: FATAL:  Ident authentication failed for user "engine"


# PGPASSWORD="QjytYXZa" pg_dump -C -h localhost -U engine -w -f /tmp/blah.tar -F t engine
# file /tmp/blah.tar 
/tmp/blah.tar: tar archive

Comment 2 Derrick Ornelas 2013-12-09 22:11:27 UTC
I guess this can be fixed in a number of ways, but it appears that the simpliest is for log-collector to pass "postgresql.dbhost=localhost" to sosreport if '--pg-dbhost' isn't explicitly set, which is supposed to be the default anyways



# /usr/sbin/sosreport --batch --report -o postgresql --tmp-dir=/tmp/logcollector-zlIcO8/log-collector-data -k postgresql.dbname=engine -k postgresql.username=engine -k postgresql.password=QjytYXZa -k postgresql.dbhost=localhost

sosreport (version 2.2)


  This command will collect diagnostic and configuration
information from this Red Hat Enterprise Linux system and
installed applications.

  An archive containing the collected information will be
generated in /tmp/logcollector-zlIcO8/log-collector-data
and may be provided to a Red Hat support representative.

  Any information provided to Red Hat will be treated in
accordance with the published support policies at:


  https://access.redhat.com/support/

  The generated archive may contain data considered
sensitive and its content should be reviewed by the
originating organization before being passed to any third
party.

  No changes will be made to system configuration.


  Running plugins. Please wait ...

  Completed [1/1] ...      
Creating compressed archive...

Your sosreport has been generated and saved in:
  /tmp/logcollector-zlIcO8/log-collector-data/sosreport-rhn-support-dornelas-20131209170655-7d28.tar.xz

The md5sum is: bd81db9cc40f1ccd7be6d27ebc827d28

Please send this file to your support representative.

# tar xf /tmp/logcollector-zlIcO8/log-collector-data/sosreport-rhn-support-dornelas-20131209170536-fa49.tar.xz
# file rhevdm33-2013120917051386626734/tmp/tmp8wkdEx/sos_pgdump.tar 
rhevdm33-2013120917051386626734/tmp/tmp8wkdEx/sos_pgdump.tar: tar archive

Comment 3 Sandro Bonazzola 2013-12-10 09:58:43 UTC
Proposing this as blocker.
Previously it was possible to access the database through unix socket. Now the access for user engine is limited to tcp connection.
log-collector just used socket if db host was localhost.
The fix on log-collector side is just always use db host, also if it's localhost.

Comment 6 Sandro Bonazzola 2013-12-12 10:56:25 UTC
Merged on upstream master and 3.3 branches.

Comment 8 Meni Yakove 2013-12-24 08:30:54 UTC
rhevm-3.3.0-0.41.el6ev.noarch

Comment 9 errata-xmlrpc 2014-01-21 17:01:12 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-2014-0039.html


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