Postgres docker in droplet resets user password on its own

Posted May 4, 2020 989 views

I’m running 2 web apps and postgres in docker containers inside a digitalocean droplet and every once in a little while postgres docker resets user password but data remains. This makes application fails calling postgres db. I’d have to access ssh and run ALTER USER username WITH PASSWORD ‘newpassword’; to fix it every time them it’d run fine for a day or two sometimes more.

Here is the log before the error occurs:

Has anyone seen any similar problems or any idea what’s going on?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hi there @engineersdope,

This is quite interesting, I manage an environment with a few PostgreSQL instances all running in separate Docker containers and I’ve not hit this problem.

Do you use Docker Compose to deploy your containers or any other automated way?

Also, do you see anything strange in the logs of your PostgreSQL containers?


Oh god, this is exactly what’s happening to me too!
I was using a “postgres” and “password” user just for testing though and I thought I received some automated attack that changed multiple times the user pwd.