Postgres: Fatal error using default credentials

Created on 9 May 2017  路  3Comments  路  Source: docker-library/postgres

Attaching to container shows error:

FATAL: password authentication failed for user "postgres"
DETAIL: User "postgres" has no password assigned.

Only thing i remember is doing docker-compose a bunch of times on my deployment machine, same docker-compose in my dev machine and everything works fine, I already tried removing previous volumes but with no luck. Any help is appreciated thanks.

Using latest version.

Most helpful comment

For anyone having the same issue, I fixed it by creating a new volume in my docker-compose. Pretty weird bug.

All 3 comments

For anyone having the same issue, I fixed it by creating a new volume in my docker-compose. Pretty weird bug.

Thanks, just came across this same issue now...

Actions tried

  • docker volume prune
  • docker-compose down && docker-compose up --force-recreate
  • Manually removing the generated volume from the fielsystem
  • Using postgres:9.6-alpine instead of postgres:9.6.4
  • With/without POSTGRES_PASSWORD set

Finally, simply recreating the volume by renaming the bindings worked. Not sure of the root cause though... caching on some level that I didn't clear correctly?

    volumes:
      - ./docker/db/development:/var/lib/postgresql/data

->

    volumes:
      - ./docker/db/dev:/var/lib/postgresql/data

Thanks for your tip.

Same issue. Fixed using yjimk and orion's solution.

Was this page helpful?
0 / 5 - 0 ratings