Bug 879936 - [rhevm-upgrade] [TEXT] rhevm-upgrade fails after rollback on existing user role 'engine' (need to drop it during upgrade)
[rhevm-upgrade] [TEXT] rhevm-upgrade fails after rollback on existing user ro...
Status: CLOSED DUPLICATE of bug 879920
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup (Show other bugs)
3.1.0
x86_64 Linux
urgent Severity high
: ---
: 3.1.2
Assigned To: Moran Goldboim
Haim
integration
:
: 880114 880120 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-25 11:01 EST by Haim
Modified: 2014-01-12 19:55 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-11 11:57:36 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Haim 2012-11-25 11:01:15 EST
Description of problem:

rhevm-upgrade fails consistently after failed upgrade attempt followed by manual rollback on the following:


2012-11-25 17:02:53::DEBUG::common_utils::341::root:: stderr = 
2012-11-25 17:02:53::DEBUG::common_utils::342::root:: retcode = 0
2012-11-25 17:02:53::DEBUG::common_utils::473::root:: Found IP Address: 10.35.64.13
2012-11-25 17:02:53::DEBUG::common_utils::302::root:: Executing command --> '/usr/bin/psql -U postgres -c ALTER DATABASE rhevm RENAME TO engine;'
2012-11-25 17:02:53::DEBUG::common_utils::340::root:: output = ALTER DATABASE

2012-11-25 17:02:53::DEBUG::common_utils::341::root:: stderr = 
2012-11-25 17:02:53::DEBUG::common_utils::342::root:: retcode = 0
2012-11-25 17:02:53::DEBUG::common_utils::302::root:: Executing command --> '/usr/bin/psql -U postgres -c ALTER ROLE rhevm RENAME TO engine;'
2012-11-25 17:02:53::DEBUG::common_utils::340::root:: output = 
2012-11-25 17:02:53::DEBUG::common_utils::341::root:: stderr = ERROR:  role "engine" already exists

2012-11-25 17:02:53::DEBUG::common_utils::342::root:: retcode = 1
2012-11-25 17:02:53::ERROR::rhevm-upgrade::1323::root:: Traceback (most recent call last):
  File "/usr/bin/rhevm-upgrade", line 1316, in <module>
    main(options)
  File "/usr/bin/rhevm-upgrade", line 1224, in main
    MSG_INFO_PRE_30_UPGRADE)
  File "/usr/bin/rhevm-upgrade", line 661, in runFunc
    func[0](*func[1:])
  File "/usr/share/ovirt-engine/scripts/upgrade_utils30.py", line 98, in modifyDb
    utils.execCmd(cmdList=cmd, failOnError=True, msg="Error: couldn't rename DB ROLE 'rhevm' to '%s'" % basedefs.DB_USER, envDict=env)
  File "/usr/share/ovirt-engine/scripts/common_utils.py", line 345, in execCmd
    raise Exception(msg)
Exception: Error: couldn't rename DB ROLE 'rhevm' to 'engine'

repro steps:

1) start rhevm upgrade from 3.0 to 3.1
2) upgrade fails
3) follow the below:

MSG_ERROR_UPGRADE_30 = "\n **Error: Upgrade failed **\n\
In order to restore the previous installation, perform the following steps: \n\
1. Make sure that there are no EAP6 packages on the system:\n\
\trpm -qa | grep ep6\.el6\n\
If there are such packages, remove them:\n\
\tyum remove `rpm -qa | grep ep6\.el6`\n\
2. Make sure that rhevm or its dependencies are not installed:\n\
\trpm -qa | grep rhevm \n\
If they are still installed, remove them:\n\
\tyum remove `rpm -qa | grep rhevm`\n\
3. Disable EAP6 channel, otherwise you will experience dependency resolution problems.\n\
4. Install rhevm-3.0 from the RHEL channel. For example, use the following command:\n\
\tyum install %s\n\
5. Rename DB if it is present:\n\
\tpsql -U postgres --list\n\
If 'rhevm' DB exists, rename it:\n\
\tpsql -U postgres -c \"ALTER DATABASE rhevm RENAME TO rhevm_old;\"\n\
6. Run rhevm-setup using the answer file located at " + basedefs30.ANSWER_FILE + ":\n\
\trhevm-setup --answer-file=" + basedefs30.ANSWER_FILE + "\n\
7. Remove the DB created by the setup:\n\
\tservice jbossas stop\n\
\tdropdb -U postgres rhevm\n\
8. Restore the production DB using the backup file by running the following commands: \n\
\tpsql -U postgres -f %s \n\
\tpsql -U postgres -c \"ALTER DATABASE engine RENAME TO rhevm;\"\n\
9. Restore security certificates and configs using the following command: \n\
\ttar jxvfP " + basedefs30.OLD_VERSION_FILES + " \n\
10. Start jboss service using the following command: \n\
\tservice jbossas start\n"

- run rhevm-upgrade again.
Comment 2 Yaniv Kaul 2012-11-26 05:30:18 EST
*** Bug 880114 has been marked as a duplicate of this bug. ***
Comment 3 Moran Goldboim 2012-11-26 05:31:41 EST
flow need to be added to rollback KB
Comment 4 Moran Goldboim 2012-11-26 16:13:47 EST
*** Bug 880120 has been marked as a duplicate of this bug. ***
Comment 5 Moran Goldboim 2012-12-11 11:57:36 EST

*** This bug has been marked as a duplicate of bug 879920 ***

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