immich docker compose deployment - ERROR: unable to connect to database

Hi I have been trying to get immich installed on an Ubuntu LXC with docker / docker compose. I originally had it installed but was doing some cleanup and decided to remove and redeploy. So I have followed a number of different install guide but everyone gives me the same issue. I have tried installing through portainer (stack) as well as docker cli but same result. I receive no errors on the initial deployment. immich machine learning container running without error.
immich postgres throws a permission error: initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted Immich redis potentially throwing an error: 1:C 30 Nov 2024 19:20:51.651 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf ... 1:M 30 Nov 2024 19:20:51.653 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. all 3 of these containers show as running. No the immich server just shows starting but never changes and throws the following error: Initializing Immich v1.121.0 Detected CPU Cores: 8 Starting api worker Starting microservices worker (node:7) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead. [Nest] 7 - 11/30/2024, 7:40:21 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... microservices worker exited with code 1 Killing api process I am still relatively new to linux but everything looks like a permission based issue but I had this running previously on the came Proxmox node and docker install. Other docker continers are running without issue. Hope someone can assist with getting this resolved so I can use immich Thanks
14 Replies
Immich
Immich6mo ago
:wave: Hey @Dark Diviner, 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. :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. :blue_square: 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.
Zeus
Zeus6mo ago
This is likely related to LXC shenanigans which we don’t officially support Some people here use it so they may have some thoughts
bo0tzz
bo0tzz6mo ago
I've seen this error before on Docker in LXC, and nobody could figure out why, so the 'solution' ended up being to not use LXC
Dark Diviner
Dark DivinerOP6mo ago
thanks for the info. I was a bit afaid of that but totally understand because I have had some other issues on LXCs so I have basically stopped using them. Guess it is time to blow out the LXC and deploy it properly
Zeus
Zeus6mo ago
VMs are nearly performant to LXC, FWIW
Dark Diviner
Dark DivinerOP6mo ago
UPDATE: so build a Proxmox VM (ubuntu 24.04 server LTS) and went through and updated and installed docker and compose. I also installed portainer to verify the VM and docker was work as expected. I then went through and installed immich using the instruction posted on the github and... exact same errors!
Zeus
Zeus6mo ago
The permission issue is probably because you are using a NTFS or FAT filesystem If that’s the one you see
Dark Diviner
Dark DivinerOP6mo ago
I wish that were the case, they are btfs (synology NAS) and all my other apps (i am also running an aARRs stack) can access the mounts and files
Daniel
Daniel6mo ago
Are you trying to use a network mount for the database? Or does it have a local folder?
Dark Diviner
Dark DivinerOP6mo ago
it is a network location
Daniel
Daniel6mo ago
Don't Besides the fact of running into all kind of issues, even if you get it working it's way too unstable
Dark Diviner
Dark DivinerOP6mo ago
Got it. I will give local folder for the .yml, .env and db Let me just say @Daniel you are a champ. Looks like a network yml / db is not the way to go. created a folder locally for immich config and db (but kept my library via network path) and Immich is up and running. Thanks again for the assist
Daniel
Daniel6mo ago
Awesome! I'm not the only one who brought you to this point though :P
Dark Diviner
Dark DivinerOP6mo ago
agreed... all how put in their input, I appreciate the help

Did you find this page helpful?