3

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.

1
  • What does the PostgreSQL log say if log_connections = on? Commented Jan 25, 2018 at 19:41

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.