Bug 920712 - DB "lost" during rhevm-upgrade because scripts save backup to bad directory
Summary: DB "lost" during rhevm-upgrade because scripts save backup to bad directory
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 3.2.0
Assignee: Alex Lourie
QA Contact: Jiri Belka
URL:
Whiteboard: integration
: 880523 (view as bug list)
Depends On:
Blocks: 884642
TreeView+ depends on / blocked
 
Reported: 2013-03-12 15:22 UTC by Jiri Belka
Modified: 2015-09-22 13:09 UTC (History)
11 users (show)

Fixed In Version: sf-12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ovirt-engine-upgrade log (21.71 KB, application/x-tar)
2013-03-12 15:22 UTC, Jiri Belka
no flags Details

Description Jiri Belka 2013-03-12 15:22:59 UTC
Created attachment 709027 [details]
ovirt-engine-upgrade log

Description of problem:

During rhevm-upgrade I lost the DB and restore failed. The upgrade itself was impacted by rpm deps but the issue here is the DB is lost.

2013-03-12 15:31:10::DEBUG::common_utils::435::root:: Executing command --> './backup.sh -u engine -s localhost -p 5432 -d engine -f /var/lib/ovirt-engine/backups/ovirt-engine_db_backup_2013_03_12_15_30_26.sql' in working directory '/usr/share/ovirt-engine/dbscripts/'
2013-03-12 15:31:12::DEBUG::common_utils::473::root:: output = Backup of database engine to engine_Tue_Mar_12_15:31:10_CET_2013.sql started...
Backup of database engine to engine_Tue_Mar_12_15:31:10_CET_2013.sql completed.

^^^ see difference between filenames:
ovirt-engine_db_backup_2013_03_12_15_30_26.sql
 vs
engine_Tue_Mar_12_15:31:10_CET_2013.sql

And...

2013-03-12 15:31:15::DEBUG::rhevm-upgrade::369::root:: DB Restore started
2013-03-12 15:31:15::DEBUG::common_utils::435::root:: Executing command --> '/usr/bin/dropdb -U engine -h localhost -p 5432 engine_2013_03_12_15_30_26' in working directory '/'
2013-03-12 15:31:16::DEBUG::common_utils::473::root:: output = 
2013-03-12 15:31:16::DEBUG::common_utils::474::root:: stderr = 
2013-03-12 15:31:16::DEBUG::common_utils::475::root:: retcode = 0
2013-03-12 15:31:16::DEBUG::common_utils::435::root:: Executing command --> '/usr/bin/psql -U engine -h localhost -p 5432 -d template1 -f /var/lib/ovirt-engine/backups/ovirt-engine_db_backup_2013_03_12_15_30_26.sql' in working directory '/'
2013-03-12 15:31:16::DEBUG::common_utils::473::root:: output = 
2013-03-12 15:31:16::DEBUG::common_utils::474::root:: stderr = /var/lib/ovirt-engine/backups/ovirt-engine_db_backup_2013_03_12_15_30_26.sql: No such file or directory

2013-03-12 15:31:16::DEBUG::common_utils::475::root:: retcode = 1

...'No such file or directory'!

He, it was dropping renamed original DB but it failed to restore from backup!

Fortunatelly, find found it elsewhere...

[root@jb-rh31 dbscripts]# find / -type f -ctime 0 -iname '*engine*.sql' -ls
158028 1056 -rw-r--r--   1 root     root      1078607 Mar 12 15:31 /usr/share/ovirt-engine/dbscripts/engine_Tue_Mar_12_15:31:10_CET_2013.sql

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

How reproducible:
???

Steps to Reproduce:
1. have si27.3
2. rpm --nodeps -e rhevm-doc /rhemv-doc is broken for deps/
3. rhevm-upgrade
  
Actual results:
rhevm-upgrade save backup to bad dir(s) and also it does _NOT_ check for existence of backup on filesystem

Expected results:
save backup to valid dir and after backup is done, please check for its existence on filesystem and also do not drop renamed db when rhevm-upgrade is trying to restore original db from filesystem

Additional info:
restore from db which I found with `find' was OK

Comment 2 Alex Lourie 2013-03-27 10:08:57 UTC
*** Bug 880523 has been marked as a duplicate of this bug. ***

Comment 3 Jiri Belka 2013-04-02 07:55:47 UTC
sf12, OK.

Comment 4 Itamar Heim 2013-06-11 09:50:52 UTC
3.2 has been released

Comment 5 Itamar Heim 2013-06-11 09:51:23 UTC
3.2 has been released

Comment 6 Itamar Heim 2013-06-11 09:58:25 UTC
3.2 has been released


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