Bug 1009599

Summary: Install fails due to relation "tags_vm_pool_map" already exist
Product: Red Hat Enterprise Virtualization Manager Reporter: wdaniel
Component: ovirt-engine-setupAssignee: Alon Bar-Lev <alonbl>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: medium Docs Contact:
Priority: high    
Version: 3.3.0CC: acathrow, bazulay, benglish, didi, dougsland, iheim, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: integration
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: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1019461    
Attachments:
Description Flags
engine setup log none

Description wdaniel 2013-09-18 16:46:37 UTC
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 17:00:55 UTC
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 21:36:43 UTC
Correct.

Had to fix some of the logic.

Thanks!

Comment 3 Yedidyah Bar David 2013-09-22 06:15:39 UTC
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 07:26:08 UTC
(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 11:16:27 UTC
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 12:56:30 UTC
(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 22:26:32 UTC
Closing - RHEV 3.3 Released

Comment 8 Itamar Heim 2014-01-21 22:29:52 UTC
Closing - RHEV 3.3 Released