linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

docker compose failing on `install_web.sh drop` #93

Closed SPlanzer closed 4 years ago

SPlanzer commented 4 years ago

This is only affecting docker compose. database and qgis containers build as expected when build independently from their retrospective makes files.

See error below

Step 11/15 : RUN pgindenedtlu_ctlcluster 8.4 main start &&     su postgres -c 'cd /sql; ./install_web.sh drop'
 ---> Running in 13bbe7c2c387
Removed stale pid file.
Warning: connection to the database failed, disabling startup checks:
psql: FATAL:  the database system is starting up

host: local
database: gazetteer
Using psql  -d gazetteer -h /var/run/postgresql --set ON_ERROR_STOP=1
psql: FATAL:  the database system is starting up
Error querying for existing web config
ERROR: Service 'db' failed to build: The command '/bin/sh -c pg_ctlcluster 8.4 main start &&     su postgres -c 'cd /sql; ./install_web.sh drop'' returned a non-zero code: 1
Makefile:13: recipe for target 'docker-up' failed
make: *** [docker-up] Error 1
SPlanzer commented 4 years ago

this is failing on psql: FATAL: the database system is starting up

I also note I ran into issues with the docker-compose version we are using for ci. see - https://github.com/docker/compose/pull/3433

SPlanzer commented 4 years ago

@strk I opened a pull request (#96) with a pause in the install_web that allowed me to progress docker-compose past this error (psql: FATAL: the database system is starting up)

palmerj commented 4 years ago

Hi @SPlanzer rather than adding a sleep to your web script you can take this type of approach within your docker compose file: https://github.com/palmerj/vector-tile-parcel-poc/blob/master/docker-compose.yml#L35 using a simple is database ready script https://github.com/palmerj/vector-tile-parcel-poc/blob/master/wait-for-postgres.sh. Also note the health check I added.

SPlanzer commented 4 years ago

Closing for now. CI has been passing without issue for a while now