Unable to create app pointing at replicated postgres dataset

brandon_

Cadet
Joined
Jan 28, 2024
Messages
5
I have recently set up a new server and I successfully ran a one time replication task to move all of my datasets to it from my old server. I made sure that the replicated datasets would not be read only as I'd like to use the old server as my backup server.

I want to use this new server as my primary server and migrate my apps to it. I set up all of my apps to store Postgres data in datasets which as stated above were replicated to the new server.

I was able to set up a few of the apps successfully by pointing the new apps at the replicated postgres datasets.

Vaultwarden, gitea, and immich all give the same error about password authentication failing for their corresponding databases. The errors in each app's postgres pod follows the same format:

Code:
2024-01-28 10:39:33.888451-06:002024-01-28 10:39:33.888 CST [481] FATAL: password authentication failed for user "immich"
2024-01-28 10:39:33.888599-06:002024-01-28 10:39:33.888 CST [481] DETAIL: Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
[/CODE]

Are there steps I can take to resolve this issue or will I have to start from scratch with these apps?
 

brandon_

Cadet
Joined
Jan 28, 2024
Messages
5
I didn't find the solution, I ended up nuking/paving.

The root cause of the issue seems to be that immich and other apps generate random passwords for postgres on creation. Not sure why it's not grabbing passwords from the pre-existing app configuration datasets.

I didn't have the patience or will to figure out what password it was trying to use and change it in the postgres container, but I think it might be possible to do so.
 

Jank

Cadet
Joined
Mar 29, 2024
Messages
4
Thanks for your reply.
I found the passwords, but didn't manage to fix it in the live system:
Paths in the backup of ix-applications:
/mnt/HDD1/ix_backup/backups/system-update--2024-03-05_21:12:07/immich/secrets/immich-postgres-creds
/mnt/HDD1/ix_backup/backups/system-update--2024-03-05_21:12:07/paperless-ngx/secrets/paperless-ngx-postgres-creds


So I walked the painfull way to save what was important. If anyone is desperate enough to search here, here is the short version:
  1. I set up fresh apps and created new datasets.
  2. I replicated the backuped datasets into the new ones - expect postgresql and postgresql backup.
  3. I exported the plain text dump of postresql from the corresponding postgresql backup dataset to my local computer
  4. I created a new local pg database and imported the dump with psql.
  5. I exported a "custom" backup of the database
  6. I installed app pgadmin on truenas to access the apps databases (if you solve the challange to unlock psql in pgadmin you don't need to take the detour via the own pg database - I didn't find a way to change the config of pgadmin "ENABLE_PSQL")
  7. I imported the "custom" backup via pgadmin
et voila: Apps and Data are up and running again.

Extra Step: I set up heavy script ;)
 
Top