Postconf error

Questions about WAPT Server / Requests and help related to the WAPT server
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Aperitif
Messages: 3
Registration: June 16, 2020 - 2:21 PM

June 16, 2020 - 3:31 PM

Good morning,
Wapt server: 1.8.1
Debian Buster

There was a problem with postconf during database installation

Code: Select all

[*] postgresql - creating db wapt
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.
Traceback (most recent call last):
  File "/opt/wapt/waptserver/scripts/postconf.py", line 704, in <module>
    main()
  File "/opt/wapt/waptserver/scripts/postconf.py", line 439, in main
    ensure_postgresql_db(db_name=server_config['db_name'],db_owner=server_config['db_name'],db_password=server_config['db_password'])
  File "/opt/wapt/waptserver/scripts/postconf.py", line 319, in ensure_postgresql_db
    run(""" sudo -u postgres psql template1 -c "create database %s with owner=%s encoding='utf-8'; " """ % (db_name,db_owner), cwd='/opt/wapt/')
  File "/opt/wapt/waptserver/scripts/postconf.py", line 75, in run
    return subprocess.check_output(*args, shell=True, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command ' sudo -u postgres psql template1 -c "create database wapt with owner=wapt encoding='utf-8'; " ' returned non-zero exit status 1
It seems there's an encoding problem. Do you have any idea what it could be?

THANKS
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

June 16, 2020 - 6:50 PM

Good morning,
If it's a new installation, you need to install the Debian package "locales-all" before installing PostgreSQL...

See :
https://www.wapt.fr/fr/doc/waptserver-i ... -base.html

Code: Select all

apt install locales-all
localectl set-locale LANG=en_US.UTF-8
localectl status
Tranquil IT
Aperitif
Messages: 3
Registration: June 16, 2020 - 2:21 PM

June 17, 2020 - 08:24

Thank you.

It is indeed a new installation. I had already completed that part, and locales-all is already installed.
I should mention that it's a Proxmox container, in case that makes a difference.
Aperitif
Messages: 3
Registration: June 16, 2020 - 2:21 PM

June 17, 2020 - 09:34

After reinstalling on a virtual machine instead of a container, it works. So the problem seems to be there.
I'm not marking this as resolved yet; I'd like to know what's wrong with the container.

Since I'm in the area, I'd like to take this opportunity to thank you for this tool. I hope to convince the appropriate people to upgrade to the enterprise version.
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

June 17, 2020 - 10:55 PM

During the PostgreSQL installation, it initializes the template0 and template1 databases. The shell encoding used to install the .deb packages will also be used to run the `initdb` command. You need to configure your locale before installing the package.

Something like `export LC_ALL=en_US.utf8` or configuring it with `dpkg-reconfigure locales` should do the trick. Before installing PostgreSQL, double-check with the `export` command that you have `LC_*` lines.
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Locked