minus34 / gnaf-loader

A quick way to get started with Geoscape's open GNAF & Admin Boundaries
Apache License 2.0
185 stars 66 forks source link

Docker Image: User `postgres' has no password assigned #76

Closed ilfrich closed 1 year ago

ilfrich commented 1 year ago

Hi again, trying out the Nov22 docker image, I ran into another issue.

TLDR; after running the database and trying to connect (from outside the container), I got:

2023-03-20 01:45:44.820 UTC [81] postgres@postgres FATAL:  password authentication failed for user "postgres"
2023-03-20 01:45:44.820 UTC [81] postgres@postgres DETAIL:  User "postgres" has no password assigned.
Connection matched pg_hba.conf line 105: "host all  all    0.0.0.0/0  md5"

Steps

Potential Issue

It's weird, because setting the password is in the Dockerfile. My best guess would be that maybe the pg_restore command overwrites the previously set password and sets it back to nothing, if your dump contained no password for the postgres user.

minus34 commented 1 year ago

This is unexplained. Yes, it should be set during container build. Also, pg_restore doesn't override the database password.

Please check this using the 202302 container i just re-released as linux/amd64. I've tested with pgAdmin 4 and it connects as expected.

ilfrich commented 1 year ago

Just downloaded the latest minus34/gnafloader:latest-gda2020 and it worked straight out of the box :+1: Must have been an issue with the Nov22 image :man_shrugging: