Project

General

Profile

Actions

Bug #34583

open

Installation failed with ERROR: invalid locale name: "en_US.utf8"

Added by Michael Krieger about 2 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Difficulty:
trivial
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

This is the same issue found in https://projects.theforeman.org/issues/17131

While the issue is easily resolved and so the original issue closed, might it be wise to add a check early in the installation and error out if the desired locale is not installed on the system rather than fail on every table creation in PostgreSQL? In my case, the system default is en_CA.UTF-8. Resolved by uncommenting en_US.UTF-8 in /etc/locale.gen, re-running locale-gen, and restarting postgresql.

2022-03-09 13:33:01 [NOTICE] [configure] 1000 configuration steps out of 1473 steps complete.
2022-03-09 13:33:04 [ERROR ] [configure] Error executing SQL; psql returned pid 1341776 exit 1: 'ERROR:  invalid locale name: "en_US.utf8" 
2022-03-09 13:33:04 [ERROR ] [configure] '
2022-03-09 13:33:04 [ERROR ] [configure] /Stage[main]/Foreman::Database::Postgresql/Postgresql::Server::Db[foreman]/Postgresql::Server::Database[foreman]/Postgresql_psql[CREATE DATABASE "foreman"]/command: change from 'notrun' to 'CREATE DATABASE "foreman" WITH TEMPLATE = "template0" ENCODING = \'utf8\' LC_COLLATE = \'en_US.utf8\' LC_CTYPE = \'en_US.utf8\' ' failed: Error executing SQL; psql returned pid 1341776 exit 1: 'ERROR:  invalid locale name: "en_US.utf8" 
2022-03-09 13:33:04 [ERROR ] [configure] '
2022-03-09 13:33:04 [ERROR ] [configure] /Stage[main]/Foreman::Database::Postgresql/Postgresql::Server::Db[foreman]/Postgresql::Server::Database[foreman]/Postgresql_psql[CREATE DATABASE "foreman"]: Failed to call refresh: Error executing SQL; psql returned pid 1341800 exit 1: 'ERROR:  invalid locale name: "en_US.utf8" 
2022-03-09 13:33:04 [ERROR ] [configure] '
2022-03-09 13:33:04 [ERROR ] [configure] /Stage[main]/Foreman::Database::Postgresql/Postgresql::Server::Db[foreman]/Postgresql::Server::Database[foreman]/Postgresql_psql[CREATE DATABASE "foreman"]: Error executing SQL; psql returned pid 1341800 exit 1: 'ERROR:  invalid locale name: "en_US.utf8" 
2022-03-09 13:33:04 [ERROR ] [configure] '
2022-03-09 13:33:13 [NOTICE] [configure] 1250 configuration steps out of 1473 steps complete.
2022-03-09 13:34:04 [NOTICE] [configure] System configuration has finished.

There were errors detected during install.
Please address the errors and re-run the installer to ensure the system is properly configured.
Failing to do so is likely to result in broken functionality.

No data to display

Actions

Also available in: Atom PDF