PostgreSQL migration failure

What type of hardware are you using: Other(?)
What YunoHost version are you running: 12.0.8.2 (stable)
How are you able to access your server: The webadmin
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: no

Describe your issue

N100 Mini PC

PostgreSQL failure when migrating to Debian 12.

ERROR - Migration 0029_postgresql_13_to_15 did not complete, aborting. Error: Failed to run command ‘LC_ALL=C pg_upgradecluster -m upgrade 13 main -v 15’.

Share relevant logs or error messages

https://paste.yunohost.org/raw/facaqeqawo

Bump. I’d like to have my server working again :face_exhaling:

Checking for presence of required libraries                 fatal

Your installation references loadable libraries that are missing from the
new installation.  You can add these libraries to the new installation,
or remove the functions using them from the old installation.  A list of
problem libraries is in the file:
    /var/lib/postgresql/15/main/pg_upgrade_output.d/20241214T002128.587/loadable_libraries.txt
Failure, exiting

I’m thinking it might be “just” the postgis stuff missing … Can you share the output of

sudo cat /var/lib/postgresql/15/main/pg_upgrade_output.d/20241214T002128.587/loadable_libraries.txt

?

Using SSH is a giant PITA, is there a way to access this from the web portal?

Is this helpful? It seems this file may have been deleted during migration. How do I get it back?

image

Could you retry the migration : sudo yunohost tools migrations run postgresql_13_to_15 --debug

Lacking options to quote the text, here’s a screenshot of a screenshot:

image

Is your server still running YNH 11, or is it broken half-way?

I see the error occurs with PostgreSQL, but with Immich flagged as broken, perhaps it doesn’t play nice withthe upgrade. Would it be an option to uninstall it before the upgrade, try the upgrade, and then re-install it, perhaps in combination with @ewilly’s suggestion?

immich can’t upgrade if the migration failed or postgresql is broken. Better is to first ensure that postgresql is migrated and working.

1 Like

I’ve retried it several times.

The migration to Deb 12 was successful. Just the database failed to migrate.

I don’t think Immich is broken, just the database.

If I uninstall and reinstall, would I lose all the data contained within? Videos, photos, etc? Would have done it already but I assume this is the case and I don’t want to do that. I wish Immich offered a backup option…

what is the output :

  • ‘sudo pg_lsclusters’
  • ‘sudo systemctl postgresql@15-main.service’
  • ‘sudo systemctl postgresql@16-main.service’
  • sudo pg_lsclusters

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

  • sudo systemctl postgresql@15-main.service

Unknown command verb postgresql@15-main.service.

  • ‘sudo systemctl postgresql@16-main.service’

Unknown command verb postgresql@16-main.service.

ok and that ones :

  • sudo yunohost tools migrations state
  • sudo yunohost --version

migrations:
0021_migrate_to_bullseye: skipped
0022_php73_to_php74_pools: skipped
0023_postgresql_11_to_13: skipped
0024_rebuild_python_venv: skipped
0025_global_settings_to_configpanel: skipped
0026_new_admins_group: skipped
0027_migrate_to_bookworm: done
0028_delete_legacy_xmpp_permission: done
0030_rebuild_python_venv_in_bookworm: done
0031_terms_of_services: done

yunohost:
repo: stable
version: 12.0.10
yunohost-admin:
repo: stable
version: 12.0.4
yunohost-portal:
repo: stable
version: 12.0.7
moulinette:
repo: stable
version: 12.0.3
ssowat:
repo: stable
version: 12.0.3

ok you are effectively on bookworm but i don’t see 0029_postgresql_13_to_15 and so it’s why you are still with old postgresql config.
Could you try sudo yunohost tools migrations run --debug and post the output ?

https://paste.yunohost.org/raw/noleqoqihe

ok and sudo cat /var/lib/postgresql/15/main/pg_upgrade_output.d/20250113T161312.650/loadable_libraries.txt

cat: /var/lib/postgresql/15/main/pg_upgrade_output.d/20250113T161312.650/loadable_libraries.txt: No such file or directory

rrr there is something wrong but can’t know what is missing/broken…
you could eventually try sudo yunohost app upgrade immich -u https://github.com/YunoHost-Apps/immich_ynh --no-safety-backup

Noting that I am in the same state as brooksl after an upgrade to bookworm today - same versions from yunohost --version, same errors on migration and same lack of dirs/services for postgresql/15