GeoNode / geonode-docker

Django base images for GeoNode
Other
9 stars 33 forks source link

setting POSTGRES_PASSWORD as documented in the mdillon/postgis image will result in wait-for-database.sh loop #19

Closed gannebamm closed 10 months ago

gannebamm commented 5 years ago

Since https://github.com/GeoNode/geonode-docker/blob/master/wait-for-databases.sh#L8-L11 does not use a password the connection will get refused and the container will not spin up correctly but looping inside this status.

As https://github.com/appropriate/docker-postgis states you could use -e POSTGRES_PASSWORD=mysecretpassword to set a password for the superuser.

how to reproduce

host ip: 172.29.179.108 postgres password: apa22

docker-compose.override.localhost.yml

version: '2.2'
services:

  django:
    build: .
    # Loading the app is defined here to allow for
    # autoreload on changes it is mounted on top of the
    # old copy that docker added when creating the image
    volumes:
      - '.:/usr/src/app'
    environment:
      - DEBUG=False
      - GEONODE_LB_HOST_IP=172.29.179.108
      - GEONODE_LB_PORT=80
      - SITEURL=http://172.29.179.108/
      - ALLOWED_HOSTS=['172.29.179.108', ]
      - GEOSERVER_PUBLIC_LOCATION=http://172.29.179.108/geoserver/
      - GEOSERVER_WEB_UI_LOCATION=http://172.29.179.108/geoserver/

  geoserver:
    environment:
      - GEONODE_LB_HOST_IP=172.29.179.108
      - GEONODE_LB_PORT=80

  db:
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_PASSWORD=apa22

in root folder: docker-compose -f docker-compose.yml -f docker-compose.override.localhost.yml up

errors

database is not able to establish connection, because the password is wrong. From docker-compose up log:

db4geonode       | 2019-07-17 09:11:35.882 UTC [394] FATAL:  password authentication failed for user "postgres"
db4geonode       | 2019-07-17 09:11:35.882 UTC [394] DETAIL:  Password does not match for user "postgres".
db4geonode       |      Connection matched pg_hba.conf line 95: "host all all all md5"
francbartoli commented 5 years ago

@gannebamm is this still an issue? Can you describe further the issue with an insight? Also, a log about the problem might be useful

gannebamm commented 5 years ago

@francbartoli yes, it´s still a thing. I have edited the description with further informations.