Postgres not recognizing the user
See original GitHub issueWhat happened?
On the production environment the postgre container can’t connect to the DB saying that the user that is configured in the .env file can’t connect to the DB
Some log:
postgres_1 | 2018-06-07 19:11:22.906 UTC [80] FATAL: password authentication failed for user "drdown"
postgres_1 | 2018-06-07 19:11:22.906 UTC [80] DETAIL: Password does not match for user "drdown".
postgres_1 | Connection matched pg_hba.conf line 95: "host all all all md5"
postgres_1 | 2018-06-07 19:11:23.963 UTC [81] FATAL: password authentication failed for user "drdown"
postgres_1 | 2018-06-07 19:11:23.963 UTC [81] DETAIL: Password does not match for user "drdown".
postgres_1 | Connection matched pg_hba.conf line 95: "host all all all md5"
What should’ve happened instead?
Connect to the DB and run the application
Steps to reproduce
Don’t know to reproduce and don’t which files can help figure this out (new on this)
Host system configuration:
uname -a
Linux ubuntu-drdown 4.4.0-127-generic #153-Ubuntu SMP Sat May 19 10:58:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
docker --version
Docker version 18.03.1-ce, build 9ee9f40
docker-compose --version
docker-compose version 1.21.0, build 5920eb0
p.s.: apologizes for my english, I’m actually Brazilian.
Issue Analytics
- State:
- Created 5 years ago
- Comments:24 (8 by maintainers)
Top Results From Across the Web
Postgres user does not exist? - Stack Overflow
I use Postgres.app for my OS X postgres database. ... psql -U postgres psql: FATAL: role "postgres" does not exist masi$ psql postgres...
Read more >15: 21.15. Authentication Problems - PostgreSQL
Authentication failures and related problems generally manifest themselves through error messages like the following: FATAL: no pg_hba.conf entry for host ...
Read more >Why can't user login on Postgres - Server Fault
I have, of-course, tried resetting the password - multiple times, to no avail. I have tried changing from md5 to password which did...
Read more >postgresql Cannot login with created users
However, I have thus far been unable to create a new user to log in with. I tried the command. CREATE USER myUser...
Read more >Postgres not recognizing the user · Issue #1678 - GitHub
The .env postgres file is populated with the random password; You run the docker-compose and the containers are created. The postgres container ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@demestav That’s my issue, but killing all docker containers and deleting all images didn’t fix it.
Edit: Had to delete the docker volumes
docker volume ls
to find them thendocker volume rm {{project_name}}_local_postgres_data
anddocker volume rm {{project_name}}_local_postgres_data_backups
I think a lot of people (my past self included) are hitting this issue because of a gotcha of how Docker works and cache resources. It’s not obvious that if you re-generate the same project from scratch with the same name, Docker will re-use pre-existing resources, it took me some deeper understanding of Docker to get that.
Because of the nature of this project, I think it’s expected to be used by people with little experience with Docker. We could add some documentation or link to external docs regarding how Docker caching may have cross-projects side effects. It’s pretty common for people to generate the same project multiple times when they realise they messed up something and want to start over…
What do folks think of a disclaimer at the top of the Docker documentation?
PS: if you want to clear your ENTIRE Docker cache/volumes/networks, you can do so with
docker system prune -a --volumes --force
. Be careful, that drops EVERYTHING. Don’t do it on Prod!