Bug 1644550 - engine-backup fails to restore backup
Summary: engine-backup fails to restore backup
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backup-Restore.Engine
Version: 4.2.6
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Yedidyah Bar David
QA Contact: Lukas Svaty
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-31 06:50 UTC by Brett Maton
Modified: 2018-10-31 14:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-31 14:49:58 UTC
oVirt Team: Integration
Embargoed:


Attachments (Terms of Use)
restore.log (5.47 KB, text/plain)
2018-10-31 08:13 UTC, Simone Tiraboschi
no flags Details

Description Brett Maton 2018-10-31 06:50:33 UTC
Description of problem:

Redeploying a new SHE and restoring a database backup fails.

Backup restore fails when manually executung engine-backup --mode=restore, also when restoring backup during redeploy with (ovirt-hosted-engine-setup-2.2.30-1.el7.noarch.rpm)
hosted-engine --deploy --restore-from-file=yourbackup.tar.gz


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


How reproducible:


Steps to Reproduce:
1. Backup current engine
  engine-backup --mode=backup --scope=all --file=engine.backup --log=engine-backup.log

2. Deploy new SHE to new domain

3.  Restore backup
engine-backup --mode=restore \
--scope=all \
--file=engine.backup \
--log=engine-restore.log \
--he-remove-storage-vm \
--he-remove-hosts \
--restore-permissions \
--provision-dwh-db \
--provision-db

Actual results:

2018-10-26 08:16:17 1874: OUTPUT:   - Cleaning up temporary tables in engine database 'engine'
2018-10-26 08:16:17 1874: pg_cmd running: psql -w -U engine -h localhost -p 5432  engine -t -c SELECT count(*) as count FROM vdc_options WHERE option_name='DbJustRestored' and version='general'
ERROR:  relation "vdc_options" does not exist
LINE 1: SELECT count(*) as count FROM vdc_options WHERE option_name=...
                                      ^
2018-10-26 08:16:17 1874: FATAL: Failed checking DbJustRestored


Expected results:

Succesful restore and working SHE

Additional info:

Comment 1 Simone Tiraboschi 2018-10-31 07:47:21 UTC
Can you please attach your engine-restore.log ?

Comment 2 Simone Tiraboschi 2018-10-31 08:13:57 UTC
Created attachment 1499251 [details]
restore.log

Comment 3 Simone Tiraboschi 2018-10-31 08:15:27 UTC
OK, I got it from '[ovirt-users] Engine restore failing'

The real error is here:

2018-10-26 08:16:17 1874: pg_cmd running: pg_restore -w -U engine -h localhost -p 5432 -d engine -j 2 /tmp/engine-backup.uqg1Ha3mFP/db/engine_backup.db
pg_restore: [archiver] unsupported version (1.13) in file header

So pg_restore is restoring nothing and everything else after that fails with strange results.

Comment 4 Simone Tiraboschi 2018-10-31 08:32:46 UTC
Can you please attach here the output of
  sudo -u postgres scl enable rh-postgresql95 -- pg_restore --version
executed on the system where you are trying to restore that DB?

Comment 5 Simone Tiraboschi 2018-10-31 12:40:45 UTC
Please see:v https://github.com/PostgresApp/PostgresApp/issues/440

Comment 6 Brett Maton 2018-10-31 13:28:01 UTC
@Simone

[root@ovirt ~]# sudo -u postgres scl enable rh-postgresql95 -- pg_restore --version

could not change directory to "/root": Permission denied
pg_restore (PostgreSQL) 9.5.9

Comment 7 Simone Tiraboschi 2018-10-31 13:50:13 UTC
(In reply to Brett Maton from comment #6)
> @Simone
> 
> [root@ovirt ~]# sudo -u postgres scl enable rh-postgresql95 -- pg_restore
> --version
> 
> could not change directory to "/root": Permission denied
> pg_restore (PostgreSQL) 9.5.9

According to https://github.com/PostgresApp/PostgresApp/issues/440 the issue has been fixed with 9.5.12.
Are you using ovirt-engine-appliance? which version?
Can you please update you scl postgres there and try again?

Comment 8 Brett Maton 2018-10-31 13:51:27 UTC
Updating the appliance (4.2-20180903.1.el7) appears to have solved the problem



hosted-engine --deploy --noansible
...
          Make a selection from the options below:
          (1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is up
          (2) Abort setup
          (3) Power off and restart the VM
          (4) Destroy VM and abort setup
         
          (1, 2, 3, 4)[1]: 


####

on SHE:

yum upgrade --exclude ansible
engine-backup --mode=restore --scope=all --file=engine.backup --log=engine-restore.log --he-remove-storage-vm --he-remove-hosts --restore-permissions --provision-dwh-db --provision-db

engine-setup --offline

###

Continue deployment on physical host

Comment 9 Brett Maton 2018-10-31 14:18:27 UTC
Updating the appliance has fixed the database restore problem, however the new hosted storage domain has failed to import correctly and is showing as 'Locked' in the UI.

Comment 10 Simone Tiraboschi 2018-10-31 14:49:58 UTC
(In reply to Brett Maton from comment #8)
> Updating the appliance (4.2-20180903.1.el7) appears to have solved the
> problem

OK, closing this as not a bug.


(In reply to Brett Maton from comment #9)
> Updating the appliance has fixed the database restore problem, however the
> new hosted storage domain has failed to import correctly and is showing as
> 'Locked' in the UI.

This is definitively due to https://bugzilla.redhat.com/1620314 and it will be fixed with 4.2.7.
If you are in hurry I'd suggest to use (but with an up to date appliance)
  hosted-engine --deploy --restore-from-file=yourbackup.tar.gz
from with ovirt-hosted-engine-setup-2.2.30-1.el7.noarch.rpm from RC repo.


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