Uninett / nav-debian

Debian Package for NAV, based on a fork of the original repo
https://github.com/UNINETT/nav
GNU General Public License v3.0
4 stars 3 forks source link

[BUG] Database initialization fails on install #9

Closed eisengrau closed 3 years ago

eisengrau commented 3 years ago

Hello,

I tried to install NAV on a Debian Buster LXC container. At install, it seems like the database creation script fails:

Database initialization failed │ │ │ │ Script output: │ │ │ │ createdb: database creation failed: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) │ │ HINT: Use the same encoding as in the template database, or use template0 as template. │ │ Failed creating database nav │ │ Creating database nav owned by nav

I have changed the default locale on the system to EN_UK.UTF-8, but when I do an apt-get install nav, I get the same error moving on. I also get the following right after I run install:

Attempt to modify config file /etc/nav/db.conf failed │ │ │ │ Script output:

Script output is blank.

Did I miss a step? It seems like all dependencies are installed, followed the Debian install instructions.

lunkwill42 commented 3 years ago

Well, actually, in this case, your PostgreSQL database cluster was initialized before you configured your locale. Changing the system locale after-the-fact will not update the existing PostgreSQL cluster encoding - you will need to drop the database cluster and re-create it (assuming you haven't put important data into it already).

Check out the Debian commands pg_lscluster, pg_dropcluster and pg_createcluster.

eisengrau commented 3 years ago

Yes, that did the trick. I just re-created the container, and set the locale right before install, and it worked. Thank you!