Bug 843495 - [rhevm-update] Upgrade fails when dwh service is up
[rhevm-update] Upgrade fails when dwh service is up
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup (Show other bugs)
x86_64 Linux
medium Severity unspecified
: ---
: ---
Assigned To: Kiril Nesenko
David Botzer
Depends On:
  Show dependency treegraph
Reported: 2012-07-26 09:13 EDT by Kiril Nesenko
Modified: 2015-09-22 09 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-12-04 15:02:19 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
logs (6.80 KB, text/x-log)
2012-07-26 09:13 EDT, Kiril Nesenko
no flags Details
si17-si18 (8.30 KB, application/octet-stream)
2012-09-19 01:12 EDT, David Botzer
no flags Details

  None (edit)
Description Kiril Nesenko 2012-07-26 09:13:19 EDT
Created attachment 600505 [details]

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):

How reproducible:

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

Expected results:

Additional info:
Comment 2 Kiril Nesenko 2012-09-02 15:01:05 EDT
Patch posted for review: http://gerrit.ovirt.org/#/c/7691/
Comment 4 David Botzer 2012-09-19 01:11:42 EDT
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>
  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
  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 01:12:08 EDT
Created attachment 614200 [details]
Comment 6 Kiril Nesenko 2012-09-22 02:14:30 EDT
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 02:58:18 EDT
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 02:59:05 EDT
Waiting for ack on my replay and later on I will move it to verify.
Comment 9 David Botzer 2012-09-23 03:46:40 EDT
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

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