Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Password authentication failed for user when using new docker-compose

I am using django-cookiecutter template and for the second time for new project. And it fails to connect to postgres with following error:

postgres_1  | 2018-04-30 14:54:09.747 UTC [1] LOG:  database system is ready to accept connections
postgres_1  | 2018-04-30 14:54:10.029 UTC [28] FATAL:  password authentication failed for user "IViLGLIEWLBDGBnsAuoOEhtFaKrqKxfX"
postgres_1  | 2018-04-30 14:54:10.029 UTC [28] DETAIL:  Role "IViLGLIEWLBDGBnsAuoOEhtFaKrqKxfX" does not exist.
postgres_1  |   Connection matched pg_hba.conf line 95: "host all all all md5"
django_1    | PostgreSQL is unavailable (sleeping)...

One of the maintainers explained this:

the thing is, every time you bootstrap the project POSTGRES_USER and POSTGRES_PASSWORD get reset to a newly-generated random values

I tried to remove all docker containers but no success any idea how am i able to solve this? I dont have the old credentials to replace them.

like image 582
HyperX Avatar asked Nov 30 '25 15:11

HyperX


1 Answers

With the help of https://github.com/webyneter (contributor to django-cookiecutter)

The solution is following:

  • To see existing volumes: docker volume ls
  • To remove the respective volumes docker volume rm <your project_slug>_postgres_backup_local <your project_slug>_postgres_data_local
like image 56
HyperX Avatar answered Dec 02 '25 04:12

HyperX



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!