Bug 1741481

Summary: backup to local file using appliance console fails on permissions
Product: Red Hat CloudForms Management Engine Reporter: Jaroslav Henner <jhenner>
Component: ApplianceAssignee: Brandon Dunne <bdunne>
Status: CLOSED WORKSFORME QA Contact: Jaroslav Henner <jhenner>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.11.0CC: abellott, obarenbo, yrudman
Target Milestone: GAKeywords: Regression
Target Release: 5.11.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-16 12:43:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:

Description Jaroslav Henner 2019-08-15 09:27:37 UTC
Description of problem:
when trying to do db backup using appliance console, the command fails and there is this in the log:

Caused by:
AwesomeSpawn::CommandResultError: pg_basebackup --no-password -z --format t --wal-method fetch --pgdata - exit code: 1



Version-Release number of selected component (if applicable):
cfme-5.11.0.19-1.el8cf.x86_64


How reproducible:
2/2

Steps to Reproduce:
        interaction.send('ap')
        interaction.answer('Choose the advanced setting: ', '4')
        interaction.answer(resc('Choose the backup output file destination: |1| '), '1')
        interaction.answer(resc('Enter the location to save the backup file to: |/tmp/evm_db.backup| '), database_path)
 
Actual results:
appliance console command fails

Expected results:
backup created fine

Additional info:
echo 'local   replication all           peer map=usermap' >> /var/lib/pgsql/data/pg_hba.conf

fixes the problem

Comment 2 Jaroslav Henner 2019-08-15 09:29:01 UTC
This worked on last 5.10. Surely because there is:

[root@dhcp-8-198-40 ~]# rpm -q cfme
cfme-5.10.8.0-1.el7cf.x86_64

[root@dhcp-8-198-40 ~]# cat /var/opt/rh/rh-postgresql95/lib/pgsql/data/pg_hba.conf
# TYPE  DATABASE    USER  ADDRESS METHOD
local   all         all           peer map=usermap
local   replication all           peer map=usermap
hostssl all         all   all     md5
host    replication all   all     md5

Comment 3 Brandon Dunne 2019-08-15 21:08:59 UTC
I wasn't able to reproduce this on cfme-rhevm-5.11.0.19-1.x86_64.qcow2.  After running the database configuration I see the following and the database backup worked as expected.

[root@localhost vmdb]# cat /var/lib/pgsql/data/pg_hba.conf
# TYPE  DATABASE    USER  ADDRESS METHOD
local   all         all           peer map=usermap
local   replication all           peer map=usermap
hostssl all         all   all     md5
host    replication all   all     md5

Comment 4 Jaroslav Henner 2019-08-16 12:43:03 UTC
It turns out the file was altered by our test suite.