[BUG] Password authentication failed for user "postgres" #503

Closed
opened 2026-02-04 20:53:26 +03:00 by OVERLORD · 30 comments
Owner

Originally created by @rgirv3 on GitHub (Dec 20, 2022).

Describe the bug
A clear and concise description of what the bug is.

When trying to stand-up a new, clean installation using Portainer, I get a 500 when trying to setup a new user (screenshot below). A look at the server container's log shows:

[Nest] 7  - 12/20/2022, 8:35:13 PM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (6)...

error: password authentication failed for user "postgres"

    at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/dist/parser.js:287:98)

    at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/dist/parser.js:126:29)

    at Parser.parse (/usr/src/app/node_modules/pg-protocol/dist/parser.js:39:38)

    at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/dist/index.js:11:42)

    at Socket.emit (node:events:527:28)

    at addChunk (node:internal/streams/readable:315:12)

    at readableAddChunk (node:internal/streams/readable:289:9)

    at Socket.Readable.push (node:internal/streams/readable:228:10)

    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Task List

Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.

  • I have read thoroughly the README setup and installation instructions.
  • I have included my docker-compose file.
  • I have included my redacted .env file.
  • I have included information on my machine, and environment.

System

  • Phone OS [iOS, Android]: N/A
  • Server Version: altran1502/immich-server:release?
  • Mobile App Version: N/A

Screenshot 2022-12-20 154321

Originally created by @rgirv3 on GitHub (Dec 20, 2022). <!-- Note: Please search to see if an issue already exists for the bug you encountered. --> **Describe the bug** A clear and concise description of what the bug is. When trying to stand-up a new, clean installation using Portainer, I get a 500 when trying to setup a new user (screenshot below). A look at the server container's log shows: ``` [Nest] 7 - 12/20/2022, 8:35:13 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (6)... error: password authentication failed for user "postgres" at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/dist/parser.js:287:98) at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/dist/parser.js:126:29) at Parser.parse (/usr/src/app/node_modules/pg-protocol/dist/parser.js:39:38) at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/dist/index.js:11:42) at Socket.emit (node:events:527:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Socket.Readable.push (node:internal/streams/readable:228:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23) ``` **Task List** *Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.* - [X] I have read thoroughly the README setup and installation instructions. - [X] I have included my `docker-compose` file. - [X] I have included my redacted `.env` file. - [ ] I have included information on my machine, and environment. **System** - Phone OS [iOS, Android]: `N/A` - Server Version: `altran1502/immich-server:release?` - Mobile App Version: `N/A` ![Screenshot 2022-12-20 154321](https://user-images.githubusercontent.com/72104186/208762750-bace84e5-6412-4d1d-9ec0-56a616a3165d.png)
Author
Owner

@jrasm91 commented on GitHub (Dec 20, 2022):

Looks like a problem connecting to the database due to a wrong password. Church your credentials in the .env file?

@jrasm91 commented on GitHub (Dec 20, 2022): Looks like a problem connecting to the database due to a wrong password. Church your credentials in the .env file?
Author
Owner

@rgirv3 commented on GitHub (Dec 20, 2022):

All of the containers are new, and the password is established by the .env - so how would there be a mismatch? I did previously attach both my compose.yaml and my stack.env, but I don't see them associated with this post.

@rgirv3 commented on GitHub (Dec 20, 2022): All of the containers are new, and the password is established by the .env - so how would there be a mismatch? I did previously attach both my compose.yaml and my stack.env, but I don't see them associated with this post.
Author
Owner

@jrasm91 commented on GitHub (Dec 21, 2022):

That what the error says. Can you share your env variables and docker compose file?

@jrasm91 commented on GitHub (Dec 21, 2022): That what the error says. Can you share your env variables and docker compose file?
Author
Owner

@alextran1502 commented on GitHub (Dec 21, 2022):

Try to remove the postgres container and restart the stack.

@alextran1502 commented on GitHub (Dec 21, 2022): Try to remove the postgres container and restart the stack.
Author
Owner

@rgirv3 commented on GitHub (Dec 21, 2022):

@alextran1502, thanks for the suggestion but that did not work.

Realized my compose and env files didn't upload properly because of the filetype. Changed to .txt and attached.
compose.txt
stack.txt

@rgirv3 commented on GitHub (Dec 21, 2022): @alextran1502, thanks for the suggestion but that did not work. Realized my compose and env files didn't upload properly because of the filetype. Changed to .txt and attached. [compose.txt](https://github.com/immich-app/immich/files/10274127/compose.txt) [stack.txt](https://github.com/immich-app/immich/files/10274128/stack.txt)
Author
Owner

@alextran1502 commented on GitHub (Dec 21, 2022):

Try to remove these two lines in the environment variable

IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001

@alextran1502 commented on GitHub (Dec 21, 2022): Try to remove these two lines in the environment variable IMMICH_WEB_URL=http://immich-web:3000 IMMICH_SERVER_URL=http://immich-server:3001
Author
Owner

@alextran1502 commented on GitHub (Dec 21, 2022):

Another suggestion just to test out the hypothesis. Create another stack and try changing just the jwtsecrect and the upload_location, leave the rest untouched to see if you can get it running

@alextran1502 commented on GitHub (Dec 21, 2022): Another suggestion just to test out the hypothesis. Create another stack and try changing just the jwtsecrect and the upload_location, leave the rest untouched to see if you can get it running
Author
Owner

@jrasm91 commented on GitHub (Dec 21, 2022):

The postgres container has a persistent volume you would have to remove to actually "re-deploy" it. If it started up without those env variables, the default password would have been set to "postgres" instead.

The easiest thing to do would probably be remove the stack, delete the pg_data volume and then re-deploy it.

@jrasm91 commented on GitHub (Dec 21, 2022): The postgres container has a persistent volume you would have to remove to actually "re-deploy" it. If it started up without those env variables, the default password would have been set to "postgres" instead. The easiest thing to do would probably be remove the stack, delete the pg_data volume and then re-deploy it.
Author
Owner

@rgirv3 commented on GitHub (Dec 21, 2022):

The postgres container has a persistent volume you would have to remove to actually "re-deploy" it. If it started up without those env variables, the default password would have been set to "postgres" instead.

The easiest thing to do would probably be remove the stack, delete the pg_data volume and then re-deploy it.

Thank you so much! This was the issue. After stopping the stack, removing the volume, and redeploying--everything worked perfectly.

Appreciate the help!

@rgirv3 commented on GitHub (Dec 21, 2022): > The postgres container has a persistent volume you would have to remove to actually "re-deploy" it. If it started up without those env variables, the default password would have been set to "postgres" instead. > > The easiest thing to do would probably be remove the stack, delete the pg_data volume and then re-deploy it. Thank you so much! This was the issue. After stopping the stack, removing the volume, and redeploying--everything worked perfectly. Appreciate the help!
Author
Owner

@Normanras commented on GitHub (May 8, 2023):

This happened to me today when I was trying to deploy with a new password but hit some errors. Despite removing the stack a few times, it is good to know that the db is a persistent volume. This solved it for me too! Thanks.

@Normanras commented on GitHub (May 8, 2023): This happened to me today when I was trying to deploy with a new password but hit some errors. Despite removing the stack a few times, it is good to know that the db is a persistent volume. This solved it for me too! Thanks.
Author
Owner

@chewenkai commented on GitHub (Feb 21, 2024):

Thanks for remind me the persistent volume. For more detail, you can list the volume by:

docker volume ls
DRIVER    VOLUME NAME
local     5de8592e5652a82df129e612d1841dee12636b46aacf7856808a09c04b883c77
local     9b0a0a040e0ca92f1676ee640b32707856642902b9ebd816d17f0b6d99c77c9d
local     bc424ba5fd3a6d6deb5e78c90b69c77bf780ea55a332be9f77c4a1c260eec95d
local     c8c28cacb98d82e49ca072aa8a68b784de417e441bd193528b9e16c08cbabc17
local     c8407aacda7582e838f859907dd0bb7fba681db0430fed394bbd7c0754c1bb12
local     ce93a01ffff262712341b592aebe7342282b1936d6094892111d4ec66ebb6b60
local     f4e974bd350c9c2c5cd3dd6203876c2fec0b70816ab10622ef5639173540bce3
local     immich_model-cache
local     immich_pgdata

and remove volume with prefix of immich by:

docker volume rm immich_model-cache immich_pgdata
@chewenkai commented on GitHub (Feb 21, 2024): Thanks for remind me the persistent volume. For more detail, you can list the volume by: ``` docker volume ls ``` ``` DRIVER VOLUME NAME local 5de8592e5652a82df129e612d1841dee12636b46aacf7856808a09c04b883c77 local 9b0a0a040e0ca92f1676ee640b32707856642902b9ebd816d17f0b6d99c77c9d local bc424ba5fd3a6d6deb5e78c90b69c77bf780ea55a332be9f77c4a1c260eec95d local c8c28cacb98d82e49ca072aa8a68b784de417e441bd193528b9e16c08cbabc17 local c8407aacda7582e838f859907dd0bb7fba681db0430fed394bbd7c0754c1bb12 local ce93a01ffff262712341b592aebe7342282b1936d6094892111d4ec66ebb6b60 local f4e974bd350c9c2c5cd3dd6203876c2fec0b70816ab10622ef5639173540bce3 local immich_model-cache local immich_pgdata ``` and remove volume with prefix of immich by: ``` docker volume rm immich_model-cache immich_pgdata ```
Author
Owner

@Daniel-Ze commented on GitHub (Oct 15, 2024):

Hi,

I know this is a little specific but I think I'm facing the same problem though on a Synology NAS. I'm running Immich as a docker project in "Container Manager". I was running the v1.112.0 and I was thinking of updating to the newest version v1.118.0.

I stopped the project, ran "Clean" to remove the containers and "Build" to re-download the newest containers. After starting the project the container "immich_server" is stuck in a loop.

2024/10/15 21:18:29,stderr,error: password authentication failed for user "postgres"

This is the only error message within the log output. I see that a possible solution is to remove the persistent volumes 'immich_model-cache' and 'immich_pgdata'.
When I SSH into the NAS and run 'docker volume ls' this is what I get:

DRIVER    VOLUME NAME
local     immich-app_model-cache

There is no 'immich-app_pgdata' volume and deleting only the 'immich-app_model-cache' does not solve the problem.

Any idea how to troubleshoot this problem would be highly appreciated.

Cheers!

@Daniel-Ze commented on GitHub (Oct 15, 2024): Hi, I know this is a little specific but I think I'm facing the same problem though on a Synology NAS. I'm running Immich as a docker project in "Container Manager". I was running the v1.112.0 and I was thinking of updating to the newest version v1.118.0. I stopped the project, ran "Clean" to remove the containers and "Build" to re-download the newest containers. After starting the project the container "immich_server" is stuck in a loop. ``` 2024/10/15 21:18:29,stderr,error: password authentication failed for user "postgres" ``` This is the only error message within the log output. I see that a possible solution is to remove the persistent volumes 'immich_model-cache' and 'immich_pgdata'. When I SSH into the NAS and run 'docker volume ls' this is what I get: ``` DRIVER VOLUME NAME local immich-app_model-cache ``` There is no 'immich-app_pgdata' volume and deleting only the 'immich-app_model-cache' does not solve the problem. Any idea how to troubleshoot this problem would be highly appreciated. Cheers!
Author
Owner

@Daniel-Ze commented on GitHub (Oct 20, 2024):

For anyone ending up here my steps for fixing my problem:

  1. Synology DSM - Container Manager -> stop project and clean
  2. SSH into my NAS
# go to immich-app folder
$ cd /volume/docker/immich-app

# run docker-compose to start immich
/volume/docker/immich-app $ docker-compose up -d

# get into the postrgres container
/volume/docker/immich-app $ docker exec -it immich_postgres bash

In the postgres container:

# connect to database "immich" with the username "postgres"
root@123456abcdefg:/# psql -U postgres -d immich

# change the password of the user "postgres" to the password supplied in the ".env" file
immich=# ALTER USER postgres WITH PASSWORD 'your .env file password';

After this everything started to work fine. This seems to be persistent after 'docker-compose down' and 'docker-compose up -d' everything seems to be working just fine.

@Daniel-Ze commented on GitHub (Oct 20, 2024): For anyone ending up here my steps for fixing my problem: 1. Synology DSM - Container Manager -> stop project and clean 2. SSH into my NAS ``` # go to immich-app folder $ cd /volume/docker/immich-app # run docker-compose to start immich /volume/docker/immich-app $ docker-compose up -d # get into the postrgres container /volume/docker/immich-app $ docker exec -it immich_postgres bash ``` In the postgres container: ``` # connect to database "immich" with the username "postgres" root@123456abcdefg:/# psql -U postgres -d immich # change the password of the user "postgres" to the password supplied in the ".env" file immich=# ALTER USER postgres WITH PASSWORD 'your .env file password'; ``` After this everything started to work fine. This seems to be persistent after 'docker-compose down' and 'docker-compose up -d' everything seems to be working just fine.
Author
Owner

@iSevenDays commented on GitHub (Oct 28, 2024):

After updating to 1.119.0 I get the same issue. And the post above unfortunately didn't help. Deleting and creating project from scratch also didn't help.
I see env is being used, because DB_PASSWORD is parsed from .env
image
image

@iSevenDays commented on GitHub (Oct 28, 2024): After updating to 1.119.0 I get the same issue. And the post above unfortunately didn't help. Deleting and creating project from scratch also didn't help. I see env is being used, because DB_PASSWORD is parsed from .env <img width="1346" alt="image" src="https://github.com/user-attachments/assets/3868feb7-7992-4736-be8b-28a0414269c6"> <img width="973" alt="image" src="https://github.com/user-attachments/assets/21665127-e131-43fa-a808-391ff8e2b090">
Author
Owner

@Inlustra commented on GitHub (Nov 15, 2024):

@iSevenDays I'm also seeing this after the upgrade.
Did you manage to resolve it?

@Inlustra commented on GitHub (Nov 15, 2024): @iSevenDays I'm also seeing this after the upgrade. Did you manage to resolve it?
Author
Owner

@alextran1502 commented on GitHub (Nov 16, 2024):

@Inlustra Do you remember what changes you made to the .env file and the docker-compose.yml file?

@alextran1502 commented on GitHub (Nov 16, 2024): @Inlustra Do you remember what changes you made to the .env file and the docker-compose.yml file?
Author
Owner

@Inlustra commented on GitHub (Nov 16, 2024):

@alextran1502 In my case - I'm not sure what happened.
I changed the password using the above - I figured it couldn't hurt. (In particular my password had special characters which I removed because of escaping, just to make my life easier)

But finally the issue I had was actually a DB_HOSTNAME was somehow incorrectly set between versions?
Basically before it was

DB_HOSTNAME=immich_database
But the correct version was
DB_HOSTNAME=immich-database

I'm not sure how that changed between versions but I totally missed it when asking the question. Definitely user error I guess.
I have other databases, and I copy it into a bigger project, so I guess this time I must have manually changed the name to immich-database when previously it was immich_database

I'm also not sure why it was appearing as an authentication error however

@Inlustra commented on GitHub (Nov 16, 2024): @alextran1502 In my case - I'm not sure what happened. I changed the password using the above - I figured it couldn't hurt. (In particular my password had special characters which I removed because of escaping, just to make my life easier) But finally the issue I had was actually a DB_HOSTNAME was somehow incorrectly set between versions? Basically before it was `DB_HOSTNAME=immich_database` But the correct version was `DB_HOSTNAME=immich-database` I'm not sure how that changed between versions but I totally missed it when asking the question. Definitely user error I guess. I have other databases, and I copy it into a bigger project, so I guess this time I must have manually changed the name to immich-database when previously it was immich_database I'm also not sure why it was appearing as an authentication error however
Author
Owner

@alextran1502 commented on GitHub (Nov 16, 2024):

@Inlustra Which version did you update from?

It might be helpful to hop on Discord and open a Help-desk-support ticket to get help there

@alextran1502 commented on GitHub (Nov 16, 2024): @Inlustra Which version did you update from? It might be helpful to hop on Discord and open a Help-desk-support ticket to get help there
Author
Owner

@Inlustra commented on GitHub (Nov 16, 2024):

@alextran1502 All good! All fixed my end, was user error! Thank you for the support!

That being said - weird that it was presenting as an authentication error when in theory it should probably have been presenting as a not-found error

@Inlustra commented on GitHub (Nov 16, 2024): @alextran1502 All good! All fixed my end, was user error! Thank you for the support! That being said - weird that it was presenting as an authentication error when in theory it should probably have been presenting as a not-found error
Author
Owner

@alextran1502 commented on GitHub (Nov 16, 2024):

@Inlustra I assume it created a brand new database

@alextran1502 commented on GitHub (Nov 16, 2024): @Inlustra I assume it created a brand new database
Author
Owner

@Inlustra commented on GitHub (Nov 16, 2024):

Potentially! I'm not sure what was actually going on in the end. Changing just the service name most likely did something funky.
I've just spent a couple minutes trying to reproduce it but was unable to.

Odd that everyone saw a resurgence in this error around the same time

Will leave this here for anyone else:

Check your database service name (In your docker-compose.yml) against the DB_HOSTNAME environment variable

@Inlustra commented on GitHub (Nov 16, 2024): Potentially! I'm not sure what was actually going on in the end. Changing just the service name most likely did something funky. I've just spent a couple minutes trying to reproduce it but was unable to. Odd that everyone saw a resurgence in this error around the same time Will leave this here for anyone else: # Check your database service name (In your docker-compose.yml) against the `DB_HOSTNAME` environment variable
Author
Owner

@Mas8764 commented on GitHub (Dec 4, 2024):

For anyone ending up here my steps for fixing my problem:

  1. Synology DSM - Container Manager -> stop project and clean
  2. SSH into my NAS
# go to immich-app folder
$ cd /volume/docker/immich-app

# run docker-compose to start immich
/volume/docker/immich-app $ docker-compose up -d

# get into the postrgres container
/volume/docker/immich-app $ docker exec -it immich_postgres bash

In the postgres container:

# connect to database "immich" with the username "postgres"
root@123456abcdefg:/# psql -U postgres -d immich

# change the password of the user "postgres" to the password supplied in the ".env" file
immich=# ALTER USER postgres WITH PASSWORD 'your .env file password';

After this everything started to work fine. This seems to be persistent after 'docker-compose down' and 'docker-compose up -d' everything seems to be working just fine.

Just wanted to let you know this fixed the issue I was having. Proxmox host with Ubuntu VM + Docker Compose. Deleting the volumes didn't work as posted higher above, but this did the trick. Thank you!

@Mas8764 commented on GitHub (Dec 4, 2024): > For anyone ending up here my steps for fixing my problem: > > 1. Synology DSM - Container Manager -> stop project and clean > 2. SSH into my NAS > > ``` > # go to immich-app folder > $ cd /volume/docker/immich-app > > # run docker-compose to start immich > /volume/docker/immich-app $ docker-compose up -d > > # get into the postrgres container > /volume/docker/immich-app $ docker exec -it immich_postgres bash > ``` > > In the postgres container: > > ``` > # connect to database "immich" with the username "postgres" > root@123456abcdefg:/# psql -U postgres -d immich > > # change the password of the user "postgres" to the password supplied in the ".env" file > immich=# ALTER USER postgres WITH PASSWORD 'your .env file password'; > ``` > > After this everything started to work fine. This seems to be persistent after 'docker-compose down' and 'docker-compose up -d' everything seems to be working just fine. Just wanted to let you know this fixed the issue I was having. Proxmox host with Ubuntu VM + Docker Compose. Deleting the volumes didn't work as posted higher above, but this did the trick. Thank you!
Author
Owner

@thorod commented on GitHub (Jan 23, 2025):

Had the same problem after upgrading immich. Platform is Unraid.

Just open your "PostgreSQL_Immich" console and change the corresponding password within immich config "DB_PASSWORD".

I.E.
#psql -U postgres -d immich
...
immich=# \password

@thorod commented on GitHub (Jan 23, 2025): Had the same problem after upgrading immich. Platform is Unraid. Just open your "PostgreSQL_Immich" console and change the corresponding password within immich config "DB_PASSWORD". > I.E. #psql -U postgres -d immich ... immich=# \password
Author
Owner

@thomaswwp commented on GitHub (Jan 28, 2025):

I cannot get it to work. I used the yaml and env from https://immich.app/docs/install/docker-compose and apart from the paths and the password. It didn't work despite trying the above. This is on Open Media Vault through their docker plugin. You have to delete the env_file: .env lines becuase in the omv interface you select your own env file. This may be the problem of course, though the folder locations work perfectly.

I then nuked everything - used omv to delete the docker setup, deleted the local postgres and library folders then

docker system prune -a -f --volumes which I think cleans everything up - including all the downloaded images, sad times.

Then tried again from scratch because and got the same password error.

Then I started again from scratch with the default password and it came up fine. I am only testing at the moment so not super bothered about the password being default but it is not a long term solution. I will look at the docs.

@thomaswwp commented on GitHub (Jan 28, 2025): I cannot get it to work. I used the yaml and env from https://immich.app/docs/install/docker-compose and apart from the paths and the password. It didn't work despite trying the above. This is on Open Media Vault through their docker plugin. You have to delete the env_file: .env lines becuase in the omv interface you select your own env file. This may be the problem of course, though the folder locations work perfectly. I then nuked everything - used omv to delete the docker setup, deleted the local postgres and library folders then `docker system prune -a -f --volumes` which I think cleans everything up - including all the downloaded images, sad times. Then tried again from scratch because and got the same password error. Then I started again from scratch with the default password and it came up fine. I am only testing at the moment so not super bothered about the password being default but it is not a long term solution. I will look at the docs.
Author
Owner

@alextran1502 commented on GitHub (Jan 28, 2025):

@thomaswwp If you change the password before the first start up, it will use that password. If you've already started the database and decide to change the password, you will need to change it from the .env file and manually from the database

@alextran1502 commented on GitHub (Jan 28, 2025): @thomaswwp If you change the password before the first start up, it will use that password. If you've already started the database and decide to change the password, you will need to change it from the .env file and manually from the database
Author
Owner

@thomaswwp commented on GitHub (Jan 28, 2025):

@thomaswwp If you change the password before the first start up, it will use that password. If you've already started the database and decide to change the password, you will need to change it from the .env file and manually from the database

Thanks @alextran1502 - I think I already tried that but will have another go after I have finished playing with it.

@thomaswwp commented on GitHub (Jan 28, 2025): > [@thomaswwp](https://github.com/thomaswwp) If you change the password before the first start up, it will use that password. If you've already started the database and decide to change the password, you will need to change it from the .env file and manually from the database Thanks @alextran1502 - I think I already tried that but will have another go after I have finished playing with it.
Author
Owner

@Appraxis commented on GitHub (Jan 31, 2025):

For anyone ending up here my steps for fixing my problem:

1. Synology DSM - Container Manager -> stop project and clean

2. SSH into my NAS
# go to immich-app folder
$ cd /volume/docker/immich-app

# run docker-compose to start immich
/volume/docker/immich-app $ docker-compose up -d

# get into the postrgres container
/volume/docker/immich-app $ docker exec -it immich_postgres bash

In the postgres container:

# connect to database "immich" with the username "postgres"
root@123456abcdefg:/# psql -U postgres -d immich

# change the password of the user "postgres" to the password supplied in the ".env" file
immich=# ALTER USER postgres WITH PASSWORD 'your .env file password';

After this everything started to work fine. This seems to be persistent after 'docker-compose down' and 'docker-compose up -d' everything seems to be working just fine.

Bro this saved me after sooo many hours of frustration. Big Kudos

@Appraxis commented on GitHub (Jan 31, 2025): > For anyone ending up here my steps for fixing my problem: > > 1. Synology DSM - Container Manager -> stop project and clean > > 2. SSH into my NAS > > > ``` > # go to immich-app folder > $ cd /volume/docker/immich-app > > # run docker-compose to start immich > /volume/docker/immich-app $ docker-compose up -d > > # get into the postrgres container > /volume/docker/immich-app $ docker exec -it immich_postgres bash > ``` > > In the postgres container: > > ``` > # connect to database "immich" with the username "postgres" > root@123456abcdefg:/# psql -U postgres -d immich > > # change the password of the user "postgres" to the password supplied in the ".env" file > immich=# ALTER USER postgres WITH PASSWORD 'your .env file password'; > ``` > > After this everything started to work fine. This seems to be persistent after 'docker-compose down' and 'docker-compose up -d' everything seems to be working just fine. Bro this saved me after sooo many hours of frustration. Big Kudos
Author
Owner

@SlowlyBobs commented on GitHub (Jun 3, 2025):

I discovered the following peculiarity. If you are installing a container in an OMV system, note that by default the env information from immich.env is pulled from global.env for some reason. So changing the password doesn't work through the configuration file - immich doesn't see it.
If you encounter this problem, you need to hard-code the path to the .env file you created. In my case in the config file it is:

...
    env_file:
      - /srv/dev-disk-by-uuid-461b335b-9037-4c17-b0b8-c491cf2e4b54/docker/compose/immich/immich.env
...
@SlowlyBobs commented on GitHub (Jun 3, 2025): I discovered the following peculiarity. If you are installing a container in an OMV system, note that by default the env information from immich.env is pulled from global.env for some reason. So changing the password doesn't work through the configuration file - immich doesn't see it. If you encounter this problem, you need to hard-code the path to the .env file you created. In my case in the config file it is: ``` ... env_file: - /srv/dev-disk-by-uuid-461b335b-9037-4c17-b0b8-c491cf2e4b54/docker/compose/immich/immich.env ... ```
Author
Owner

@ztong commented on GitHub (Aug 4, 2025):

I discovered the following peculiarity. If you are installing a container in an OMV system, note that by default the env information from immich.env is pulled from global.env for some reason. So changing the password doesn't work through the configuration file - immich doesn't see it. If you encounter this problem, you need to hard-code the path to the .env file you created. In my case in the config file it is:

...
    env_file:
      - /srv/dev-disk-by-uuid-461b335b-9037-4c17-b0b8-c491cf2e4b54/docker/compose/immich/immich.env
...

Huge thanks, this solved my case. I'm noob to both OMV and docker so write down what happened for me in case anynoe has similar issue.helpful for anyone.

Used OMV compose plugin to create immich. First copied immich compose yml file content into OMV Compose File box, and env content into Enviroment field (ticking Show enviroment files), with my env path adaption.

Had first error about .env file not found before going up. Default env-file path in immich compose yaml is .env, and I thought I had env file set by OMV compose plugin so I commented out those two line. This may lead to the hidden problem.

Also used special chars for password in env file on the first time creating. So got the password auth failed error when first time start immich up. Then searched causes and tried two things which didn't solve the whole problem but surely part of it.
1. Stop immich, delete database folder, delete container, changed password, creat immich again. Actually I made a new appdata folder to make a clean restart. Weirdly that didn't work.
2. Changed password in database"immich" for user "postgres", using above posted steps.

Finally I set back the env_file path to immich.env, which already existed in folder(created by compose plugin I suppose), in the compose file field/yaml. And that did the trick.

I could see password was chaged in the new created immich.env same as enviroment field, and other info in env like UPLOAD_LOCATION were correctly recoganized before setting env path in yaml. Just don't understand why password need a hard-code path.

@ztong commented on GitHub (Aug 4, 2025): > I discovered the following peculiarity. If you are installing a container in an OMV system, note that by default the env information from immich.env is pulled from global.env for some reason. So changing the password doesn't work through the configuration file - immich doesn't see it. If you encounter this problem, you need to hard-code the path to the .env file you created. In my case in the config file it is: > > ``` > ... > env_file: > - /srv/dev-disk-by-uuid-461b335b-9037-4c17-b0b8-c491cf2e4b54/docker/compose/immich/immich.env > ... > ``` Huge thanks, this solved my case. I'm noob to both OMV and docker so write down what happened for me in case anynoe has similar issue.helpful for anyone. Used OMV compose plugin to create immich. First copied immich compose yml file content into OMV Compose File box, and env content into Enviroment field (ticking Show enviroment files), with my env path adaption. Had first error about .env file not found before going up. Default env-file path in immich compose yaml is .env, and I thought I had env file set by OMV compose plugin so I commented out those two line. This may lead to the hidden problem. Also used special chars for password in env file on the first time creating. So got the password auth failed error when first time start immich up. Then searched causes and tried two things which didn't solve the whole problem but surely part of it. 1. Stop immich, delete database folder, delete container, changed password, creat immich again. Actually I made a new appdata folder to make a clean restart. Weirdly that didn't work. 2. Changed password in database"immich" for user "postgres", using above posted steps. Finally I set back the env_file path to immich.env, which already existed in folder(created by compose plugin I suppose), in the compose file field/yaml. And that did the trick. I could see password was chaged in the new created immich.env same as enviroment field, and other info in env like UPLOAD_LOCATION were correctly recoganized before setting env path in yaml. Just don't understand why password need a hard-code path.
Author
Owner

@fireheadman commented on GitHub (Dec 31, 2025):

For anyone ending up here my steps for fixing my problem:

1. Synology DSM - Container Manager -> stop project and clean

2. SSH into my NAS
# go to immich-app folder
$ cd /volume/docker/immich-app

# run docker-compose to start immich
/volume/docker/immich-app $ docker-compose up -d

# get into the postrgres container
/volume/docker/immich-app $ docker exec -it immich_postgres bash

In the postgres container:

# connect to database "immich" with the username "postgres"
root@123456abcdefg:/# psql -U postgres -d immich

# change the password of the user "postgres" to the password supplied in the ".env" file
immich=# ALTER USER postgres WITH PASSWORD 'your .env file password';

After this everything started to work fine. This seems to be persistent after 'docker-compose down' and 'docker-compose up -d' everything seems to be working just fine.

Bro this saved me after sooo many hours of frustration. Big Kudos

even though closed, having same issue.
Unable to get past this.

verified I can login to psql with correct password too!

root@bb4487b5fc1c:/# psql -U postgres -W
Password:
psql (14.19 (Debian 14.19-1.pgdg12+1))
Type "help" for help.
@fireheadman commented on GitHub (Dec 31, 2025): > > For anyone ending up here my steps for fixing my problem: > > ``` > > 1. Synology DSM - Container Manager -> stop project and clean > > > > 2. SSH into my NAS > > ``` > > > > > > > > > > > > > > > > > > > > > > > > ``` > > # go to immich-app folder > > $ cd /volume/docker/immich-app > > > > # run docker-compose to start immich > > /volume/docker/immich-app $ docker-compose up -d > > > > # get into the postrgres container > > /volume/docker/immich-app $ docker exec -it immich_postgres bash > > ``` > > > > > > > > > > > > > > > > > > > > > > > > In the postgres container: > > ``` > > # connect to database "immich" with the username "postgres" > > root@123456abcdefg:/# psql -U postgres -d immich > > > > # change the password of the user "postgres" to the password supplied in the ".env" file > > immich=# ALTER USER postgres WITH PASSWORD 'your .env file password'; > > ``` > > > > > > > > > > > > > > > > > > > > > > > > After this everything started to work fine. This seems to be persistent after 'docker-compose down' and 'docker-compose up -d' everything seems to be working just fine. > > Bro this saved me after sooo many hours of frustration. Big Kudos even though closed, having same issue. Unable to get past this. verified I can login to psql with correct password too! ``` root@bb4487b5fc1c:/# psql -U postgres -W Password: psql (14.19 (Debian 14.19-1.pgdg12+1)) Type "help" for help. ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#503