Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1579268 - Upgrade of PostgreSQL during RHV 4.1 to 4.2 upgrade fails with locale mismatch
Upgrade of PostgreSQL during RHV 4.1 to 4.2 upgrade fails with locale mismatch
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
4.2.3
Unspecified Unspecified
urgent Severity high
: ovirt-4.2.3-1
: ---
Assigned To: Yedidyah Bar David
Lucie Leistnerova
: ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-17 05:31 EDT by Peter McGowan
Modified: 2018-06-26 03:10 EDT (History)
25 users (show)

See Also:
Fixed In Version: ovirt-engine-4.2.3.6
Doc Type: If docs needed, set a value
Doc Text:
This update enables engine-setup to upgrade PostgreSQL 9.2 to 9.5, even when the locale of the 9.2 database is different from the system locale.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-06-21 08:02:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Integration
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Engine setup log (761.60 KB, text/plain)
2018-05-17 06:13 EDT, Peter McGowan
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3449481 None None None 2018-05-23 18:25 EDT
oVirt gerrit 91334 ovirt-engine-4.2 MERGED Revert "packaging: setup: postgres95: Pass locale" 2018-05-17 10:45 EDT
oVirt gerrit 91335 ovirt-engine-4.2 MERGED packaging: setup: postgres95: Pass locale 2018-05-21 02:53 EDT
oVirt gerrit 91336 ovirt-engine-4.2.3.z MERGED Revert "packaging: setup: postgres95: Pass locale" 2018-05-17 11:35 EDT
oVirt gerrit 91337 ovirt-engine-4.2.3.z MERGED packaging: setup: postgres95: Pass locale 2018-05-17 11:36 EDT
Red Hat Product Errata RHSA-2018:2071 normal SHIPPED_LIVE Moderate: Red Hat Virtualization Manager security, bug fix, and enhancement update 2018-06-27 10:02:00 EDT

  None (edit)
Description Peter McGowan 2018-05-17 05:31:02 EDT
Description of problem:
Attempting to upgrade a RHV 4.1 installation to 4.2 fails with an error during the PostgreSQL upgrade. The file /var/lib/pgsql/upgrade_rh-postgresql95-postgresql.log contains the error: 

lc_collate values for database "postgres" do not match:  old "en_GB.UTF-8", new "en_US.UTF-8"

The databases on the server do indeed have mixed locales:

postgres=# \l
                                             List of databases
         Name         |        Owner         | Encoding |   Collate   |    Ctype    |   Access privileges
----------------------+----------------------+----------+-------------+-------------+-----------------------
 engine               | engine               | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 ovirt_engine_history | ovirt_engine_history | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 postgres             | postgres             | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 |
 template0            | postgres             | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres          +
                      |                      |          |             |             | postgres=CTc/postgres
 template1            | postgres             | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres          +
                      |                      |          |             |             | postgres=CTc/postgres
(5 rows)

The system locale is as follows:

# locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

Version-Release number of selected component (if applicable):
Upgrade from 4.1 to 4.2

How reproducible:
Every time

Steps to Reproduce:
1. Unsure. The existing RHV system was upgraded from 4.0 to 4.1, but I'm not sure how the original locale settings were created.

Actual results:
Upgrade failure

Expected results:
Upgrade success

Additional info:
Comment 1 Yaniv Lavi 2018-05-17 05:44:08 EDT
I believe many of our customers will be affected, by the unfiltered DB check.
Can you please assign urgently? I believe this is an async candidate.
Comment 2 Yedidyah Bar David 2018-05-17 05:52:16 EDT
(In reply to Peter McGowan from comment #0)
> Steps to Reproduce:
> 1. Unsure. The existing RHV system was upgraded from 4.0 to 4.1, but I'm not
> sure how the original locale settings were created.

This is the hard part :-(

I'd expected this bug to be fixed by the fix to bug 1528371 (that is, close it as duplicate of it), but apparently it's not, but not sure how to reproduce.

Please attach engine-setup logs, for a start, so that we can see we passed the correct/intended options to postgresql-setup. If we did, we need to understand how to reproduce.
Comment 3 Sandro Bonazzola 2018-05-17 06:09:54 EDT
Restoring lost needinfo
Comment 5 Peter McGowan 2018-05-17 06:13 EDT
Created attachment 1437871 [details]
Engine setup log
Comment 6 Peter McGowan 2018-05-17 06:22:06 EDT
As far as I can remember, the RHV 4.0 system was a clean RHEL 7 installed on 2017-12-05, expressly to upgrade a RHEV 3.6 environment. I would have installed a fairly basic RHEL 7 installation as suggested by the upgrade docs, then performed the steps to export the old 3.6 databases and install RHV 4.0. I don't remember explicitly setting the locale but I installed the RHEL 7 system using the GUI installer, so it was probably set by anaconda when I set my timezone.
Comment 7 Yedidyah Bar David 2018-05-17 06:22:55 EDT
Thanks. The fix for 1528371 didn't work - e.g., we didn't check lc_collate. Looking
Comment 8 Yedidyah Bar David 2018-05-17 06:32:44 EDT
OK, now I understand.

Seems like the fix for bug 1528371 for the 4.2 branch was broken.

Sorry, must have been something in the way I handled the back-porting.

Will fix soon.
Comment 10 Lucie Leistnerova 2018-05-28 07:45:59 EDT
Engine upgraded with postgres database in SQL_ASCII or en_GB.UTF-8 encoding with success.

verified in ovirt-engine-4.2.3.8-0.1.el7.noarch

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