I
Immich3mo ago
squid

First time set up error: mkdir: cannot create directory ‘/var/lib/postgresql/data’: File exists

I'm getting an error when trying to set up on a home server that I don't understand. It looks like the postgres container is trying to set up a sql directory but can't because there's already one there. But when I go to the directory it's trying to initialize in, there's nothing there. I've tried clearing out the directory and resetting permissions, I've tried specifying a different directory for it to use, and still get the same error. Any troubleshooting tips or advice would be greatly welcome, I'm at a loss. I'm trying to run this installation on ubuntu server, with a mergerfs mounted file system. I also previously ran another application called Ghostfolio, which also used a sql instance. I've since removed it from my compose file and deleted it's directories. Could either of these factors be giving me issues trying to run immich?
13 Replies
Immich
Immich3mo ago
:wave: Hey @squid, 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 - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: 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.
squid
squidOP3mo ago
forgot my .env file
NoMachine
NoMachine3mo ago
can you share the result of ls -ltra ./immich/db/data ? also, since you are doing an initial setup, why not use the latest compose file? that one is a few releases old
squid
squidOP3mo ago
here's the ls results: ls -ltra ./immich/db/data ls: cannot open directory './immich/db/data': Permission denied sudo ls -ltra ./immich/db/data total 0 drwxr-xr-x 3 root root 26 Mar 16 14:12 .. drwx------ 2 999 systemd-journal 10 Mar 16 14:59 . i've updated my compose file as well, pulling the latest database and redis images... sorry it's been a while since I've tried to get this up and running. Still hitting the same error with the postgres container though
NoMachine
NoMachine3mo ago
did you replace your compose file? or just updated the images
squid
squidOP3mo ago
updated the images and removed a few lines but tried to keep the same compose file, i've got other stuff running in it... I can try copying it one for one though, one sec
NoMachine
NoMachine3mo ago
you have other stuff in the same compose file? I'll suggest you to first make Immich work on the default configuration ( https://github.com/immich-app/immich/releases/download/v1.135.3/docker-compose.yml ) and the you can start adding other containers to it, if it's really necessary
squid
squidOP3mo ago
that makes sense, I've now got a compose file with just immich in it, copied from the default ( https://github.com/immich-app/immich/releases/download/v1.135.3/docker-compose.yml ). I'm only running it, but still getting the same mkdir error for the postgres container
NoMachine
NoMachine3mo ago
check the folder permissions
squid
squidOP3mo ago
sudo ls -ld ./immich/db/data drwx------ 2 999 systemd-journal 10 Mar 16 14:59 ./immich/db/data sudo ls -ld ./immich drwxr-xr-x 8 root root 108 Mar 16 14:12 ./immich sudo ls -ld ./immich/db drwxr-xr-x 3 root root 26 Mar 16 14:12 ./immich/db is the root ownership/permissions causing problems?
Zeus
Zeus3mo ago
Please try again without mergerfs Use a raw local folder for the DB
squid
squidOP3mo ago
tried this and it seems to have worked, thank you!
Immich
Immich3mo ago
This thread has been closed. To re-open, use the button below.

Did you find this page helpful?