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. ---
# 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
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
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.
Merged on upstream master and 3.3 branches.
rhevm-3.3.0-0.41.el6ev.noarch
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