Bug 843495

Summary: [rhevm-update] Upgrade fails when dwh service is up
Product: Red Hat Enterprise Virtualization Manager Reporter: Kiril Nesenko <knesenko>
Component: ovirt-engine-setupAssignee: Kiril Nesenko <knesenko>
Status: CLOSED CURRENTRELEASE QA Contact: David Botzer <dbotzer>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 3.1.0CC: bazulay, dfediuck, dyasny, iheim, mgoldboi, pstehlik, Rhev-m-bugs, sgrinber, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 20:02:19 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:
Attachments:
Description Flags
logs
none
si17-si18 none

Description Kiril Nesenko 2012-07-26 13:13:19 UTC
Created attachment 600505 [details]
logs

Description of problem:
Upgrade fails when dwh service is up. There are live connection to the DB.

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

How reproducible:


Steps to Reproduce:
1. Try to run rhevm-update when dwh service is up.
2.
3.
  
Actual results:
update fails due to DB connections

Expected results:


Additional info:

Comment 2 Kiril Nesenko 2012-09-02 19:01:05 UTC
Patch posted for review: http://gerrit.ovirt.org/#/c/7691/

Comment 4 David Botzer 2012-09-19 05:11:42 UTC
Not Fixed, 3.1/si17 --> si18
1. I install si17 clean, with reports+dwh
2. I add in REPO the si18 url
3. I run yum update rhevm-setup & rhevm-upgrade 
Backing Up Database...                                   [ DONE ]
Rename Database...                                       [ ERROR ]
Error: Database rename failed. Check that there are no active connections to the DB and try again.
Error: Upgrade failed.
Not Fixed, 3.1/si17 --> si18

See attached,
------------------------------------------

2012-09-19 08:01:30::ERROR::rhevm-upgrade::930::root:: Traceback (most recent call last):
  File "/usr/bin/rhevm-upgrade", line 923, in <module>
    main(options)
  File "/usr/bin/rhevm-upgrade", line 834, in main
    runFunc([[db.rename, DB_NAME_TEMP]], MSG_INFO_RENAME_DB)
  File "/usr/bin/rhevm-upgrade", line 595, in runFunc
    func[0](*func[1:])
  File "/usr/bin/rhevm-upgrade", line 551, in rename
    utils.execRemoteSqlCommand(SERVER_ADMIN, SERVER_NAME, SERVER_PORT, basedefs.DB_TEMPLATE, query, True, MSG_ERROR_RENAME_DB)
  File "/usr/share/ovirt-engine/scripts/common_utils.py", line 365, in execRemoteSqlCommand
    return execCmd(cmdList=cmd, failOnError=failOnError, msg=errMsg, envDict=env)
  File "/usr/share/ovirt-engine/scripts/common_utils.py", line 339, in execCmd
    raise Exception(msg)
Exception: Error: Database rename failed. Check that there are no active connections to the DB and try again.

Comment 5 David Botzer 2012-09-19 05:12:08 UTC
Created attachment 614200 [details]
si17-si18

Comment 6 Kiril Nesenko 2012-09-22 06:14:30 UTC
Why this bz moved to assigned ? The fix was to print a nice error message:

Error: Database rename failed. Check that there are no active connections to the DB and try again.

That what it does. David take a look on the patch fix.

Comment 7 David Botzer 2012-09-23 06:58:18 UTC
Hi Kiril,

Thanks now I see, what the fix is,

but why doesnt upgrade handles the open connections to the DB,
If a user wants to upgrade, Why should they do it manually ?

Comment 8 David Botzer 2012-09-23 06:59:05 UTC
Waiting for ack on my replay and later on I will move it to verify.

Comment 9 David Botzer 2012-09-23 07:46:40 UTC
Fixed, 3.1/si18
User should stop the DWH manually.
(If not solving the issue - User should restart postgresql service in order to close open connections.)
Fixed, 3.1/si18