I
Immich•4mo ago
alvaro8659

Unable to connect to the database. Retrying (1)... microservices worker exited with code 1

I have Immich deployed on my synology(1522+). The strange thing is that it has worked for me sometimes and sometimes when I restarted I got this error. The thing is that now it always appears.😩
61 Replies
Immich
Immich•4mo ago
:wave: Hey @alvaro8659, 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
Immich
Immich•4mo ago
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.
GitHub
immich-app immich · Discussions
Explore the GitHub Discussions forum for immich-app immich. Discuss code, ask questions & collaborate with the developer community.
GitHub
Issues · immich-app/immich
High performance self-hosted photo and video management solution. - Issues · immich-app/immich
alvaro8659
alvaro8659OP•4mo ago
this is the configuration
Immich
Immich•4mo ago
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
Mraedis
Mraedis•4mo ago
What do the database logs say? They're at DB_DATA_LOCATION/logs and is the container actually down or not? docker ps -a
alvaro8659
alvaro8659OP•4mo ago
Hello Mraedis,
No description
alvaro8659
alvaro8659OP•4mo ago
where is "DB_DATA_LOCATION/logs " located??
Mraedis
Mraedis•4mo ago
All your containers have only been up for 5 minutes, do you shut down your server? Wherever you defined it to be ie your env var
alvaro8659
alvaro8659OP•4mo ago
Yes, I just restarted it, it turns out that 10% of the time it works. I restarted it because it wasn't giving any problems
alvaro8659
alvaro8659OP•4mo ago
now i think i have new error
alvaro8659
alvaro8659OP•4mo ago
The funny thing is that sometimes it works and sometimes it doesn't.
Mraedis
Mraedis•4mo ago
These are the container logs, the postgres logs are on disk in that folder I mentioned
alvaro8659
alvaro8659OP•4mo ago
okey, ill serarch
alvaro8659
alvaro8659OP•4mo ago
i put this location UPLOAD_LOCATION=./library The location where your database files are stored DB_DATA_LOCATION=./postgres
Mraedis
Mraedis•4mo ago
. means "this folder" so it's in where your compose file is, in a folder called postgres, and in that folder there is another called logs Looks like it can't reach the redis container though
alvaro8659
alvaro8659OP•4mo ago
No description
alvaro8659
alvaro8659OP•4mo ago
It's a synology, maybe it's somewhere else?
Mraedis
Mraedis•4mo ago
I can see the "postgres" folder right there Also please don't private message me @alvaro8659 😛
alvaro8659
alvaro8659OP•4mo ago
okey sorry
Mraedis
Mraedis•4mo ago
That's looking pretty good really Is it still restarting?
alvaro8659
alvaro8659OP•4mo ago
yes
Mraedis
Mraedis•4mo ago
docker ps -a are all containers restarting or just server + redis?
alvaro8659
alvaro8659OP•4mo ago
only server
alvaro8659
alvaro8659OP•4mo ago
No description
alvaro8659
alvaro8659OP•4mo ago
No description
Mraedis
Mraedis•4mo ago
In the portainer GUI, do you see IPs assigned like this?
No description
alvaro8659
alvaro8659OP•4mo ago
No description
Mraedis
Mraedis•4mo ago
All good... try selecting immich_server + redis and pressing restart
alvaro8659
alvaro8659OP•4mo ago
okey same problem
Mraedis
Mraedis•4mo ago
the redis reachable errors, right? Could you go in the redis container menu and recreate it?
alvaro8659
alvaro8659OP•4mo ago
No description
alvaro8659
alvaro8659OP•4mo ago
same error i recreate and restart server and redis
Mraedis
Mraedis•4mo ago
alright one more thing to try then stop the stack Then go to images and delete all unused ones the data is safe on your disk, no worries Then start the stack again, this should re-pull the containers This might take a while and I'm going for a run meantime :Eyey 👀
alvaro8659
alvaro8659OP•4mo ago
i got the same error
alvaro8659
alvaro8659OP•4mo ago
No description
alvaro8659
alvaro8659OP•4mo ago
ok wait i just restarted the containers. i'll try relaunching everything. will any of my configuration be deleted?
Mraedis
Mraedis•4mo ago
No the data is safe
alvaro8659
alvaro8659OP•4mo ago
No description
Mraedis
Mraedis•4mo ago
You forgot to change .env to stack.env if you made a new compose But I did tell you to stop the stack not delete it... Data is still safe but a bit more annoying to restart the stack
alvaro8659
alvaro8659OP•4mo ago
No description
alvaro8659
alvaro8659OP•4mo ago
No description
alvaro8659
alvaro8659OP•4mo ago
okey now working well starting
alvaro8659
alvaro8659OP•4mo ago
No description
alvaro8659
alvaro8659OP•4mo ago
Failed to deploy a stack: Network immich_default Creating Network immich_default Created Container immich_machine_learning Creating Container immich_redis Creating Container immich_postgres Creating Container immich_machine_learning Created Container immich_redis Created Container immich_postgres Created Container immich_server Creating Container immich_server Created Container immich_postgres Starting Container immich_machine_learning Starting Container immich_redis Starting Container immich_redis Started Container immich_machine_learning Started Error response from daemon: Bind mount failed: '/data/compose/17/postgres' does not exist
Mraedis
Mraedis•4mo ago
Ok stop the stack, please don't delete it show me ls -la /data/compose/10 and ls -la /data/compose/17
alvaro8659
alvaro8659OP•4mo ago
i delete it, but now i cant re-deploy
Mraedis
Mraedis•4mo ago
Could you please just do the above, thanks
alvaro8659
alvaro8659OP•4mo ago
No description
Mraedis
Mraedis•4mo ago
Do you keep deleting the stack or something? Stopping and deleting are not the same thing To be clear @alvaro8659 your data is safe on your synology but we need to point the stack in the right direction so it immich will run with it
alvaro8659
alvaro8659OP•3mo ago
perfect, so what do i do now¿
Mraedis
Mraedis•3mo ago
Ok please don't delete anything I don't tell you to for starters find /data/ -type d -name postgres let's start with that This folder still populated right?
alvaro8659
alvaro8659OP•3mo ago
yes its populate
Mraedis
Mraedis•3mo ago
Could you answer both questions please
alvaro8659
alvaro8659OP•3mo ago
Mraedis
Mraedis•3mo ago
Could you make a new stack in portainer and for the env file put this:
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/volume1/docker/immich-app/library
# The location where your database files are stored
DB_DATA_LOCATION=/volume1/docker/immich-app/postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/volume1/docker/immich-app/library
# The location where your database files are stored
DB_DATA_LOCATION=/volume1/docker/immich-app/postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
Er, this will be better for portainer GUI:
UPLOAD_LOCATION=/volume1/docker/immich-app/library
DB_DATA_LOCATION=/volume1/docker/immich-app/postgres
IMMICH_VERSION=release
DB_PASSWORD=postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
UPLOAD_LOCATION=/volume1/docker/immich-app/library
DB_DATA_LOCATION=/volume1/docker/immich-app/postgres
IMMICH_VERSION=release
DB_PASSWORD=postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
alvaro8659
alvaro8659OP•3mo ago
It seems to be working fine now! I'll wait to confirm that the problem doesn't happen again. Thank you very much for your help. Is there any way I can return the favor?
Mraedis
Mraedis•3mo ago
No worries, glad it went smoothly 🙂 The only favor you can do us is buy a license product key, other than that just keep your data safe!
alvaro8659
alvaro8659OP•3mo ago
If the error does not occur again, I will of course buy the license. Many thanks once again.😊💪

Did you find this page helpful?