Description of problem: engine-setup fails to upgrade postgres from 9.2 to 9.5 if the system wide locale differs from system wide locale at first installation time engine-setup initializes its DB in en_US.UTF-8 while postgres own DB is initialized in system wide locale. pg_upgrade cannot change DB locale on the fly on upgrades. So if the user changed the system wide locale before running engine-setup to update the system from 4.1 to 4.2 and so from postgres 9.2 to postgres 9.5, engine-setup will fail with: 2017-12-20 15:53:42,967+0100 DEBUG otopi.plugins.ovirt_engine_setup.ovirt_engine.db.dbmsupgrade plugin.execute:926 execute-output: ('/opt/rh/rh-postgresql95/root/usr/bin/postgresql-setup', '--upgrade', '--upgrade-from=postgresql') stderr: * upgrading from 'postgresql.service' to 'rh-postgresql95-postgresql.service' * Upgrading database. ERROR: pg_upgrade tool failed ERROR: Upgrade failed. * See /var/lib/pgsql/upgrade_rh-postgresql95-postgresql.log for details. 2017-12-20 15:53:42,968+0100 DEBUG otopi.transaction transaction._prepare:66 exception during prepare phase Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/otopi/transaction.py", line 62, in _prepare element.prepare() File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/postgres.py", line 716, in prepare raiseOnError=True, File "/usr/lib/python2.7/site-packages/otopi/plugin.py", line 931, in execute command=args[0], RuntimeError: Command '/opt/rh/rh-postgresql95/root/usr/bin/postgresql-setup' failed to execute And in /var/lib/pgsql/upgrade_rh-postgresql95-postgresql.log something like: Performing Consistency Checks ----------------------------- Checking cluster versions ok Checking database user is the install user ok Checking database connection settings ok Checking for prepared transactions ok Checking for reg* system OID user data types ok Checking for contrib/isn with bigint-passing mismatch ok Checking for invalid "line" user columns ok Creating dump of global objects ok Creating dump of database schemas engine ovirt_engine_history postgres template1 ok lc_collate values for database "postgres" do not match: old "en_US.UTF-8", new "de_DE.UTF-8" Failure, exiting Version-Release number of selected component (if applicable): 4.2 beta How reproducible: 100% Steps to Reproduce: 1. setup oVirt-engine 4.1 with a specific locale 2. change system wide locale 3. add 4.2 repo and try to upgrade with engine-setup Actual results: RuntimeError: Command '/opt/rh/rh-postgresql95/root/usr/bin/postgresql-setup' failed to execute Expected results: A successful upgrade or a clear error stating how to fix Additional info: workaround: check the expected system wide locale in /var/lib/pgsql/upgrade_rh-postgresql95-postgresql.log, temporary set it under /etc/locale.conf, execute engine-setup to upgrade to 4.2 and then you can safely revert back /etc/locale.conf to what you need
Upgrade of engine with changed locales was successful and migrated databases stayed en_US.UTF-8. The same for DWH upgrade on separate machine. verified in ovirt-engine-setup-4.2.2.2-0.1.el7.noarch
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.