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

'Could not connect to any X display' error when making docker-qgis-start #107

Closed billgeo closed 4 years ago

billgeo commented 4 years ago

Bug Description

docker-qgis-start has an error when trying to un on my mac, see below. Possibly I don't know enough about X server and how it works to do this on a mac where X11 isn't native anymore.

Steps to Reproduce

Cloned latest version of int_test branch

Bills-MacBook-Pro:gazetteer bmnelson$ git log -n 1
commit 32000098642bc91b3489ac686274893ac202f99d (HEAD -> int_tests, origin/int_tests)
Author: splanzer <splanzer@linz.govt.nz>
Date:   Fri May 1 14:06:46 2020 +1200

    CI adapted to github actions

Start docker in xterm (installed xquartz for Mac) terminal

bmnelson@Bills-MacBook-Pro gazetteer % docker-machine start default
bmnelson@Bills-MacBook-Pro gazetteer % docker-machine env
bmnelson@Bills-MacBook-Pro gazetteer % eval $(docker-machine env)

make target

bmnelson@Bills-MacBook-Pro gazetteer % make docker-qgis-start

Desktop

Screenshots / results

docker-compose up -d
gazetteer_db_1 is up-to-date
gazetteer_qgis_1 is up-to-date
xhost +
access control disabled, clients can connect from any host
docker-compose exec qgis sh -c 'DISPLAY=$1 qgis' sh "unix$DISPLAY"
Warning: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Warning: QXcbConnection: Could not connect to display unix:0
Critical: Could not connect to any X display.
make: *** [docker-qgis-start] Error 1
billgeo commented 4 years ago
bmnelson@Bills-MacBook-Pro gazetteer % echo $DISPLAY 
:0
palmerj commented 4 years ago

@billgeo here's the steps I used to get docker QGIS running on MacOSX: https://gist.github.com/palmerj/315053c0d940f4c63dee7655ce037ade

Couple of tips:

palmerj commented 4 years ago

So looking at https://github.com/linz/gazetteer/blob/master/Makefile#L24, either some changes to the makefile/and or docker compose file will be needed to support mac. But you could hack the file now to see if the above changes work for you now

billgeo commented 4 years ago

Thanks @palmerj. Got it working on mac now. Will test it on Ubuntu 18 and do a PR.