Bug 1121961 - engine-backup: FATAL: Errors while restoring database with different db user
Summary: engine-backup: FATAL: Errors while restoring database with different db user
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Yedidyah Bar David
QA Contact: Jiri Belka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-22 08:56 UTC by Tareq Alayan
Modified: 2016-03-11 07:32 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: engine-backup uses pg_dump (without the '--no-owner' option) for backup, and psql to restore. Some errors from psql are filtered. Non-filtered errors cause engine-backup to abort. Consequence: Using options to change db credentials to use another user on restore, cause psql to fail, while trying to run the commands to grant permissions to the previous owner. Fix: The list of filtered errors was extended to include errors about the previous user not existing. Result: engine-backup --mode=restore, with options to change database credentials, including a different database user, does not fail, even if restoring to a database in which the previous user does not exist.
Clone Of:
Environment:
Last Closed: 2016-03-11 07:32:32 UTC
oVirt Team: Integration
Target Upstream Version:


Attachments (Terms of Use)
logs (3.89 MB, application/x-tar-gz)
2014-07-22 08:59 UTC, Tareq Alayan
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 36150 master MERGED packaging: engine-backup: Fix changing owner Never

Description Tareq Alayan 2014-07-22 08:56:42 UTC
Description of problem:
restoring environment with different user will fail

Version-Release number of selected component (if applicable):


How reproducible:
rhevm-3.4.1-0.30.el6ev.noarch


Steps to Reproduce:
I did the following and it didnot work can u please take a look, i may have done something wrong wrong, it still not fixed:

(1) 
engine-backup --mode=backup --scope=all --file=testjuly21.bkp --log=/var/log/testjul21.log

(2) 
stop postgres service 
rm -rf /var/lib/pgsql/data
su postgres -c 'initdb /var/lib/pgsql/data'
start postgres service

(3)
postgres=# create user engine password 'redhat';
CREATE ROLE
postgres=# create user engine_history password 'redhat';
CREATE ROLE
postgres=# create user ovirt_engine_reports password 'redhat';      
CREATE ROLE
postgres=# create user sdam password 'redhat';
CREATE ROLE
postgres=# create database engine owner engine template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
CREATE DATABASE
postgres=# create database ovirt_engine_history owner engine_history template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
CREATE DATABASE
postgres=# create database ovirt_engine_reports owner ovirt_engine_reports template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
CREATE DATABASE

(3)
engine-backup --mode=restore --scope=all --file=testjuly21.bkp --log=/root/rst.log --change-db-credentials --db-host=localhost --db-user=engine --db-name=engine --db-password=redhat --change-dwh-db-credentials --dwh-db-host=localhost --dwh-db-user=engine_history --dwh-db-name=ovirt_engine_history --dwh-db-password=redhat --change-reports-db-credentials --reports-db-host=localhost --reports-db-user=ovirt_engine_reports --reports-db-name=ovirt_engine_reports --reports-db-password=redhat
Preparing to restore:
- Setting credentials for Engine database 'engine'
- Setting credentials for DWH database 'ovirt_engine_history'
- Setting credentials for Reports database 'ovirt_engine_reports'
- Unpacking file 'testjuly21.bkp'
Restoring:
- Files
- Engine database 'engine'
- DWH database 'ovirt_engine_history'
FATAL: Errors while restoring database ovirt_engine_history

Additional info:
logs attaced

Comment 1 Tareq Alayan 2014-07-22 08:59:15 UTC
Created attachment 919842 [details]
logs

rst.log = restore log 
testjuly21.bkp = backup all 
testjul21.log = backup log

Comment 3 Sandro Bonazzola 2015-02-20 11:07:53 UTC
Automated message: can you please update doctext or set it as not required?

Comment 5 Jiri Belka 2016-01-11 16:43:22 UTC
ok, rhevm-tools-3.6.2-0.1.el6.noarch

restore ok with my own user-defined


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