Migration failed postgresql 13 to 15

I have searched the forum for similar issues

on

This category is for general issues regarding YunoHost, NOT apps.

on

What type of hardware are you using

Dedicated Server OVH

What YunoHost version are you running

12.0.6

How are you able to access your server

SSH

Describe your issue

Running migration 0029_postgresql_13_to_15…after that Service postgresql show me Status
Unknown since 12 Minutes.

Service postgresql status show:
sudo service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
Active: active (exited) since Fri 2024-11-01 21:09:28 CET; 4min 56s ago
Process: 43201 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 43201 (code=exited, status=0/SUCCESS)
CPU: 1ms

Nov 01 21:09:28 srv1…de systemd[1]: Starting postgresql.service - PostgreSQL RDBMS…
Nov 01 21:09:28 srv1…de systemd[1]: Finished postgresql.service - PostgreSQL RDBMS.

What can I do?

Share relevant logs or error messages

https://paste.yunohost.org/owaduyigov
https://paste.yunohost.org/raw/ikelenamuz

FATAL: data directory "/var/lib/postgresql/13/main" has invalid permissions\n2024-11-01 17:05:06.849 UTC [584134] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx

hmokay, can you share the output of sudo namei -l /var/lib/postgresql/13/main ?

Oh shit : (

f: /var/lib/postgresql/13/main
drwxr-xr-x root     root     /
drwxr-xr-x root     root     var
drwxr-xr-x root     root     lib
drwxrwxr-x postgres postgres postgresql
                             13 - No such file or directory

Can I install it new?

Hmokay, i’m confused then, the directory doesn’t exist ? Have you been doing some tweaks between the 13->15 migration attempt and now ? x_X

I have purged the the postgresql* and try to install it new.
But now I think I have to reinstall everything. Right?
Or can I still save it?

Uuuuuh wokay but like … purging it mean you deleted the data it holds ? x_x Those data are kind of important x_x

Didnt apt warn that it would uninstall some app-related packages ?

My guess is that you will have to restore backups of the corresponding app that depend on postgresql

Hello,
I have tried a backup restore from paperless-ngx.
But this failed

The log show me that:
https://paste.yunohost.org/raw/olimuqabej

Hmmmyes because it looks like postgres is down … maybe cluster 15.x ain’t up because of the story about the migration … Can you share the output of sudo pg_lsclusters ?

Ver Cluster Port Status Owner    Data directory              Log file
11  main    5433 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log
13  main    5435 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log
15  main    5434 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log
17  main    5432 online postgres /var/lib/postgresql/17/main /var/log/postgresql/postgresql-17-main.log

Hmf okay so you also have postgresql 17 which was probably installed by some specific app which does to this (cant remember which one) but it’s using port 5432 which is the usual port for postgres and should be used by version 15 instead … I don’t know exactly where to go from there … Personally I don’t really like the fact that postgresql 17 is there, this is cyberfrankenstein to me

Okay, thanks for your help. But i think now it is better to make a clean install with Debian 12 and Yunohost 12.