I
Immich4w ago
BnW057

Immich Postgres authentication failures after version update

Setup: docker-compose.yml file with .env both fed and handled through Dockge without major issue until recently. After checking, I upgraded from v1.140.1->v.1.141.1, and immich server container failed to spin up correctly, outputting this error:
Initializing Immich v1.141.1
Detected CPU Cores: 24
Starting api worker
Starting microservices worker
[Nest] 7 - 09/11/2025, 8:48:26 PM LOG [Microservices:EventRepository] Initialized websocket server
PostgresError: password authentication failed for user "immich"
(...)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23) {
severity_local: 'FATAL',
severity: 'FATAL',
code: '28P01',
file: 'auth.c',
line: '329',
routine: 'auth_failed'
}
microservices worker error: PostgresError: password authentication failed for user "immich", stack: PostgresError: password authentication failed for user "immich"
at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
microservices worker exited with code 1
Killing api process
Initializing Immich v1.141.1
Detected CPU Cores: 24
Starting api worker
Starting microservices worker
[Nest] 7 - 09/11/2025, 8:48:26 PM LOG [Microservices:EventRepository] Initialized websocket server
PostgresError: password authentication failed for user "immich"
(...)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23) {
severity_local: 'FATAL',
severity: 'FATAL',
code: '28P01',
file: 'auth.c',
line: '329',
routine: 'auth_failed'
}
microservices worker error: PostgresError: password authentication failed for user "immich", stack: PostgresError: password authentication failed for user "immich"
at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
microservices worker exited with code 1
Killing api process
5 Replies
Immich
Immich4w ago
:wave: Hey @BnW057, 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. :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.
BnW057
BnW057OP4w ago
My docker compose:
services:
immich-server:
image: ghcr.io/immich-app/immich-server:release
security_opt:
- no-new-privileges:true
container_name: immich-server
hostname: immich-server
env_file:
- .env
networks:
- swag
depends_on:
- redis
- database
labels:
- com.centurylinklabs.watchtower.enable=false
restart: no
volumes:
- type: bind
source: /etc/localtime
target: /etc/localtime
read_only: true
- type: volume
source: upload
target: /usr/src/app/upload
immich-machine-learning:
(...)
redis:
image: docker.io/valkey/valkey:8-bookworm@sha256:a137a2b60aca1a75130022d6bb96af423fefae4eb55faf395732db3544803280
security_opt:
- no-new-privileges:true
container_name: immich-redis
hostname: immich-redis
networks:
- swag
healthcheck:
test: redis-cli ping || exit 1
labels:
- com.centurylinklabs.watchtower.enable=false
restart: always
database:
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
security_opt:
- no-new-privileges:true
container_name: immich-database
hostname: immich-database
networks:
- swag
env_file:
- .env
labels:
- com.centurylinklabs.watchtower.enable=false
restart: always
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: --data-checksums
shm_size: 128mb
volumes:
- type: volume
source: postgres
target: /var/lib/postgresql/data
volumes:
upload: {}
model-cache: {}
postgres: {}
networks:
swag:
external: true
services:
immich-server:
image: ghcr.io/immich-app/immich-server:release
security_opt:
- no-new-privileges:true
container_name: immich-server
hostname: immich-server
env_file:
- .env
networks:
- swag
depends_on:
- redis
- database
labels:
- com.centurylinklabs.watchtower.enable=false
restart: no
volumes:
- type: bind
source: /etc/localtime
target: /etc/localtime
read_only: true
- type: volume
source: upload
target: /usr/src/app/upload
immich-machine-learning:
(...)
redis:
image: docker.io/valkey/valkey:8-bookworm@sha256:a137a2b60aca1a75130022d6bb96af423fefae4eb55faf395732db3544803280
security_opt:
- no-new-privileges:true
container_name: immich-redis
hostname: immich-redis
networks:
- swag
healthcheck:
test: redis-cli ping || exit 1
labels:
- com.centurylinklabs.watchtower.enable=false
restart: always
database:
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
security_opt:
- no-new-privileges:true
container_name: immich-database
hostname: immich-database
networks:
- swag
env_file:
- .env
labels:
- com.centurylinklabs.watchtower.enable=false
restart: always
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: --data-checksums
shm_size: 128mb
volumes:
- type: volume
source: postgres
target: /var/lib/postgresql/data
volumes:
upload: {}
model-cache: {}
postgres: {}
networks:
swag:
external: true
My env (password redacted but I've tried changing/updating it on the postgres database without much success:
DB_PASSWORD=redacted
DB_USERNAME=immich
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich-redis
DB_PASSWORD=redacted
DB_USERNAME=immich
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich-redis
Database logs: docker logs immich-database
Using SSD storage

PostgreSQL Database directory appears to contain a database; Skipping initialization

2025-09-11 20:55:06.450 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf"
2025-09-11 20:55:06.450 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf"
2025-09-11 20:55:06.475 UTC [1] LOG: starting PostgreSQL 14.18 (Debian 14.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2025-09-11 20:55:06.475 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2025-09-11 20:55:06.475 UTC [1] LOG: listening on IPv6 address "::", port 5432
2025-09-11 20:55:06.479 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-09-11 20:55:06.485 UTC [32] LOG: database system was shut down at 2025-09-11 20:55:06 UTC
2025-09-11 20:55:06.496 UTC [1] LOG: database system is ready to accept connections
Using SSD storage

PostgreSQL Database directory appears to contain a database; Skipping initialization

2025-09-11 20:55:06.450 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf"
2025-09-11 20:55:06.450 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf"
2025-09-11 20:55:06.475 UTC [1] LOG: starting PostgreSQL 14.18 (Debian 14.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2025-09-11 20:55:06.475 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2025-09-11 20:55:06.475 UTC [1] LOG: listening on IPv6 address "::", port 5432
2025-09-11 20:55:06.479 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-09-11 20:55:06.485 UTC [32] LOG: database system was shut down at 2025-09-11 20:55:06 UTC
2025-09-11 20:55:06.496 UTC [1] LOG: database system is ready to accept connections
Attempts to solve: 1. Dove into database container with user (successfully) performed password change (successfully) restarted stack, same error. 2. Performed the same password change through different methods as shown in other support tickets/online documentation/postgres usage, the authentication error has remained. 3. Have checked against the latest docker-compose for any major discrepancies in the database/server layer, without luck. 4. Restarted the stack, let it attempt to run its course and eventually right itself (happened once in the past) 5. Restarted host machine just in case (worked once in the past) I have had a similar experience before where I did not do anything and it corrected itself, but this time it has spent long enough time restarting/not reaching the database/giving me the same error after a seemingly harmless upgrade from v.1.140.1 to v.1.141.1.
Immich
Immich4w ago
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
BnW057
BnW057OP3w ago
Host information:
OS: AlmaLinux 9.6 (Sage Margay) x86_64
Kernel: Linux 5.14.0-570.25.1.el9_6.x86_64
Uptime: 2 hours, 32 mins
Packages: 1475 (rpm)
Shell: bash 5.1.8
Terminal: zellij 0.39.2
CPU: AMD Ryzen 9 5900X (24) @ 3.70 GHz
GPU: NVIDIA GeForce GT 710 [Discrete]
Memory: 27.12 GiB / 62.22 GiB (44%)
Swap: Disabled
Disk (/): 45.24 GiB / 69.97 GiB (65%) - xfs
Disk (/data): 258.45 GiB / 937.82 GiB (28%) - ext4
Disk (/home): 19.36 GiB / 130.14 GiB (15%) - xfs
Locale: en_US.UTF-8
OS: AlmaLinux 9.6 (Sage Margay) x86_64
Kernel: Linux 5.14.0-570.25.1.el9_6.x86_64
Uptime: 2 hours, 32 mins
Packages: 1475 (rpm)
Shell: bash 5.1.8
Terminal: zellij 0.39.2
CPU: AMD Ryzen 9 5900X (24) @ 3.70 GHz
GPU: NVIDIA GeForce GT 710 [Discrete]
Memory: 27.12 GiB / 62.22 GiB (44%)
Swap: Disabled
Disk (/): 45.24 GiB / 69.97 GiB (65%) - xfs
Disk (/data): 258.45 GiB / 937.82 GiB (28%) - ext4
Disk (/home): 19.36 GiB / 130.14 GiB (15%) - xfs
Locale: en_US.UTF-8
User immich exists too, the containers have been spun down and removed in its entirety, spun up again, and immich server container still fails to spin up without restarting every two seconds, even after continuing to dig into what may be the issue on my end,
docker exec immich-database psql -U immich -d immich -c "SELECT usename, passwd FROM pg_shadow WHERE usename = 'immich';"
usename | passwd
---------+---------------------------------------------------------------------------------------------------------------------------------------
immich | SCRAM-SHA-256$4096:(redactedvalue)=
(1 row)
docker exec immich-database psql -U immich -d immich -c "SELECT usename, passwd FROM pg_shadow WHERE usename = 'immich';"
usename | passwd
---------+---------------------------------------------------------------------------------------------------------------------------------------
immich | SCRAM-SHA-256$4096:(redactedvalue)=
(1 row)
Additionally tested .env file being fed correctly with a temporary container
docker run --rm --env-file /opt/stacks/immich/.env alpine env | grep DB_
docker run --rm --env-file /opt/stacks/immich/.env alpine env | grep DB_
And got the expected result of variables being passed from that env file. Even checked in the database container directly with printenv, and saw the variables passed correctly as well. Not even deleting the container completely seems to have any effect if for some reason there is some cached value somewhere, which is what I'm hoping to get more information on here After continued diving and searching into what could have changed or what could be missing, I found this on GitHub: https://github.com/immich-app/immich/issues/1145 And the specific solution to my problem was to add the environment variable DB_HOSTNAME=your-respective-db-hostname which upon relaunching instantly fixed the issue.
Immich
Immich3w ago
[Issue] [BUG] Password authentication failed for user "postgres" (immich-app/immich#1145) This thread has been closed. To re-open, use the button below.

Did you find this page helpful?