As far as I can trace it back, the initial installation happened on February 7, 2024 (I think the server was commissioned a couple of days earlier, but the OS is Ubuntu 22.04, which, just like Discourse, was continuously updated).
Edit:
Not sure if that helps, but I think warnings about locale issues showing up is a relatively recent thing. I remember seeing them the last time I rebuilt the container, but I don’t think they were there from the start.
yeah, so the warnings are new (and should be fixed) but those only affect the commands that are copying over the initial files to the system, and not related to updates. The best suspicion we have is the database was initialized before the LANG was applied, and only causes issues with database updates.
One thing to try is set lang temporarily to en_US.UTF-8 for upgrading and swap back after. (obviously make sure to take backups)
$ cat postgres_data_new/pg_upgrade_output.d/20250131T032317.601/log/pg_upgrade_server.log
-----------------------------------------------------------------
pg_upgrade run on Fri Jan 31 03:23:17 2025
-----------------------------------------------------------------
command: "/usr/lib/postgresql/13/bin/pg_ctl" -w -l "/var/lib/postgresql/15/data/pg_upgrade_output.d/20250131T032317.601/log/pg_upgrade_server.log" -D "/var/lib/postgresql/13/data" -o "-p 50432 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/lib/postgresql'" start >> "/var/lib/postgresql/15/data/pg_upgrade_output.d/20250131T032317.601/log/pg_upgrade_server.log" 2>&1
waiting for server to start....2025-01-31 03:23:17.761 UTC [268] LOG: invalid value for parameter "lc_messages": "ru_RU.UTF-8"
2025-01-31 03:23:17.761 UTC [268] LOG: invalid value for parameter "lc_monetary": "ru_RU.UTF-8"
2025-01-31 03:23:17.761 UTC [268] LOG: invalid value for parameter "lc_numeric": "ru_RU.UTF-8"
2025-01-31 03:23:17.761 UTC [268] LOG: invalid value for parameter "lc_time": "ru_RU.UTF-8"
2025-01-31 03:23:17.761 UTC [268] FATAL: configuration file "/var/lib/postgresql/13/data/postgresql.conf" contains errors
stopped waiting
pg_ctl: could not start server
Examine the log output.
I have it in yml, sorry if it’s not clear, I’m trying step with tianon/postgres-upgrade:13-to-15 container from manual update and commented on that script.
I fixed that error by enabling ru_RU.UTF-8 locale in the container, but now there is another one:
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is the install user ok
Checking database connection settings ok
Checking for prepared transactions ok
Checking for system-defined composite types in user tables ok
Checking for reg* data types in user tables ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for user-defined encoding conversions ok
Checking for user-defined postfix operators ok
Checking for incompatible polymorphic functions ok
Creating dump of global objects ok
Creating dump of database schemas ok
lc_collate values for database "template1" do not match: old "ru_RU.UTF-8", new "en_US.utf8"
Failure, exiting