Immich stopped working, error CONNECT_TIMEOUT database:5432 #24625
-
I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.
The bugI have Immich for almost 6 months and always works great, but this week it started to not working. Error: write CONNECT_TIMEOUT database:5432 code: 'CONNECT_TIMEOUT', errno: 'CONNECT_TIMEOUT', address: 'database', � The OS that Immich Server is running onUbuntu 25.10 on docker Version of Immich Serverv2.3.1 Version of Immich Mobile AppV2.3.0 Platform with the issue
Device make and modelSamsung Galaxy Fold 7 Your docker-compose.yml content#
# WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
# extends:
# file: hwaccel.transcoding.yml
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- '2283:2283'
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
# extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
# file: hwaccel.ml.yml
# service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/valkey/valkey:8-bookworm@sha256:ff21bc0f8194dc9c105b769aeabf9585fea6a8ed649c0781caeac5cb3c247884
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0-pgvectors0.2.0@sha256:fa4f6e0971f454cd95fec5a9aaed2ed93d8f46725cc6bc61e0698e97dba96da1
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
# Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
# DB_STORAGE_TYPE: 'HDD'
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
restart: always
volumes:
model-cache:Your .env content# 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=/mnt/data/immich_library
# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=/home/luizh/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=American/Phoenix
# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=v2.3.1
# 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=XXXXXX(redacted)
# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
DB_STORAGE_TYPE=SSDReproduction steps
Relevant log outputAdditional informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
|
Check the postgres logs |
Beta Was this translation helpful? Give feedback.
-
|
Did you recently change the password, or anything regarding the database mount? Is this mount also a local disk mount or a network disk mount? Can you help run |
Beta Was this translation helpful? Give feedback.
-
|
I have the same issue after I upgraded to v2.4.0 from v2.3.1. I can't access the web client. Looking at the docker logs for the server I saw I had the same error I tried to put it back to v2.3.1 and that doesn't seem to be working. Any help would be great. |
Beta Was this translation helpful? Give feedback.
-
|
I did changes on my docker compose(mainly the image for redis) and .env. I did not update to version 2.4.0 yet. You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variablesThe location where your uploaded files are storedUPLOAD_LOCATION=/mnt/data/immich_library The location where your database files are stored. Network shares are not supported for the databaseDB_DATA_LOCATION=/home/luizh/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#ListTZ=American/Phoenix The Immich version to use. You can pin this to a specific version like "v1.71.0"IMMICH_VERSION=v2.3.1 Connection secret for postgres. You should change it to a random passwordPlease use only the characters
|
Beta Was this translation helpful? Give feedback.
-
|
Sorry a bit late to post but I was having the same problem... in my case was a symptom of the docker service automatically assigning a subnet in 192.168.x.x instead of 172.x.x.x. In my case, I was not expecting this and only had firewall rules set up for the 172.16.x.x-172.31.x.x range and therefore blocked the new range. As for why this happened, I am mystified since I only have 6 docker container IPs assigned. Seems like it was assigning an entire /16 to each container network and never reusing ip ranges even after pruning. I'm probably wrong about the explanation and don't know/understand enough to tell you how to properly fix it on your end, but look up changing the docker default subnet ip range or default-address-pools. |
Beta Was this translation helpful? Give feedback.
I did changes on my docker compose(mainly the image for redis) and .env. I did not update to version 2.4.0 yet.
Like I said before, i have to restore an old backup of the postgres as well.
This is my final compose and .env:
.ENV
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=/mnt/data/immich_library
The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=/home/luizh/docker/immich-app/postgres
To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: htt…