Migration bullseye - Postresql 11 to 13 failed

Mon serveur YunoHost

Matériel: Serveur Dédié acheté en ligne /
Version de YunoHost: 11.0.9.8
J’ai accès à mon serveur : En SSH | Par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : oui
quelques configs, déplacements de certains dossiers dans des partitions dédiées…

Description du problème

Je me lance dans la mise à jour de mon serveur qui héberge plusieurs services. Comme expliqué ici, j’ai eu des soucis mineurs: YunoHost 11.0 (Bullseye) release / Sortie de YunoHost 11.0 (Bullseye) - #239 by rodinux

J’ai avancé un peu, mais je coince encore pour la dernière migration avec Postresql…

~$ sudo yunohost tools migrations list --pending
migrations: 
  description: Migrate databases from PostgreSQL 11 to 13
  disclaimer: None
  id: 0023_postgresql_11_to_13
  mode: auto
  name: postgresql_11_to_13
  number: 23
  state: pending

Avant de me lancer j’ai forcer l’upgrade de l’app Mobilizon au cas où et ensuite

~$ sudo yunohost tools migrations run --accept-disclaimer
Info: Running migration 0023_postgresql_11_to_13...
Package: mobilizon-ynh-deps
Depends: postgresql, postgresql-client, postgresql-contrib, postgis, postgresql-postgis-scripts, argon2, imagemagick, webp, gifsicle, jpegoptim, optipng, pngquant, file
Warning: unable to retrieve string to translate with key 'Failed to run command 'LC_ALL=C pg_upgradecluster -m upgrade 11 main'.
returncode: 1
stdout:
b'Restarting old cluster with restricted connections...\nStopping old cluster...\nCreating new PostgreSQL cluster 13/main ...\n/usr/lib/postgresql/13/bin/initdb -D /var/lib/postgresql/13/main --auth-local peer --auth-host md5 --encoding UTF8 --lc-collate en_US.UTF-8 --lc-ctype en_US.UTF-8\nThe files belonging to this database system will be owned by user "postgres".\nThis user must also own the server process.\n\nThe database cluster will be initialized with locale "en_US.UTF-8".\nThe default text search configuration will be set to "english".\n\nData page checksums are disabled.\n\nfixing permissions on existing directory /var/lib/postgresql/13/main ... ok\ncreating subdirectories ... ok\nselecting dynamic shared memory implementation ... posix\nselecting default max_connections ... 100\nselecting default shared_buffers ... 128MB\nselecting default time zone ... Europe/Paris\ncreating configuration files ... ok\nrunning bootstrap script ... ok\nperforming post-bootstrap initialization ... ok\nsyncing data to disk ... ok\n\nSuccess. You can now start the database server using:\n\n    pg_ctlcluster 13 main start\n\nVer Cluster Port Status Owner    Data directory              Log file\n13  main    5433 down   postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log\n\n/usr/lib/postgresql/13/bin/pg_upgrade -b /usr/lib/postgresql/11/bin -B /usr/lib/postgresql/13/bin -p 5432 -P 5433 -d /etc/postgresql/11/main -D /etc/postgresql/13/main\nFinding the real data directory for the source cluster      ok\nFinding the real data directory for the target cluster      ok\nPerforming Consistency Checks\n-----------------------------\nChecking cluster versions                                   ok\nChecking database user is the install user                  ok\nChecking database connection settings                       ok\nChecking for prepared transactions                          ok\nChecking for system-defined composite types in user tables  ok\nChecking for reg* data types in user tables                 ok\nChecking for contrib/isn with bigint-passing mismatch       ok\nChecking for tables WITH OIDS                               ok\nChecking for invalid "sql_identifier" user columns          ok\nCreating dump of global objects                             ok\nCreating dump of database schemas\n  mobilizon\n  postgres\n  template1\n                                                            ok\nChecking for presence of required libraries                 fatal\n\nYour installation references loadable libraries that are missing from the\nnew installation.  You can add these libraries to the new installation,\nor remove the functions using them from the old installation.  A list of\nproblem libraries is in the file:\n    loadable_libraries.txt\n\nFailure, exiting\nCluster is not running.\n'
stderr:
b'Error: pg_upgrade run failed. Logfiles are in /var/log/postgresql/pg_upgradecluster-11-13-main.doB6\nError during cluster dumping, removing new cluster\nError: could not stop old cluster, please do that manually\n'
' for default locale 'locales/en.json' file (don't panic this is just a warning)
Error: Migration 0023_postgresql_11_to_13 did not complete, aborting. Error: Failed to run command 'LC_ALL=C pg_upgradecluster -m upgrade 11 main'.
returncode: 1
stdout:
b'Restarting old cluster with restricted connections...\nStopping old cluster...\nCreating new PostgreSQL cluster 13/main ...\n/usr/lib/postgresql/13/bin/initdb -D /var/lib/postgresql/13/main --auth-local peer --auth-host md5 --encoding UTF8 --lc-collate en_US.UTF-8 --lc-ctype en_US.UTF-8\nThe files belonging to this database system will be owned by user "postgres".\nThis user must also own the server process.\n\nThe database cluster will be initialized with locale "en_US.UTF-8".\nThe default text search configuration will be set to "english".\n\nData page checksums are disabled.\n\nfixing permissions on existing directory /var/lib/postgresql/13/main ... ok\ncreating subdirectories ... ok\nselecting dynamic shared memory implementation ... posix\nselecting default max_connections ... 100\nselecting default shared_buffers ... 128MB\nselecting default time zone ... Europe/Paris\ncreating configuration files ... ok\nrunning bootstrap script ... ok\nperforming post-bootstrap initialization ... ok\nsyncing data to disk ... ok\n\nSuccess. You can now start the database server using:\n\n    pg_ctlcluster 13 main start\n\nVer Cluster Port Status Owner    Data directory              Log file\n13  main    5433 down   postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log\n\n/usr/lib/postgresql/13/bin/pg_upgrade -b /usr/lib/postgresql/11/bin -B /usr/lib/postgresql/13/bin -p 5432 -P 5433 -d /etc/postgresql/11/main -D /etc/postgresql/13/main\nFinding the real data directory for the source cluster      ok\nFinding the real data directory for the target cluster      ok\nPerforming Consistency Checks\n-----------------------------\nChecking cluster versions                                   ok\nChecking database user is the install user                  ok\nChecking database connection settings                       ok\nChecking for prepared transactions                          ok\nChecking for system-defined composite types in user tables  ok\nChecking for reg* data types in user tables                 ok\nChecking for contrib/isn with bigint-passing mismatch       ok\nChecking for tables WITH OIDS                               ok\nChecking for invalid "sql_identifier" user columns          ok\nCreating dump of global objects                             ok\nCreating dump of database schemas\n  mobilizon\n  postgres\n  template1\n                                                            ok\nChecking for presence of required libraries                 fatal\n\nYour installation references loadable libraries that are missing from the\nnew installation.  You can add these libraries to the new installation,\nor remove the functions using them from the old installation.  A list of\nproblem libraries is in the file:\n    loadable_libraries.txt\n\nFailure, exiting\nCluster is not running.\n'
stderr:
b'Error: pg_upgrade run failed. Logfiles are in /var/log/postgresql/pg_upgradecluster-11-13-main.doB6\nError during cluster dumping, removing new cluster\nError: could not stop old cluster, please do that manually\n'

Info: The operation 'Run migrations' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20220821-185811-tools_migrations_migrate_forward' to get help

Le log de l’échec
https://paste.yunohost.org/raw/dedomewovi

j’espère que vous pourrez m’aider à décoincer… Pourtant tout semble fonctionner… Mais là ça coince… On dirait du à la langue ??

Je pense que l’application qui utilise Postgresql est Mobilizon sur mon serveur…
Aïe, d’ailleurs cette fois Mobilizon a l’air cassé, ça ne marche plus…

Presque tenté de supprimer l’application et de réinstaller une sauvegarde… faîtes avant la migration vers bullseye…
Mauvaise idée… En tentant de désinstaller et réinstallé, toujours un soucis avec postresql 13
https://paste.yunohost.org/raw/xixigarihe

Curieusement si j’essaie de réinstaller l’app Mobilizon, j’ai la même erreur avec It looks like postgresql was not properly configured ? /etc/postgresql/13 is missing

Je ne saisis toujours pas j’ai un cluster pg 11 qui tourne

~$ pg_lsclusters
Ver Cluster Port Status Owner    Data directory              Log file
11  main    5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log

il y a un dossier /etc/postgresql/11/main présent, mais pas de 13…

J’ai bien peur d’avoir perdu les données de l’instance Mobilizon en attendant…
Comment démêler tout cela ??

Oups ! J’ai fini par y arriver !! j’ai créer manuellement le dossier manquant
$ sudo mkdir /etc/postgresql/13
puis
sudo pg_createcluster 13 main
Ensuite j’ai pu restaurer l’instance Mobilizon, par contre je ne pouvais plus me connecter, mais il m’a suffit de réinitialiser mon mot de passe et je me connecte de nouveau à l’instance avec les droits admin…
voili… cette fois tout est passé avec la migration…
`

Bon tout fonctionne maintenant pour la migration, j’ai tout de même quelque chose d’anormal , 2 clusters postgesql tournent !!

~$ pg_lsclusters
Ver Cluster Port Status Owner    Data directory              Log file
11  main    5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log
13  main    5433 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log

Comment supprimer le premier ?? Peut-être juste désinstaller postgresql-11 ??

J’ai voulu supprimer postgresql 11, et mobilizon a cassé !!

Et cette fois je n’arrive pas à restaurer la sauvegarde !! je crois qu’il lui faut postgresql 11 pour fonctionner, que je n’ai plus !!

En insistant ! d’abord, j’ai du supprimer les dossier /etc/postgresql/11 pour n’avoir plus que que le cluster pg 13 en fonctionnement…
Je fini par restaurer mobilizon, mais j’arrive sur une page blanche !!

Au secours !! Comment sauver mon instance mobilizon ?? Je ne sais même pas où trouver des erreurs… J’ai pu restaurer une sauvegarde, mais la page est désespérément blanche !!!

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