Bug 888040

Summary: Running engine-cleanup with --dont-drop-db still interacts with database (and fails)
Product: [Retired] oVirt Reporter: Stephen Gordon <sgordon>
Component: ovirt-engine-installerAssignee: Moran Goldboim <mgoldboi>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: urgent    
Version: 3.2CC: acathrow, alourie, dyasny, iheim, mgoldboi, ykaul
Target Milestone: ---   
Target Release: 3.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-15 06:47:37 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 Stephen Gordon 2012-12-17 21:33:41 UTC
Description of problem:

As per Bug # 888027 I am having difficulty installing 3.2 Alpha on Fedora 18. As a result of those issues I wished to run engine-cleanup without dropping the database so that I could attempt to clean up the database manually.

Unfortunately running engine-cleanup with --dont-drop-db not only tries to interact with the database but fails when it can't.

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

ovirt-engine-setup-3.2.0-1.20121212.git01e08b2.fc18

Expected results:

engine-cleanup --dont-drop-db does not touch the database and successfully cleans up file system objects. If attempting to connect is unavoidable then all actions that can be completed without database interaction should be.

Actual results:

engine-cleanup --dont-drop-db fails with fatal error when attempting to connect to database.

Additional info:

# engine-cleanup --dont-drop-db
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 ovirt-engine service...                         [ DONE ]

Error: Couldn't connect to the database server.Check that connection is working and rerun the cleanup utility
Error: Cleanup failed.
please check log at /var/log/ovirt-engine/engine-cleanup_2012_12_17_16_27_49.log

# tail -n 15 /var/log/ovirt-engine/engine-cleanup_2012_12_17_16_27_49.log
2012-12-17 16:28:03::DEBUG::common_utils::437::root:: running sql query 'select 1' on db server: 'localhost'.
2012-12-17 16:28:03::DEBUG::common_utils::390::root:: Executing command --> '/usr/bin/psql -h localhost -p 5432 -U engine -d engine -c select 1'
2012-12-17 16:28:03::DEBUG::common_utils::428::root:: output = 
2012-12-17 16:28:03::DEBUG::common_utils::429::root:: stderr = psql: FATAL:  database "engine" is not currently accepting connections

2012-12-17 16:28:03::DEBUG::common_utils::430::root:: retcode = 2
2012-12-17 16:28:03::ERROR::engine-cleanup::476::root:: Traceback (most recent call last):
  File "/usr/bin/engine-cleanup", line 471, in <module>
    main(options)
  File "/usr/bin/engine-cleanup", line 433, in main
    if db.exists() and options.drop_db:
  File "/usr/bin/engine-cleanup", line 366, in exists
    raise Exception(MSG_ERROR_CONNECT_DB)
Exception: Error: Couldn't connect to the database server.Check that connection is working and rerun the cleanup utility

Comment 1 Alex Lourie 2012-12-27 10:13:46 UTC
The patch was uploaded for review: http://gerrit.ovirt.org/#/c/10423/

Comment 3 Itamar Heim 2013-01-16 16:09:57 UTC
3.2 beta built, moving to ON_QA status to allow testing