I eventually could reinstall immich from scratch. I managed to restore the files as you said and the db by mixing up Backup and Restore | Immich and postgre commands here Immich - 502 Bad Gateway #2 - #10 by namron : gunzip --stdout ../yunohost.app/immich/backups/immich-db-backup-1746921600012.sql.gz | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" | sudo --login --user=immich PGUSER=immich PGPASSWORD=<pwd> psql --cluster=16/main
Now I get 502 with this error in immich-server logs :
e[32m[Nest] 4749 - e[39m15/05/2025 02:03:27 e[32m LOGe[39m e[33m[Microservices:EventRepository]e[39m e[32mInitialized websocket servere[39m
microservices worker error: PostgresError: authentification par mot de passe échouée pour l'utilisateur « immich », stack: PostgresError: authentification par mot de passe échouée pour l'utilisateur « immich »
at ErrorResponse (/var/www/immich/app/node_modules/postgres/cjs/src/connection.js:790:26)
at handle (/var/www/immich/app/node_modules/postgres/cjs/src/connection.js:476:6)
at Socket.data (/var/www/immich/app/node_modules/postgres/cjs/src/connection.js:315:9)
at Socket.emit (node:events:524:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
microservices worker exited with code 1
Killing api process
Starting api worker
Starting microservices worker
So the authentication fails but the password in /var/www/immich/env
is one I can manually use to connect to db. I am worried that is has something to do with --cluster=16/main
since I can’t connect to db without it. If the server does not use it, I don’t know what to do to fix the situation
Edit : I do believe it’s a story of clusters because in postgre services I see
-- Boot 79d81aeb84b9477b86d657ab908b9829 --
mai 15 02:18:17 systemd[1]: Starting postgresql@15-main.service - PostgreSQL Cluster 15-main...
mai 15 02:18:53 systemd[1]: Started postgresql@15-main.service - PostgreSQL Cluster 15-main.
which points to cluster 15 not cluster 16. I still don’t know how to fix though ^^’