Postgresql can't start after migration to 15

What type of hardware are you using: Other(?)
What YunoHost version are you running: 12.0.9
How are you able to access your server: SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: Migration failed then restarted

Describe your issue

Postgresql won’t start after migrating from 13 to 15.
No log written.

Details:
Migration to Yunohost 12 initially failed at Postgre migration because of some locales issues.
I fixed the locale and executed the Postgre specific migration command. It passed.
Then I launched again the Yuno migration script. All reported as successful.
While checking if everything was working, I figured Postgre was not…

After quite some research, I ended issuing the following command (see below)

It looks to me that somewhat it is either a permission issue to the log file, or the log file setting. But I don’t know what it’s supposed to be!

Share relevant logs or error messages

su postgres -c '/usr/lib/postgresql/15/bin/pg_ctl start -l /var/log/postgresql/postgresql-15-main.log'

could not change directory to “/var/log/yunohost/operations”: Permission denied
pg_ctl: no database directory specified and environment variable PGDATA unset

sudo pg_lsclusters

Ver Cluster Port Status Owner Data directory Log file
15 main 5433 down postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log

Edit : Forgot to mention: the log file in /var/log/postgresql/postgresql-15-main.log is empty.
The log file in /var/log/yunohost/operations has no mention of my various attempts to start Postgre.

Update and progress:
Soooo it appears that the config of Postgre was somewhat messed up, and I’m still not sure how much!!

I managed to start PostgreSQL using pg_ctl:

su postgres -c '/usr/lib/postgresql/15/bin/pg_ctl start -D /etc/postgresql/15/main -l /var/log/postgresql/postgresql-15-main.log'

and… Postgres started!
Victory! Victory? Nope, because now, I can connect to the database using psql, but somewhat, none of the apps can connect!
That’s because it listens to port 5433 and not the standard 5432.
That’s in the config file /etc/postgres/15/main/postgresql.conf.
Fixing the config file and restarting the server:

su postgres -c '/usr/lib/postgresql/15/bin/pg_ctl restart'

and now everything works!

Now… does anyone have the slightest idea what went wrong and if there’s anything else I should check??

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.