Bug 1552539 - upgrade from 4.1 to 4.2 fails as engine-setup does wrong test of /var/opt/rh/rh-postgresql95/lib/pgsql/data existence
Summary: upgrade from 4.1 to 4.2 fails as engine-setup does wrong test of /var/opt/rh/...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Setup.Core
Version: 4.2.2
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ovirt-4.2.2
: ---
Assignee: Yedidyah Bar David
QA Contact: Jiri Belka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-07 10:05 UTC by Jiri Belka
Modified: 2018-03-29 11:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-29 11:12:46 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.2+
rule-engine: blocker+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 88460 0 None None None 2018-03-07 10:12:04 UTC
oVirt gerrit 88524 0 None None None 2018-03-07 10:11:20 UTC

Description Jiri Belka 2018-03-07 10:05:18 UTC
Description of problem:

probably after previous upgrade issues I got ... created and it is the empty dir.

# ls -al /var/opt/rh/rh-postgresql95/lib/pgsql/data
total 0
drwx------. 2 postgres postgres  6 Sep  1  2017 .
drwx------. 4 postgres postgres 54 Mar  6 17:19 ..


but setup refused to use this empty dir, imo if it is empty it could be used.

2018-03-06 17:41:12,260+0100 DEBUG otopi.context context._executeMethod:143 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/context.py", line 133, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/db/dbmsupgrade.py", line 74, in _customization
    ) = dbovirtutils.DBMSUpgradeCustomizationHelper('engine')
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/database.py", line 1560, in DBMSUpgradeCustomizationHelper
    'Cannot upgrade PostgreSQL automatically - directory '
RuntimeError: Cannot upgrade PostgreSQL automatically - directory of the new version already exists
2018-03-06 17:41:12,264+0100 ERROR otopi.context context._executeMethod:152 Failed to execute stage 'Environment customization': Cannot upgrade PostgreSQL automatically - directory of the new version already exists


Version-Release number of selected component (if applicable):
ovirt-engine-setup-base-4.2.2.2-0.1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. have 4.1
2. install -d -o postgres -g postgres -m700 /var/opt/rh/rh-postgresql95/lib/pgsql/data
3. do upgrade

Actual results:
upgrade fails

Expected results:
upgrade could (re)use already existing empty dir

Additional info:

Comment 1 Yedidyah Bar David 2018-03-07 10:53:49 UTC
This is essentially a duplicate of bug 1546771. Keeping open to verify both flows (data dir is missing, data dir exists and empty). Feel free to close, though.

Comment 2 Jiri Belka 2018-03-07 13:39:19 UTC
So basically this test of the PG 9.5 data_dir existence prevents any upgrade from 4.1 to 4.2. Tested on clean 4.1 without any remnants of PG 9.5 before the upgrade itself.

Comment 3 Jiri Belka 2018-03-07 13:42:41 UTC
Current workaround, check that after first ugprade failure there's no /var/opt/rh/rh-postgresql95/lib/pgsql/data, then try again and it will pass.

Comment 4 Red Hat Bugzilla Rules Engine 2018-03-09 10:33:09 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 5 Jiri Belka 2018-03-21 13:05:13 UTC
ok, ovirt-engine-setup-base-4.2.2.4-0.1.el7.noarch

- tested with populated pg95 data dir
- tested with empty pg95 data dir

Comment 6 Sandro Bonazzola 2018-03-29 11:12:46 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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