#Restarting postgres means starting fresh

1 messages · Page 1 of 1 (latest)

gusty shoal
#

Hi there

unning immich on unraid, i had redis inside the immich container and im using spaceinvaderones postgres container.

i can set it up, get it all working etc and its fine. however if i dare to restart the dockers for any reason the postgres container no longer starts. i get these errors

2025-08-13 00:18:06.381 BST [1] LOG: redirecting log output to logging collector process 2025-08-13 00:18:06.381 BST [1] HINT: Future log output will appear in directory "log". 2025-08-13 08:25:02.526 BST [1] FATAL: could not open directory "pg_notify": No such file or directory 2025-08-13 08:25:02.533 BST [1] LOG: database system is shut down PostgreSQL Database directory appears to contain a database; Skipping initialization PostgreSQL Database directory appears to contain a database; Skipping initialization
the only way i can get it working again is to delete all files in the postgres container folder in appdata but obviously that wipes everything so im back to setting immich up from scratch

docker logs

root@Hercules:~# docker logs PostgreSQL_Immich PostgreSQL Database directory appears to contain a database; Skipping initialization 2025-08-13 00:18:06.381 BST [1] LOG: redirecting log output to logging collector process 2025-08-13 00:18:06.381 BST [1] HINT: Future log output will appear in directory "log". PostgreSQL Database directory appears to contain a database; Skipping initialization 2025-08-13 08:25:02.526 BST [1] FATAL: could not open directory "pg_notify": No such file or directory 2025-08-13 08:25:02.533 BST [1] LOG: database system is shut down root@Hercules:~#

looking online some people have similar issues but not exactly the same, most mention a few restarts and its fine. I also noticed the unraid folder for the postgres container goes to 'unknown' for the owner and changes all permissions to no access. After i manually revert these it still doesnt boot

silver axleBOT
#

:wave: Hey @gusty shoal,

Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich immich.

References

#

Checklist

I have...

  1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
  2. :ballot_box_with_check: read applicable release notes.
  3. :ballot_box_with_check: reviewed the FAQs for known issues.
  4. :ballot_box_with_check: reviewed Github for known issues.
  5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
  6. :ballot_box_with_check: uploaded the relevant information (see below).
  7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable

(an item can be marked as "complete" by reacting with the appropriate number)

Information

In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:

  • Your docker-compose.yml and .env files.
  • Logs from all the containers and their status (see above).
  • All the troubleshooting steps you've tried so far.
  • Any recent changes you've made to Immich or your system.
  • Details about your system (both software/OS and hardware).
  • Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h).
  • The version of the Immich server, mobile app, and other relevant pieces.
  • Any other information that you think might be relevant.

Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)

If this ticket can be closed you can use the /close command, and re-open it later if needed.

silver axleBOT
quasi ibex
#

Unraid issue. Probably a mover or permissions issue of some kind

gusty shoal
#

so doing more on this. i binned off the community apps versions and tried docker compose version. all up and running. then i had to reboot my server and im back to the same errors. missing folders for postgres so i name those manually.
immich_postgres | 2025-08-14 09:13:13.899 UTC [57] FATAL: the database system is starting up immich_postgres | 2025-08-14 09:13:19.079 UTC [69] FATAL: the database system is starting up immich_server | Initializing Immich v1.137.3 immich_server | Detected CPU Cores: 12 immich_postgres | 2025-08-14 09:13:24.189 UTC [81] FATAL: the database system is starting up immich_server | Starting api worker immich_server | Starting microservices worker immich_server | [Nest] 7 - 08/14/2025, 9:13:27 AM LOG [Microservices:EventRepository] Initialized websocket server immich_postgres | 2025-08-14 09:13:27.130 UTC [82] FATAL: the database system is starting up immich_server | PostgresError: the database system is starting up

so im guessing it was processing something in the background when i took the server down (gracefully) and now its corrupt.

gusty shoal
#

so this is about the 3rd or fourth time ive tried now. i deleted all the postgress files so the db would recreate.

imported my first external library (aprox 0k files) took most of the day to be done but its done. great. took down the docker and put it back up all fine.

set pu my 2nd external library (approx1.3 million files) off it went, i paused all but thmbnail generation as that takes a stupid amount of time as it is.

i had a play around and last night got the update notification, took the docker down then back up all fine. wanted to try scaling out to speed things up. set up the machine learning on my windows machine (docker desktop) and removed the local ML url from immich so it only feeds stuff to that worker to reduce the load on the server running immich.

all working fine

checked this morning and see its got down to about 680k left to do. he ml stuff was paused as the worker was off. got another notification that there was an update. down down, docker up and boom errors and no database.

im not sure if its right but i changed the db dump to every hour to maybe have a backup that could be used. if thats done automatically if the db is failing i dont know but yet again i have no immich

am i trying to put too many files in at once?
should it pause all tasks before taking it down?
does it just not like unraid?

stuck pollen
#

Every hour is a lot if you ask me

#

For unraid, make sure you put your database storage on something that does no moving/optimizing

quasi ibex
#

Neither of these logs show any actual database issue

gusty shoal
gusty shoal
# quasi ibex Neither of these logs show any actual database issue

can you point me at any error/what these logs mean? i got through my large library yesterday and at some point in the night its crapped out again. I have backups but im also struggling with restoring these using the compose method in unraid. is it possible to restore the postress from this to a commmunity apps container?

stuck pollen
#

The error from immich_server means it can't reach the database, for postgres it seems the folder it's supposed to store things in is half broken, possibly a permissions issue

gusty shoal
# stuck pollen The error from immich_server means it can't reach the database, for postgres it...

so thats likely the issue with it wiping permissions. whenever i use it on unraid either community apps or compose the appdata folder for the postgres (and files within) gets set to 'unknown' for owner and 'no access' for user group but owner. i manually update this but nothing changes. I notice that it also starts saying folders are missing so i create those manually with the same permissions. The errors slowly change until im left with the last one which is the errno: -3008.

Im currently at the point of a fresh database again as im having trouble restoring one of the backups. So no more live logs unless i set it up again

#

the permissions thing is weird though as if it was unknown with no access id guess it wouldn't do imports and my db backups wouldnt be over 500MB. so something causes the change for some reason.

hearty peak
#

The appdata folder you're using, does that have an unraid mover configured? Is unraid moving around files from cache to HDDs there?

gusty shoal
hearty peak
#

Ok then I got nothing 😅 That's the only thing I see often times here that breaks people's installs

#

It might also be interesting to ask in #unraid, maybe people who use unraid on a daily basis know more