Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confluence Server 6.8 on Linux: "invalid locale name" on PostgreSQL 9.6

James Harris May 12, 2018

 

Server: Ubuntu 18.04 Desktop 64-bit

In the Atlassian Instructions:

https://confluence.atlassian.com/conf68/database-setup-for-postgresql-947171095.html

I am trying to follow the step:

2. Next, create a database (for example confluence): 

  • Owner is your new database user (for example confluenceuser)
  • Character encoding must be set to utf8 encoding.
  • Collation must also be set to utf8.  Other collations, such as "C", are known to cause issues with Confluence. 

These are my commands and results:

sudo -u postgres psql

postgres=# \c
You are now connected to database "postgres" as user "postgres".
postgres-# \du
List of roles
Role name          | Attribute                                                                                               | Member of
------------------------+---------------------------------------------------------------------------------------+-----------
confluenceuser | Superuser, Create role, Create DB                                                 | {}
postgres              | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

postgres=# create database test1 owner=confluenceuser encoding=utf8 lc_collate=utf8;
ERROR: invalid locale name: "utf8"

I have Googled for several hours on this, and found only one possible cause and no solutions.

Possible cause: There is no file /etc/locale.conf, even though I ran:

root@JGist-Server-1:/etc# locale-gen
Generating locales (this might take a while)...
en_AG.UTF-8... done
...
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
Generation complete.
root@JGist-Server-1:/etc#

At any rate, it seems there are no possible candidates in the "supported locales" documentation that are anything like a simple "utf8" (or UTF8, UTF-8, etc.); all have language and country codes, like en_US.UTF-8 as seen above.

It seems to me there is something missing from the Instructions page linked above.

Please help.

1 answer

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 12, 2018

Hi James, 

 

1. In your command looks like you need also dpkg-reconfigure locales.

2. Regarding related locale in DBMS, in my experience, I use the ru_RU.utf-8 like this 

 ENCODING 'UTF8' LC_COLLATE = 'ru_RU.UTF-8' LC_CTYPE = 'ru_RU.UTF-8';

 

Hence don't afraid, let's set the en_US.UTF-8 locale for the LC_COLLATE.

 

 

Cheers,

Gonchik Tsymzhitov 

James Harris May 15, 2018

I had already tried en_US.UTF-8 and it didn’t work either;  I think it generated a syntax error with the arrow pointing at the hyphen as the cause of the syntax error.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events