Bug 818230

Summary: RHEVM-Installer [engine-cleanup] - Not clear error message when engine-cleanup can't dropdb due to an open session [TXT]
Product: Red Hat Enterprise Virtualization Manager Reporter: Ortal <ogvura>
Component: ovirt-engine-setupAssignee: Alex Lourie <alourie>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: acathrow, bazulay, dyasny, iheim, knesenko, oschreib, Rhev-m-bugs, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: integration
Fixed In Version: si15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 20:00:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ortal 2012-05-02 13:59:59 UTC
Description of problem:

RHEVM-Installer [engine-cleanup] - Not clear error message when engine-cleanup can't dropdb due to an open session [TXT]

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

How reproducible:
Always

Steps to Reproduce:
1. Open DB using pgadmin3 or psql command
2. In another shell open RHEVM, and run engine-cleanup utility.
  
Actual results:

Missing right error message to the user which explains why engine-cleanup fails to drop the DataBase. 

[root@ortal-rhevm3 ovirt-engine]# engine-cleanup
WARNING: Executing oVirt Engine cleanup utility.
This utility will wipe all existing data including configuration settings, certificates and database.
In addition, all existing DB connections will be closed.
Would you like to proceed? (yes|no): yes

Stopping JBoss Service...                                [ DONE ]
Removing Database...                                    [ ERROR ]
Removing CA...                                           [ DONE ]
Removing EAR link...                                     [ DONE ]

Cleanup finished with errors, please see log file
Error: Database drop failed
Cleanup log available at /var/log/ovirt-engine/engine-cleanup_2012_05_02_16_27_18.log
[root@ortal-rhevm3 ovirt-engine]# less /var/log/ovirt-engine/engine-cleanup_2012_05_02_16_27_18.log
[root@ortal-rhevm3 ovirt-engine]# vi /var/log/ovirt-engine/engine-cleanup_2012_05_02_16_27_18.log
[root@ortal-rhevm3 ovirt-engine]# vi /var/log/ovirt-engine/engine-cleanup_2012_05_02_16_27_18.log
[root@ortal-rhevm3 ovirt-engine]# less /var/log/ovirt-engine/engine-cleanup_2012_05_02_16_27_18.log
[root@ortal-rhevm3 ovirt-engine]# engine-cleanup
WARNING: Executing oVirt Engine cleanup utility.
This utility will wipe all existing data including configuration settings, certificates and database.
In addition, all existing DB connections will be closed.


Expected results:

The error should be printed to the user, and should be taken from the engine-cleanup.log:

2012-05-02 16:27:32::DEBUG::common_utils::323::root:: stderr =
2012-05-02 16:27:32::DEBUG::common_utils::324::root:: retcode = 0
2012-05-02 16:27:32::DEBUG::common_utils::296::root:: Executing command --> '/usr/bin/dropdb -w -U postgres -h 10.35.97.94 -p 6543 engine'
2012-05-02 16:27:37::DEBUG::common_utils::322::root:: output =
2012-05-02 16:27:37::DEBUG::common_utils::323::root:: stderr = dropdb: database removal failed: ERROR:  database "engine" is being accessed by other users
DETAIL:  There are 1 other session(s) using the database.

Comment 1 Alex Lourie 2012-05-30 14:14:06 UTC
The fix is uploaded for review:
http://gerrit.ovirt.org/4907