docker postgres: password authentication failed for user "postgres"
Hi, I am setting up a fresh Zitadel instance using the docker-compose guide:
https://zitadel.com/docs/self-hosting/deploy/compose#docker-compose
docker compose up works, however the database container shows the following error repeatedly:
It did actually work a few hours ago and doesn't anymore. I could login to zitadel.
Right now, I have reset everything and deleted the docker volumes and containers, so there shouldn't be any changes from myself.
5 Replies
Hi @Valle, I'm an AI assistant for ZITADEL. While a team member reviews this question, I'll see if I can find relevant sources for your question.
Answer
This appears to be a database authentication issue with the PostgreSQL container in your ZITADEL Docker Compose setup (1) . The error indicates that the PostgreSQL container is rejecting connections due to password authentication failure.
Based on the ZITADEL Docker Compose documentation, the database configuration should include these environment variables :
The PostgreSQL container in the official configuration uses :
A similar issue was discussed where PostgreSQL logs showed authentication errors, and it was resolved by ensuring the
PGUSER
environment variable was properly set in the database container (2) .
Since you mentioned this worked before and you've reset everything, try these steps:
1. Ensure you're using the exact Docker Compose configuration from the documentation (1)
2. Verify that both the ZITADEL container and PostgreSQL container have matching credentials
3. Make sure Docker volumes are completely removed before restarting
If the issue persists, you can click the "Ask for help" button to tag a team member for additional assistance.
​
To learn more, see the sources I considered:
[1] Set up Zitadel with Docker Compose
[2] Postgres logs spammed with: role "root" does not exist
​
Feel free to tag @Ask Inkeep with additional questions.
Got it. Tagging @Rajat for additional help.hey @Valle welcome to the server 🙂 and thanks for your question
did you had any trouble during the login or anything apart from those postgres log messages?. If not, then you can safely ignore them as it could be a bug or wrong error messages because the error indicates that the PostgreSQL container is rejecting the login attempt due to a password mismatch for the user postgres whos password is actually postgres so unless you have not made any changes to the password(which you didnt) in docker-compose file you are fine, rest I will check with my team. Thanks
Yes you are right, it was actually a different problem, and I got so confused by the database error log.
Do you think the massive logging can become a performance issue? I'm not accustomed to docker, so I don't know how std out logs are processed.
The actual issue was that the localhost:8080 redirect to localhost:3000 (login v2) would not work and I assumed it was the db.
However, it was the fields that I had still commented out from a previous tryout with a reverse proxy.
writing logs to STDOUT/STDERR in Docker is the right pattern and usually not a performance bottleneck, yu should be fine. The bigger risks are disk I/O and disk space if its logging unnecessary, which is not the case here 🙂
🎉 Looks like you just helped out another community member! Thanks for being so helpful <@1346540274674827395>! You're now one step closer to leveling up—keep up the amazing peer support! 🚀