2 postgres instance

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.1.39
How are you able to access your server: The webadmin
SSH

Describe your issue

English

Hello,

I recently had a problem with the Tandoor app, which I couldn’t update. I tried deleting/reinstalling it, but the same thing happened. When I look at the logs, I see this error.

django.db.utils.NotSupportedError: PostgreSQL 14 or later is required (found 13.18).

In Yunohost, I notice this

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

Is it normal that I have two instances of Postgres?

On the WebUI and CLI side, everything seems to indicate that the migration from v13 to v15 went well:

  2: 
    description: Migrate databases from PostgreSQL 13 to 15
    disclaimer: None
    id: 0029_postgresql_13_to_15
    mode: auto
    name: postgresql_13_to_15
    number: 29
    state: done

These commands did not produce any results:

# yunohost tools migrations run 0029_postgresql_migration_13_to_15 --accept-disclaimer
Error: There is no migration called '0029_postgresql_migration_13_to_15'

# yunohost tools migrations run
Info: No migrations to run

Currently, I have this installed. Could an app be linked to Postgres v13?

# yunohost app list 
apps: 
  0: 
    description: Bypass paywall by acting as GoogleBot
    domain_path: 13ft.site-bidon.fr/
    id: 13ft
    name: 13ft
    version: 0.3.4~ynh2
  1: 
    description: Lightweight, simple to use and highly versatile wiki
    domain_path: site-bidon.fr/wiki
    id: dokuwiki
    name: Wiki
    version: 2025.05.14~ynh1
  2: 
    description: RSS aggregator with a nice and mobile-friendly design
    domain_path: site-bidon.fr/rss
    id: freshrss
    name: FreshRSS
    version: 1.28.0~ynh1
  3: 
    description: Publishing, memberships, subscriptions and newsletters platform
    domain_path: blog.site-bidon.fr/
    id: ghost
    name: Ghost
    version: 6.16.1~ynh1
  4: 
    description: Bypass paywalls as 12ft.io does
    domain_path: ladder.site-bidon.fr/
    id: ladder
    name: Ladder
    version: 0.0.21~ynh4
  5: 
    description: Multilingual grammar, style, and spell checker (API)
    domain_path: languagetool.site-bidon.fr/
    id: languagetool
    name: LanguageTool server
    version: 6.6~ynh2
  6: 
    description: Online storage, file sharing platform and various other applications
    domain_path: site-bidon.fr/nxt
    id: nextcloud
    name: Nextcloud
    version: 32.0.5~ynh1
  7: 
    description: Remote control alternative for self-hosting
    domain_path: rustdesk.site-bidon.fr/
    id: rustdesk-server
    name: RustDesk Server
    version: 1.1.15~ynh1
  8: 
    description: Save, sort, synchronize and share web addresses
    domain_path: site-bidon.fr/shaarli
    id: shaarli
    name: Shaarli
    version: 0.16.1~ynh1
  9: 
    description: Simple, modern, lightweight & fast web-based e-mail client
    domain_path: site-bidon.fr/mail
    id: snappymail
    name: Snappymail
    version: 2.38.2~ynh4
  10: 
    description: Save and classify articles. Read them later
    domain_path: site-bidon.fr/wal
    id: wallabag2
    name: Wallabag
    version: 2.6.14~ynh1
  11: 
    description: Create a beautiful blog or website easily
    domain_path: site-bidon.fr/blog
    id: wordpress
    name: WordPress
    version: 6.9.0~ynh1

With this information, could you tell me what is wrong and what I can do about it?

Thanks

Français

Bonjour,

J’ai récemment eu un problème avec l’app Tandoor que je n’arrivais plus à mettre à jour. J’ai tenté de la supprimer/réinstaller et même constat. Lorsque je jette un oeil aux logs je constate cette erreur.

django.db.utils.NotSupportedError: PostgreSQL 14 or later is required (found 13.18).

Dans Yunohost je constate ceci

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

C’est normal que j’ai deux instance de postgres ?

Côté WebUi et cli tout semble indiquer que la migration de la v13 à la v15 c’est bien passé :

  2: 
    description: Migrate databases from PostgreSQL 13 to 15
    disclaimer: None
    id: 0029_postgresql_13_to_15
    mode: auto
    name: postgresql_13_to_15
    number: 29
    state: done

Ces commandes n’ont rien données:

# yunohost tools migrations run 0029_postgresql_migration_13_to_15 --accept-disclaimer
Error: There is no migration called '0029_postgresql_migration_13_to_15'

# yunohost tools migrations run
Info: No migrations to run

Actuellement j’ai ceci d’installé, une app pourrait être lié à la v13 de postgres ?

# yunohost app list 
apps: 
  0: 
    description: Bypass paywall by acting as GoogleBot
    domain_path: 13ft.site-bidon.fr/
    id: 13ft
    name: 13ft
    version: 0.3.4~ynh2
  1: 
    description: Lightweight, simple to use and highly versatile wiki
    domain_path: site-bidon.fr/wiki
    id: dokuwiki
    name: Wiki
    version: 2025.05.14~ynh1
  2: 
    description: RSS aggregator with a nice and mobile-friendly design
    domain_path: site-bidon.fr/rss
    id: freshrss
    name: FreshRSS
    version: 1.28.0~ynh1
  3: 
    description: Publishing, memberships, subscriptions and newsletters platform
    domain_path: blog.site-bidon.fr/
    id: ghost
    name: Ghost
    version: 6.16.1~ynh1
  4: 
    description: Bypass paywalls as 12ft.io does
    domain_path: ladder.site-bidon.fr/
    id: ladder
    name: Ladder
    version: 0.0.21~ynh4
  5: 
    description: Multilingual grammar, style, and spell checker (API)
    domain_path: languagetool.site-bidon.fr/
    id: languagetool
    name: LanguageTool server
    version: 6.6~ynh2
  6: 
    description: Online storage, file sharing platform and various other applications
    domain_path: site-bidon.fr/nxt
    id: nextcloud
    name: Nextcloud
    version: 32.0.5~ynh1
  7: 
    description: Remote control alternative for self-hosting
    domain_path: rustdesk.site-bidon.fr/
    id: rustdesk-server
    name: RustDesk Server
    version: 1.1.15~ynh1
  8: 
    description: Save, sort, synchronize and share web addresses
    domain_path: site-bidon.fr/shaarli
    id: shaarli
    name: Shaarli
    version: 0.16.1~ynh1
  9: 
    description: Simple, modern, lightweight & fast web-based e-mail client
    domain_path: site-bidon.fr/mail
    id: snappymail
    name: Snappymail
    version: 2.38.2~ynh4
  10: 
    description: Save and classify articles. Read them later
    domain_path: site-bidon.fr/wal
    id: wallabag2
    name: Wallabag
    version: 2.6.14~ynh1
  11: 
    description: Create a beautiful blog or website easily
    domain_path: site-bidon.fr/blog
    id: wordpress
    name: WordPress
    version: 6.9.0~ynh1

Avec ces informations sauriez vous m’indiquer ce qui ne va pas et ce que je peux faire ?

Merci

Share relevant logs or error messages

Bonjour @ardnaxele

Analyse

Le problème est un classique d’une migration PostgreSQL incomplète. Normalement, la commande pg_upgradecluster devrait migrer les données puis reconfigurer les ports pour que le nouveau cluster prenne le port 5432. Ici, ça n’a visiblement pas été le cas :

  • Cluster v13 : port 5432 (port par défaut) → c’est celui que les apps utilisent par défaut
  • Cluster v15 : port 5433 → le bon cluster, mais sur un port secondaire

Le log journalctl du cluster v15 montre un fonctionnement tout à fait normal depuis août 2025, sans aucune erreur. Le problème n’est donc pas un crash ou une corruption, mais simplement une inversion de ports manquante.

Concernant les apps installées, parmi la liste, celles qui utilisent potentiellement PostgreSQL sont Wallabag (qui peut utiliser PostgreSQL ou SQLite sur YunoHost). Les autres :

  • Nextcloud
  • WordPress
  • Ghost
  • FreshRSS
  • etc…
    utilisent typiquement MySQL/MariaDB ou SQLite.

Hypothèses

  • Le comportement de pg_upgradecluster sur Debian est de migrer les données puis de reconfigurer les ports (ancien cluster → port secondaire, nouveau cluster → port principal). Si cette étape échoue silencieusement, on se retrouve exactement dans la situation décrite.
  • Le fait que Tandoor détecte PostgreSQL 13.18 confirme qu’il se connecte au port 5432 (le cluster v13)

Suggestions

La procédure à suivre est la suivante. Il faut d’abord vérifier l’état des bases, puis supprimer le vieux cluster et reconfigurer les ports.

Étape 1 — Vérifier les bases sur chaque cluster :

# Lister les bases sur le cluster v13 (port 5432)
sudo -u postgres psql -p 5432 -l

# Lister les bases sur le cluster v15 (port 5433)
sudo -u postgres psql -p 5433 -l

→ Si les bases applicatives (ex : wallabag, ou toute autre base liée à une app) sont bien présentes sur le cluster v15, on peut poursuivre sereinement.

Étape 2 — Vérifier quelle app utilise quel cluster :

# Voir les settings des apps qui utilisent postgresql
grep -r "db_type\|psql\|postgres" /etc/yunohost/apps/*/settings.yml

Étape 3 — Arrêter et supprimer le cluster v13 :

Précaution importante : Avant de faire le pg_dropcluster, bien vérifier avec l’étape 1 qu’il n’y a pas de bases sur le cluster v13 qui n’auraient pas été migrées vers le v15. Si c’est le cas, il faudra les migrer manuellement avec pg_dump / pg_restore avant de supprimer le cluster.

sudo pg_dropcluster 13 main --stop

Alternative plus prudente : si tu préfères y aller progressivement, tu peux simplement stopper le cluster v13 sans le supprimer :

sudo pg_ctlcluster 13 main stop

Tu pourras ensuite valider que tout fonctionne correctement avec le cluster v15 sur le port 5432, et ne supprimer le cluster v13 après les étapes 4 et 5 :wink: :

sudo pg_dropcluster 13 main

Étape 4 — Reconfigurer le cluster v15 sur le port 5432 :

# Stop le cluster v15
sudo systemctl stop postgresql@15-main

# Éditer la config du cluster v15
sudo nano /etc/postgresql/15/main/postgresql.conf
# Changer la ligne : port = 5433 → port = 5432

# Démarrer PostgreSQL
sudo systemctl start postgresql@15-main

Étape 5 : Vérifier :

pg_lsclusters
# Devrait montrer uniquement : 15  main  5432  online

Étape 6 : Réinstaller Tandoor si besoin :

sudo yunohost app install tandoor

Bon courage ! :wink:

Bonjour Djez,

Je te remercie pour ton retour hyper complet. Les commandes de vérification que tu m’a fourni me retourne ceci

root@site-bidon:/ # sudo -u postgres psql -p 5432 -l
                                                 List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    | ICU Locale | Locale Provider |   Access privileges   
-----------+----------+----------+-------------+-------------+------------+-----------------+-----------------------
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | =c/postgres          +
           |          |          |             |             |            |                 | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | =c/postgres          +
           |          |          |             |             |            |                 | postgres=CTc/postgres
(3 rows)

root@site-bidon:/ # sudo -u postgres psql -p 5433 -l
                                                 List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    | ICU Locale | Locale Provider |   Access privileges   
-----------+----------+----------+-------------+-------------+------------+-----------------+-----------------------
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | =c/postgres          +
           |          |          |             |             |            |                 | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | =c/postgres          +
           |          |          |             |             |            |                 | postgres=CTc/postgres
(3 rows)

root@site-bidon:/ # grep -r "db_type\|psql\|postgres" /etc/yunohost/apps/*/settings.yml
root@site-bidon:/ # 

Donc en fait je n’ai aucune app qui utilise Postgres ? Je peux enchainer serein à partir de l’étape 3 que tu m’as indiqué?

Encore une fois merci pour ton aide je ne suis pas hyper à l’aise en bdd.

Bonjour @ardnaxele

Tes deux clusters sont vides (seulement les bases système par défaut [postgres, template0, template1]), et aucune app n’utilise PostgreSQL. Tu peux donc y aller sans aucun risque de perte de données.

Bonjour @djez

Tout c’est bien passé je te remercie encore pour le temps que tu as pris pour me répondre.

1 Like

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