Bug 921524 - ovirt-engine-setup: failed to create engine db because of locale issue
Summary: ovirt-engine-setup: failed to create engine db because of locale issue
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.2.0
Assignee: Eli Mesika
QA Contact: Ilanit Stein
URL:
Whiteboard: infra
Depends On: 906416
Blocks: 948448
TreeView+ depends on / blocked
 
Reported: 2013-03-14 11:19 UTC by Yair Zaslavsky
Modified: 2016-02-10 19:29 UTC (History)
11 users (show)

Fixed In Version: sf11
Doc Type: Bug Fix
Doc Text:
Clone Of: 906416
Environment:
Last Closed:
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 12004 0 None None None Never

Description Yair Zaslavsky 2013-03-14 11:19:23 UTC
+++ This bug was initially created as a clone of Bug #906416 +++

Description of problem:
failed to create 'engine' db with the following message:

[engine-db-install] creating engine db on postgres.
/usr/share/ovirt-engine/dbscripts ~
/usr/share/ovirt-engine/dbscripts /usr/share/ovirt-engine/dbscripts
Creating the database: engine
dropdb: database removal failed: ERROR:  database "engine" does not exist
createdb: database creation failed: ERROR:  encoding "UTF8" does not match locale "en_US"
DETAIL:  The chosen LC_CTYPE setting requires encoding "LATIN1".
Failed to create database engine
/usr/share/ovirt-engine/dbscripts


my locale:

[root@localhost ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=



Version-Release number of selected component (if applicable):
ovirt-engine-3.2.0-2

How reproducible:
100%

Steps to Reproduce:
run engine-setup after fresh f18 installation 

Actual results:


Expected results:


Additional info:

--- Additional comment from Eli Mesika on 2013-02-03 11:52:19 EST ---

Please try to follow 
http://stackoverflow.com/questions/13115692/encoding-utf8-does-not-match-locale-en-us-the-chosen-lc-ctype-setting-requires

--- Additional comment from Eli Mesika on 2013-02-03 11:56:07 EST ---

please ignore comment #1 (not related)

--- Additional comment from Moritz Baumann on 2013-02-27 10:09:17 EST ---

The patch in ovirt-gerrit (http://gerrit.ovirt.org/12004) did fix the engine-setup run for me.

--- Additional comment from Eli Mesika on 2013-03-05 06:53:11 EST ---

fixed in commit : b12fc07

Comment 1 Eli Mesika 2013-03-14 12:37:54 UTC
please provide the output of the following comamnd

>psql -U postgres -l

Comment 2 Moritz Baumann 2013-03-14 13:42:28 UTC
ovirt-engine# psql -U postgres -l
                             List of databases
   Name    |  Owner   | Encoding | Collate | Ctype |   Access privileges   
-----------+----------+----------+---------+-------+-----------------------
 postgres  | postgres | LATIN1   | en_US   | en_US | 
 template0 | postgres | LATIN1   | en_US   | en_US | =c/postgres          +
           |          |          |         |       | postgres=CTc/postgres
 template1 | postgres | LATIN1   | en_US   | en_US | =c/postgres          +
           |          |          |         |       | postgres=CTc/postgres
(3 rows)

Comment 3 Moritz Baumann 2013-03-14 13:45:16 UTC
ups sorry, please ignore comment 2, its output was from F18 and not RHEV-M

Comment 5 Ilanit Stein 2013-03-21 14:46:47 UTC
Is there some other way to restore this bug beside install F18 please?

Comment 6 Eli Mesika 2013-03-24 07:53:20 UTC
1) Follow this from psql prompt:

postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
postgres=# \c template0
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
template0=# drop database template1;
template0=# create database template1 with template = template0 encoding = 'LATIN1';
template0=# update pg_database set datistemplate = TRUE where datname = 'template1';
template0=# \c template1
template1=# update pg_database set datallowconn = FALSE where datname = 'template0';

2) psql -U postgres -l 
   verify that you got template1 with the LATIN1 encoding

3) Test the solution

Comment 7 Ilanit Stein 2013-04-07 13:11:09 UTC
(In reply to comment #6)
> 1) Follow this from psql prompt:
> 
> postgres=# update pg_database set datallowconn = TRUE where datname =
> 'template0';
> postgres=# \c template0
> template0=# update pg_database set datistemplate = FALSE where datname =
> 'template1';
> template0=# drop database template1;
> template0=# create database template1 with template = template0 encoding =
> 'LATIN1';
> template0=# update pg_database set datistemplate = TRUE where datname =
> 'template1';
> template0=# \c template1
> template1=# update pg_database set datallowconn = FALSE where datname =
> 'template0';
> 
> 2) psql -U postgres -l 
>    verify that you got template1 with the LATIN1 encoding
> 
> 3) Test the solution

How do I get to psql prompt please? Is it from rhevm cli?

Comment 8 Eli Mesika 2013-04-07 13:29:02 UTC
 psql  -U postgres engine

Comment 9 Ilanit Stein 2013-04-07 13:55:39 UTC
Comment #6 steps can't be used to restore the problem. f18 installation is required.

Comment 10 Ilanit Stein 2013-04-10 06:40:47 UTC
It is not clear to me what are the steps I should do after f18 installation.

Comment 11 Eli Mesika 2013-04-15 09:10:09 UTC
(In reply to comment #10)
> It is not clear to me what are the steps I should do after f18 installation.

in Bug description it says :

Steps to Reproduce:
run engine-setup after fresh f18 installation 

So, I see no other steps to follow apart of checking that on top of f18

Comment 12 Ilanit Stein 2013-06-09 11:53:29 UTC
Verified on sf-17.2:

As Fedora is not supported, verification was done on rhel6.4, with hebrew language (system-config-language -> set to Hebrew; export LANG=he_IL).
engine-setup was successful

Comment 13 Itamar Heim 2013-06-11 08:29:24 UTC
3.2 has been released

Comment 14 Itamar Heim 2013-06-11 08:29:25 UTC
3.2 has been released

Comment 15 Itamar Heim 2013-06-11 08:32:01 UTC
3.2 has been released


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