Bug 1009599 - Install fails due to relation "tags_vm_pool_map" already exist
Install fails due to relation "tags_vm_pool_map" already exist
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup (Show other bugs)
3.3.0
x86_64 Linux
high Severity medium
: ---
: 3.3.0
Assigned To: Alon Bar-Lev
sefi litmanovich
integration
:
Depends On:
Blocks: 1019461
  Show dependency treegraph
 
Reported: 2013-09-18 12:46 EDT by wdaniel
Modified: 2015-09-07 01:43 EDT (History)
8 users (show)

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


Attachments (Terms of Use)
engine setup log (720.61 KB, text/x-log)
2013-09-18 12:46 EDT, wdaniel
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 19378 None None None Never

  None (edit)
Description wdaniel 2013-09-18 12:46:37 EDT
Created attachment 799484 [details]
engine setup log

Description of problem:

When installed the RHEV 3.3 beta (IS 15), the installer fails out while modifying the database with the error: relation "tags_vm_pool_map" already exists


Version-Release number of selected component (if applicable):
rhevm-3.3.0-0.22.master.el6ev.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:

Install fails.


Expected results:

Install succeeds in modifying database

Additional info:

This was done in a VM that previously had 3.2.2 installed on it. I used 'yum remove rhevm', and then used 'yum install rhevm'. The newest package came from http://bob.eng.lab.tlv.redhat.com/builds/latest_is/. Problem was hit while running rhevm-setup

From the install log:

2013-09-18 12:33:11 DEBUG otopi.plugins.ovirt_engine_setup.db.schema plugin.execute:446 execute-output: ['/usr/
share/ovirt-engine/dbscripts/create_schema.sh', '-l', '/var/log/ovirt-engine/setup/ovirt-engine-setup-201309181
22852.log', '-s', 'localhost', '-p', '5432', '-d', 'engine', '-u', 'engine', '-g'] stderr:
psql:create_tables.sql:26: ERROR:  relation "tags_vm_pool_map" already exists

2013-09-18 12:33:11 DEBUG otopi.context context._executeMethod:137 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/otopi/context.py", line 127, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/db/schema.py", line 189, in _miscInstall
    osetupcons.DBEnv.PGPASS_FILE
  File "/usr/lib/python2.6/site-packages/otopi/plugin.py", line 451, in execute
    command=args[0],
RuntimeError: Command '/usr/share/ovirt-engine/dbscripts/create_schema.sh' failed to execute
2013-09-18 12:33:11 ERROR otopi.context context._executeMethod:146 Failed to execute stage 'Misc configuration': Command '/usr/share/ovirt-engine/dbscripts/create_schema.sh' failed to execute
Comment 1 wdaniel 2013-09-18 13:00:55 EDT
Tried to run this again after dropping the database 'engine':

[ ERROR ] Failed to execute stage 'Misc configuration': Command '/usr/share/ovirt-engine/dbscripts/create_schema.sh' failed to execute
[ INFO  ] Yum Performing yum transaction rollback
[ INFO  ] Rolling back database schema
[ INFO  ] Clearing database engine_20130918125612
[ ERROR ] Database rollback failed: language "plpgsql" does not exist HINT:  Use CREATE LANGUAGE to load the language into the database. 
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20130918125326.log

From the log file:

2013-09-18 12:56:20 DEBUG otopi.plugins.ovirt_engine_setup.db.schema plugin.execute:446 exe
cute-output: ['/usr/share/ovirt-engine/dbscripts/create_schema.sh', '-l', '/var/log/ovirt-e
ngine/setup/ovirt-engine-setup-20130918125326.log', '-s', 'localhost', '-p', '5432', '-d', 
'engine_20130918125612', '-u', 'engine_20130918125612', '-g'] stderr:
psql: fe_sendauth: no password supplied

2013-09-18 12:56:20 DEBUG otopi.context context._executeMethod:137 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/otopi/context.py", line 127, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/db/schema.py", line 189, in _miscInstall
    osetupcons.DBEnv.PGPASS_FILE
  File "/usr/lib/python2.6/site-packages/otopi/plugin.py", line 451, in execute
    command=args[0],
RuntimeError: Command '/usr/share/ovirt-engine/dbscripts/create_schema.sh' failed to execute


Followed by the following on rollback:

2013-09-18 12:56:20 DEBUG otopi.plugins.ovirt_engine_setup.db.schema schema.abort:78 Exception during database restore
Traceback (most recent call last):
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/db/schema.py", line 65, in abort
    dbovirtutils.clearOvirtEngineDatabase()
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/database.py", line 369, in clearOvirtEngineDatabase
    transaction=False,
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/database.py", line 155, in execute
    args,
ProgrammingError: language "plpgsql" does not exist
HINT:  Use CREATE LANGUAGE to load the language into the database.

2013-09-18 12:56:20 ERROR otopi.plugins.ovirt_engine_setup.db.schema schema.abort:82 Database rollback failed: language "plpgsql" does not exist
Comment 2 Alon Bar-Lev 2013-09-18 17:36:43 EDT
Correct.

Had to fix some of the logic.

Thanks!
Comment 3 Yedidyah Bar David 2013-09-22 02:15:39 EDT
Alon,

You input a non-existant gerrit changeid, please fix. Did you refer to [1] ?

[1] http://gerrit.ovirt.org/19378
Comment 4 Alon Bar-Lev 2013-09-22 03:26:08 EDT
(In reply to Yedidyah Bar David from comment #3)
> Alon,
> 
> You input a non-existant gerrit changeid, please fix. Did you refer to [1] ?
> 
> [1] http://gerrit.ovirt.org/19378

Yes. I put this bug number instead :)
Comment 5 Alon Bar-Lev 2013-10-03 07:16:27 EDT
QA note:

Following should work:

1. upgrade from 3.2->3.3(latest)
result: database kept

2. upgrade from 3.3(n-1)->3.3(n)
result: database kept

3. installation with empty engine database
a. execute engine-cleanup
b. drop engine user and database directly from psql.
c. create engine user and database manually:
---
create user engine password 'engine';
create database engine owner engine template template0
encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
---
d. install rhevm
expected: the engine user and database will be used.

4. installation with existing engine database
a. install rhevm have working instance.
b. remove brutally:
yum remove -y 'rhevm*'
rm -fr /etc/ovirt-engine* /usr/share/ovirt-engine* /var/*/ovirt-engine
c. install rhevm
result: user and database that are used are with date suffix, original database (engine) is intact and not used.
Comment 6 sefi litmanovich 2013-10-06 08:56:30 EDT
(In reply to Alon Bar-Lev from comment #5)
> QA note:

VERIFIED:

> Following should work:
> 
> 1. upgrade from 3.2->3.3(latest)
> result: database kept - Verified
> 
> 2. upgrade from 3.3(n-1)->3.3(n)
> result: database kept 

verified update from is16 to is17
 
> 3. installation with empty engine database
> a. execute engine-cleanup
> b. drop engine user and database directly from psql.
> c. create engine user and database manually:
> ---
> create user engine password 'engine';
> create database engine owner engine template template0
> encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
> ---
> d. install rhevm
> expected: the engine user and database will be used.

verified

> 4. installation with existing engine database - verified
> a. install rhevm have working instance.
> b. remove brutally:
> yum remove -y 'rhevm*'
> rm -fr /etc/ovirt-engine* /usr/share/ovirt-engine* /var/*/ovirt-engine
> c. install rhevm
> result: user and database that are used are with date suffix, original
> database (engine) is intact and not used.

Verified
Comment 7 Itamar Heim 2014-01-21 17:26:32 EST
Closing - RHEV 3.3 Released
Comment 8 Itamar Heim 2014-01-21 17:29:52 EST
Closing - RHEV 3.3 Released

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