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 exec qgis /bin/bash fails on No container found #98

Closed SPlanzer closed 4 years ago

SPlanzer commented 4 years ago

after running make docker-up in project root dir

'docker-compose exec qgis /bin/bash' fails with the below

$ docker-compose exec qgis /bin/bash
ERROR: No container found for qgis_1

docker-compose exec db su postgres -c psql however works

$ docker-compose exec db su postgres -c psql
psql (8.4.22)
Type "help" for help.

postgres=# 

`docker-compose ps' returns the below

$ docker-compose ps
      Name                    Command               State             Ports          
------------------------------------------------------------------------------------
gazetteer_db_1     /bin/sh -c su - postgres - ...   Up       0.0.0.0:32773->5432/tcp 
gazetteer_qgis_1   /scripts/docker-entry.sh         Exit 1  

Note, gazetteer_qgis_1 is in a non zero exit state.

tests in the CI environment confirms this (https://github.com/linz/gazetteer/runs/590981252?check_suite_focus=true)


list docker-compose containers
2s
gazetteer_qgis_1   /scripts/docker-entry.sh         Exit 1                          
Run docker-compose ps
      Name                    Command               State             Ports         
------------------------------------------------------------------------------------
gazetteer_db_1     /bin/sh -c su - postgres - ...   Up       0.0.0.0:32768->5432/tcp
gazetteer_qgis_1   /scripts/docker-entry.sh         Exit 1                          
list containers
0s
27111b77694a        linz-gazetteer-db:8.4   "/bin/sh -c 'su - po…"   3 seconds ago       Up 2 seconds        0.0.0.0:32768->5432/tcp   gazetteer_db_1
Run docker container  ls
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                     NAMES
27111b77694a        linz-gazetteer-db:8.4   "/bin/sh -c 'su - po…"   3 seconds ago       Up 2 seconds        0.0.0.0:32768->5432/tcp   gazetteer_db_1
SPlanzer commented 4 years ago

@strk I am failing to run docker-compose exec commands against the qgis container after docker-compose up -d

What am I missing?

SPlanzer commented 4 years ago

Ah, I see. this is coming from .docker/qgis/scripts/docker-entry.sh and in particular https://github.com/linz/gazetteer/blob/74507d8d71f4ebb399a4d70b0af10a6b9f921398/.docker/qgis/scripts/docker-entry.sh#L4

Im guessing this is related to the import config error I will look into this tomorrow.

SPlanzer commented 4 years ago

okay, I see this is comming from and in particualt # Enable the NZGBplugin in qgis /scripts/enable_nzgbplugin || exit 1

strk commented 4 years ago

Confirmed, that's the issue. I was thinking I could modify the docker-up rule to end with printing the last few lines of the started containers logs, and maybe error out if they are not running... guess it'd make sense (feel free to file an issue if you want me to work on that)