Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1192954

Summary: Can not restore backup file to rhevm with non-default lc_messages
Product: Red Hat Enterprise Virtualization Manager Reporter: rhev-integ
Component: ovirt-engine-setupAssignee: Yedidyah Bar David <didi>
Status: CLOSED ERRATA QA Contact: Jiri Belka <jbelka>
Severity: unspecified Docs Contact:
Priority: high    
Version: 3.4.2CC: amureini, bazulay, ecohen, hkim, iheim, juwu, lpeer, lsurette, oourfali, pstehlik, rbalakri, Rhev-m-bugs, sbonazzo, sherold, yeylon, ylavi
Target Milestone: ---Keywords: Reopened, ZStream
Target Release: 3.5.1Flags: ylavi: Triaged+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: org.ovirt.engine-root-3.5.1-1 Doc Type: Bug Fix
Doc Text:
Previously, lc_messages might have been set to a non-English locale in postgresql.conf. The engine-backup --mode=restore command did not filter expected errors, which were in English, and failed. With this update, engine-backup --mode=restore was changed to require lc_messages to be 'en_US.UTF-8'. As a result, if lc_messages is not 'en_US.UTF-8', a more helpful error message is returned.
Story Points: ---
Clone Of: 1176457 Environment:
Last Closed: 2015-04-28 18:47:24 UTC Type: ---
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: 1176457    
Bug Blocks: 1193058, 1197441    

Comment 1 Yedidyah Bar David 2015-02-17 10:41:04 UTC
Decided to close, as the patch will be too intrusive. Will be fixed in 3.6.

For a workaround, please see the 3.6 bug 1176457 comment 9.

Please reopen if considered important enough for 3.5.

Comment 2 Yedidyah Bar David 2015-02-17 10:52:02 UTC
On a second thought, decided to reopen, but with a smaller change - will only patch engine-backup and not engine-setup. So on 3.5, the only change is that if engine-backup --mode=restore is ran with a non-en_US.UTF-8 lc_messages, it will exit with this message:

lc_messages is set to an unsupported value in postgresql.conf. Please set
it to en_US.UTF-8 and restart postgresql

Comment 3 Yedidyah Bar David 2015-02-17 13:15:37 UTC
Note to QE:

To reproduce:

1. install and setup engine
2. edit /var/lib/pgsql/data/postgresql.conf and set lc_messages = 'ja_JP.UTF-8' and restart postgresql
3. engine-backup --mode=backup --file=b1 --log=b1.log
4. engine-cleanup
5. engine-backup --mode=restore --file=b1 --log=b1-restore.log

Will fail with 'Errors while restoring database engine', will leave engine db populated. So a next attempt of (5.) will say it's not empty.

To verify:

1-4. Same as above
5. Same as above, will fail with:
lc_messages is set to an unsupported value in postgresql.conf. Please set it to en_US.UTF-8 and restart postgresql.
and will leave the database still empty.
6. Another attempt to run (5.) will fail the same
7. Fix postgresql.conf as instructed
8. Try (5.) again, should succeed.

Comment 4 Yedidyah Bar David 2015-02-18 10:36:19 UTC
Note that lc_messages in postgresql.conf defaults to the system locale when initing the db. So to simulate a real customer case, either install the OS with some non-English locale, or change /etc/sysconfig/i18n, before initing postgres. If you already did, e.g. on a system with rhevm set up, you can run engine-cleanup, and then
service postgresql stop
rm -rf /var/lib/pgsql/data

Then you can edit /etc/sysconfig/i18n and run engine-setup (which also calls initdb if auto provisioning postgres).

Comment 6 Jiri Belka 2015-03-06 11:17:34 UTC
ok, based on #3 and #4.

rhevm-tools-3.5.1-0.1.el6ev.noarch

Comment 7 errata-xmlrpc 2015-04-28 18:47:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://rhn.redhat.com/errata/RHSA-2015-0888.html