Bug 1158985 - engine-setup fails after restoring backup of 3.5 engine that had dwhd connected to it
Summary: engine-setup fails after restoring backup of 3.5 engine that had dwhd connect...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: Documentation
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.0
Assignee: Tomas Dosek
QA Contact: movciari
URL:
Whiteboard: integration
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-30 16:01 UTC by movciari
Modified: 2021-08-30 12:22 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
Cause: If a user wants to backup and restore engine db and he is maintaining dwh as well he should stop the dwh before back up. Consequence: If not stopped the value of "DwhCurrentlyRunning" in "dwh_history_timekeeping" is 1. Then the restore will fail because it will think the DWH is still running. Workaround (if any): Set the value of "DwhCurrentlyRunning" in "dwh_history_timekeeping" to 0 if you know the dwh process is not running. Result:
Clone Of:
Environment:
Last Closed: 2014-12-01 12:15:23 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
setup log (559.18 KB, text/plain)
2014-10-30 16:01 UTC, movciari
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-43225 0 None None None 2021-08-30 12:18:22 UTC
Red Hat Knowledge Base (Solution) 1283133 0 None None None Never

Description movciari 2014-10-30 16:01:34 UTC
Created attachment 952248 [details]
setup log

Description of problem:
on setup that was installed as 3.1 with dwh and reports, then upgraded to 3.2, 3.3, 3.4, and 3.5, after upgrading to 3.5 i did engine-backup, cleanup and then restore, when running engine-setup after restoring DB, i got this:
Please confirm installation settings (OK, Cancel) [OK]: 
[ INFO  ] Cleaning async tasks and compensations
[ INFO  ] Checking the Engine database consistency
[ INFO  ] Stage: Transaction setup
[ INFO  ] Stopping dwh service
[ INFO  ] Stopping reports service
[ INFO  ] Stopping engine service
[ INFO  ] Stopping ovirt-fence-kdump-listener service
[ INFO  ] Stopping websocket-proxy service
[ ERROR ] dwhd is currently running. Its hostname is mo-4.rhev.lab.eng.brq.redhat.com. Please stop it before running Setup.
[ ERROR ] Failed to execute stage 'Transaction setup': dwhd is currently running
[ INFO  ] Yum Performing yum transaction rollback
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20141029235541-9d9sik.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20141029235701-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of setup failed
Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. install 3.1 with dwh and reports
2. upgrade to 3.2
3. upgrade to 3.3
4. upgrade to 3.4
5. upgrade to 3.5
6. engine-backup --mode=backup --scope=all --log=backup.log --file=test.bak
7. engine-cleanup
8. engine-backup --mode=restore --scope=all --file=test.bak --log=restore.log
9. engine-setup

Actual results:
engine-setup fails

Expected results:
engine-setup should complete engine, dwh and reports installation

Additional info:

Comment 1 Shirly Radco 2014-11-02 07:58:39 UTC
engine-cleanup has no guarantees.

Because the backup was done before stopping the dwh ,
the value of "DwhCurrentlyRunning" in "dwh_history_timekeeping" is 1.

If the user would like to fix this he will need to set it in the engine db to 0.

Comment 2 Yedidyah Bar David 2014-11-02 08:43:36 UTC
I am pretty certain this has nothing to do with upgrades and/or engine-cleanup. Seems like this will fail the same way:

On machine A:
1. install and setup engine+dwh 3.5
2. backup to file1
On machine B:
3. install engine+dwh
4. restore file1
5. engine-setup

Michal - can you please try to reproduce the above and/or some other minimal flow? Obviously A and B can be same machine if it was reinstalled in the middle (thus not relying on engine-cleanup).

I think we have to do something about this:

1. Current doc-text might be enough (stop dwh before backup), but is not very "nice", and we do not require stopping the engine either.

2. Can write something longer and detail more relevant scenarios, put in some wiki/KB and point to it. E.g. what if backup/restore is done only on engine while dwh was in a separate host and remains there.

3. Can analyze some of the relevant flows and make the relevant tools (backup, restore, setup) smarter and not require manual changes as previous option. This might turn out to be too risky/complex.

We should handle this while considering also the final behavior of the fix to bug 1024028. Current report is correctly against dwh, but with the fix to that bug, a similar failure can happen also for engine-only, depending on the exact fix we'll do there.

Comment 3 Shirly Radco 2014-11-13 11:34:48 UTC
Add K Base - 

If setup fails with this message after backup and restore it means that the dwh was running during backup.

The user then should make sure the dwh is stopped and change the value of "DwhCurrentlyRunning" to 0 in "dwh_history_timekeeping" on the engine db. 
UPDATE dwh_history_timekeeping SET var_value=0 WHERE var_name ='DwhCurrentlyRunning'.

Then run engine-setup again.

Comment 4 Yedidyah Bar David 2014-11-19 12:53:22 UTC
Tomas, please take over. Ask me if you need any info. Thanks!

Comment 6 Tomas Dosek 2014-12-01 12:15:23 UTC
KBase article is appropriate solution to this particular flow.

I've attached it - ID is 1283133.

Closing this BZ as WONTFIX.


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