Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 of 4 tasks
rgirv3 opened this issue Dec 20, 2022 · 11 comments
Closed
3 of 4 tasks

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

rgirv3 opened this issue Dec 20, 2022 · 11 comments
Labels
bug Something isn't working needs triage Bug that needs triage from maintainer

Comments

@rgirv3
Copy link

rgirv3 commented 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

@rgirv3 rgirv3 added bug Something isn't working needs triage Bug that needs triage from maintainer labels Dec 20, 2022
@rgirv3 rgirv3 changed the title [BUG] <title> [BUG] Password authentication failed for user "postgres" Dec 20, 2022
@jrasm91
Copy link
Contributor

jrasm91 commented Dec 20, 2022

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

@rgirv3
Copy link
Author

rgirv3 commented 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.

@jrasm91
Copy link
Contributor

jrasm91 commented Dec 20, 2022

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

@alextran1502
Copy link
Contributor

Try to remove the postgres container and restart the stack.

@rgirv3
Copy link
Author

rgirv3 commented 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

@alextran1502
Copy link
Contributor

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
Copy link
Contributor

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

@jrasm91
Copy link
Contributor

jrasm91 commented 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.

@rgirv3
Copy link
Author

rgirv3 commented 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 rgirv3 closed this as completed Dec 21, 2022
@Normanras
Copy link

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.

@chewenkai
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Bug that needs triage from maintainer
Projects
None yet
Development

No branches or pull requests

5 participants