2

I'm using Django created with the template cookie-cutter. When I try to run the project with docker locally it gives me the following error.

FATAL: password authentication failed for user "user"
DETAIL: Role "user" does not exist.

But the role "user" exists. Using the command postgres=# \du gives me the role "user"

I have a .env file with the recommended configuration by cookie cutter. POSTGRES_PASSWORD=password POSTGRES_USER=user

I tried giving the user a password and granting all privileges of the database to the user but doesn't work.

K.Dᴀᴠɪs
  • 9,945
  • 11
  • 33
  • 43
Alejandro Maguey
  • 167
  • 4
  • 12

1 Answers1

4

Usually connection problems are due to;

postgresql.conf not having the listen_addresses set correctly or the pg_hba.conf not having correct values.

It often helps to increase postgresql logging in postgresql.conf to watch what happens when connecting

log_min_duration_statement = 0 ## logs all statements

You could also try at cmd prompt; pg_isready -d dbname -U user

Slumdog
  • 470
  • 2
  • 4