Bug 1259345

Summary: engine-cleanup fails due to error 'must be owner of ...'
Product: [oVirt] ovirt-engine Reporter: Martin Perina <mperina>
Component: Setup.EngineAssignee: Martin Perina <mperina>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: ---CC: bugs, didi, ecohen, emesika, gklein, lsurette, lsvaty, oourfali, rbalakri, yeylon
Target Milestone: ovirt-3.6.0-rcFlags: rule-engine: ovirt-3.6.0+
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: 3.6.0-12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-04 11:19:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Perina 2015-09-02 12:28:47 UTC
Description of problem:

When executing engine-cleanup on F22, it fails with error:

 [ ERROR ] Failed to execute stage 'Misc configuration': must be owner of schema pg_catalog

The issue is that we try to remove all schemas from returned from 'select * from information_schema.schemata' and it return also system schemas (on Centos 6/7 this query returns only schemas owned by logged in user).


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

oVirt 3.6 beta3

How reproducible:

100%

Steps to Reproduce:
1. Install and configure engine using engine-setup
2. After successful setup try to remove all engine configuration using engine-cleanup

Actual results:

engine-cleanup fails

Expected results:

engine-cleanup should be successful

Additional info:

Comment 1 Yedidyah Bar David 2015-09-06 08:32:24 UTC
Only now saw [1].

If that was enough for dropping the schema created for aaa-jdbc, and you didn't have to individually drop each object in it, keeping the conditions elsewhere to drop objects only from schema 'public', why isn't it enough to replace the entire logic dropping our objects with:

drop SCHEMA public cascade;

?

(Setting needinfo on Eli although 'you' above is Martin).

[1] https://gerrit.ovirt.org/44553

Comment 2 Eli Mesika 2015-09-06 08:39:57 UTC
(In reply to Yedidyah Bar David from comment #1)
> Only now saw [1].
> 
> If that was enough for dropping the schema created for aaa-jdbc, and you
> didn't have to individually drop each object in it, keeping the conditions
> elsewhere to drop objects only from schema 'public', why isn't it enough to
> replace the entire logic dropping our objects with:
> 
> drop SCHEMA public cascade;

The 'public' schema is created by the database engine and is actually the default schema 
for example , the following are equivalent :

CREATE TABLE products ( ... );

and

CREATE TABLE public.products ( ... );

Therefor, when cleanup is used it should drop each object specifically

Comment 3 Lukas Svaty 2015-10-15 12:09:20 UTC
verified in rhevm-setup-base-3.6.0.1-0.1.el6.noarch

Comment 4 Sandro Bonazzola 2015-11-04 11:19:12 UTC
oVirt 3.6.0 has been released on November 4th, 2015 and should fix this issue.
If problems still persist, please open a new BZ and reference this one.