qwc-services / qwc-docker

Docker containers for qwc-services
MIT License
44 stars 34 forks source link

Help - changing qwc-server port #81

Open tomtommahout opened 1 month ago

tomtommahout commented 1 month ago

I'm trying to run the standard qwc-docker on a Synology NAS. I'm no docker expert - and after a couple of days of googling and tinkering - I'm stuck. I believe I'm trying to change the port that qgis-server runs on - but I'm not sure. Maybe I'm missing the obvious! Issues are just as likely to be caused by Synology Docker - I'm trying to narrow down the potential causes.

The first install failed with this message:

Error response from daemon: Bind mount failed: '/volume1/docker/qwc/volumes/db' does not exists

I manually made the /qwc/volumes/db directory, re-ran docker-compose up and progressed a bit further.

I'm now getting:

qwc-qwc-qgis-server-1              | (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
qwc-qwc-qgis-server-1              | no listening sockets available, shutting down
qwc-qwc-qgis-server-1              | AH00015: Unable to open logs

Google indicates that something is already using port 80 (and I assume this is 80 on the host, not the docker-compose network?) I've tried changing the qgis-server port in the compose file - and the server container starts fine - but then the service configurator fails with the following error messages. Its not recognising that I've changed the port - so I must be changing it in an incorrect location in the configuration.

   qwc-qgis-server:
    image: sourcepole/qwc-qgis-server:3.34
    # ports:
    #   - "127.0.0.1:8001:80"
    volumes:
      - ./volumes/qgs-resources:/data:ro
      - ./pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
    environment:
       PORT: 8080
Service configurations generated:
INFO: Config destination: '/srv/qwc_service/config-out/default'
INFO: Searching for projects files in /data/scan
INFO: Adding project /data/scan/natural-earth-countries.qgs
INFO: Searching for print layouts /layouts
INFO: Reading theme /ows/qwc_demo
CRITICAL: Could not parse WMS GetProjectSettings from http://qwc-qgis-server/ows/qwc_demo:
HTTPConnectionPool(host='qwc-qgis-server', port=80): Max retries exceeded with url: /ows/qwc_demo?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetProjectSettings&CLEARCACHE=1 (Caused by NameResolutionError(": Failed to resolve 'qwc-qgis-server' ([Errno -3] Try again)"))
INFO: Read 'qwc_demo.qgs'
INFO: Reading theme /ows/scan/natural-earth-countries
CRITICAL: Could not parse WMS GetProjectSettings from http://qwc-qgis-server/ows/scan/natural-earth-countries:
HTTPConnectionPool(host='qwc-qgis-server', port=80): Max retries exceeded with url: /ows/scan/natural-earth-countries?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetProjectSettings&CLEARCACHE=1 (Caused by NameResolutionError(": Failed to resolve 'qwc-qgis-server' ([Errno -3] Try again)"))
INFO: Read 'scan/natural-earth-countries.qgs'
INFO: Generating 'ogc' service config
INFO: Generating 'mapViewer' service config
WARNING: Skipping unused background layer mapnik
WARNING: Skipping unused background layer bluemarble
INFO: Copying 'index.html' to tenant dir
INFO: Generating 'featureInfo' service config
INFO: Generating 'print' service config
INFO: Generating 'search' service config
INFO: Generating 'adminGui' service config
INFO: Generating 'dbAuth' service config
INFO: Generating 'elevation' service config
INFO: Generating 'mapinfo' service config
INFO: Generating 'permalink' service config
INFO: Generating 'data' service config
INFO: Generating 'legend' service config
CRITICAL: A critical error occurred while processing the configuration.
CRITICAL: The configuration files were not updated!
INFO: Generating 'ogc' service permissions
INFO: Generating 'mapViewer' service permissions
INFO: Generating 'featureInfo' service permissions
INFO: Generating 'print' service permissions
INFO: Generating 'search' service permissions
INFO: Generating 'adminGui' service permissions
INFO: Generating 'dbAuth' service permissions
INFO: Generating 'elevation' service permissions
INFO: Generating 'mapinfo' service permissions
INFO: Generating 'permalink' service permissions
INFO: Generating 'data' service permissions
INFO: Generating 'legend' service permissions
CRITICAL: A critical error occurred while processing the configuration.
CRITICAL: The permission files were not updated!
tpo commented 1 month ago

Google indicates that something is already using port 80

You can use netstat -anp or ss -anp to find out what process is bound to port 80 (or whatever port is configured in your docker-compose.yml) and thus preventing docker to bind to. And then you can stop/kill that process.

You get errors from config generator because other services expect the qwc-qgis-server to be on the configured port and if it's not then they are unable to reach it...

tomtommahout commented 1 month ago

Thanks tpo - that was what i thought too. I can't use port 80, as another critical service requires it.

I've changed the port that qwc-qgis-server is running o (as above) by adding the following to qwc-qgis-server section of docker-compose.yml

    environment:
       PORT: 8080

The config generator is still looking for port 80 (not 8080). How do I change the port where 'other services' expect to find qwc-server?

Thanks for your help!

manisandro commented 1 month ago

Are you running an application which listens on port 80 within the docker network? In any event, you can adjust the default_qgis_server_url in the tenantConfig.json to point the config-generator and ogc-service to another server address.

HusseinKabbout commented 1 month ago

@tomtommahout You don't need to change any port to make qwc-docker work on a default installation. Are you using an unmodified version of docker-compose-examle.yml?

tomtommahout commented 1 month ago

I initially tried with an unmodified version of docker-compose (with the exception adding a postgres password, and setting the UID and GID). It produced the following error:

/usr/share/fonts/truetype/dejavu/DejaVuMathTeXGyre.ttf: DejaVu Math TeX Gyre:style=Regular
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSans-BoldOblique.ttf: DejaVu Sans:style=Bold Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSans-ExtraLight.ttf: DejaVu Sans,DejaVu Sans Light:style=ExtraLight
/usr/share/fonts/truetype/dejavu/DejaVuSans-Oblique.ttf: DejaVu Sans:style=Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-Bold.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-BoldOblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-Oblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-BoldOblique.ttf: DejaVu Sans Mono:style=Bold Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf: DejaVu Sans Mono:style=Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif-BoldItalic.ttf: DejaVu Serif:style=Bold Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Italic.ttf: DejaVu Serif:style=Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-Bold.ttf: DejaVu Serif,DejaVu Serif Condensed:style=Condensed Bold,Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-BoldItalic.ttf: DejaVu Serif,DejaVu Serif Condensed:style=Condensed Bold Italic,Bold Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-Italic.ttf: DejaVu Serif,DejaVu Serif Condensed:style=Condensed Italic,Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed.ttf: DejaVu Serif,DejaVu Serif Condensed:style=Condensed,Book
/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf: Liberation Mono:style=Bold
/usr/share/fonts/truetype/liberation/LiberationMono-BoldItalic.ttf: Liberation Mono:style=Bold Italic
/usr/share/fonts/truetype/liberation/LiberationMono-Italic.ttf: Liberation Mono:style=Italic
/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf: Liberation Mono:style=Regular
/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf: Liberation Sans:style=Bold
/usr/share/fonts/truetype/liberation/LiberationSans-BoldItalic.ttf: Liberation Sans:style=Bold Italic
/usr/share/fonts/truetype/liberation/LiberationSans-Italic.ttf: Liberation Sans:style=Italic
/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf: Liberation Sans:style=Regular
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Bold.ttf: Liberation Sans Narrow:style=Bold
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-BoldItalic.ttf: Liberation Sans Narrow:style=Bold Italic
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Italic.ttf: Liberation Sans Narrow:style=Italic
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Regular.ttf: Liberation Sans Narrow:style=Regular
/usr/share/fonts/truetype/liberation/LiberationSerif-Bold.ttf: Liberation Serif:style=Bold
/usr/share/fonts/truetype/liberation/LiberationSerif-BoldItalic.ttf: Liberation Serif:style=Bold Italic
/usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf: Liberation Serif:style=Italic
/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf: Liberation Serif:style=Regular
/usr/share/fonts/truetype/lyx/cmex10.ttf: cmex10:style=LyX
/usr/share/fonts/truetype/lyx/cmmi10.ttf: cmmi10:style=LyX
/usr/share/fonts/truetype/lyx/cmr10.ttf: cmr10:style=LyX
/usr/share/fonts/truetype/lyx/cmsy10.ttf: cmsy10:style=LyX
/usr/share/fonts/truetype/lyx/dsrom10.ttf: dsrom10:style=LyX
/usr/share/fonts/truetype/lyx/esint10.ttf: esint10:style=LyX
/usr/share/fonts/truetype/lyx/eufm10.ttf: eufm10:style=LyX
/usr/share/fonts/truetype/lyx/msam10.ttf: msam10:style=LyX
/usr/share/fonts/truetype/lyx/msbm10.ttf: msbm10:style=LyX
/usr/share/fonts/truetype/lyx/rsfs10.ttf: rsfs10:style=LyX
/usr/share/fonts/truetype/lyx/stmary10.ttf: stmary10:style=LyX
/usr/share/fonts/truetype/lyx/wasy10.ttf: wasy10:style=LyX
/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf: Bitstream Vera Sans:style=Roman
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBI.ttf: Bitstream Vera Sans:style=Bold Oblique
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf: Bitstream Vera Sans:style=Bold
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraIt.ttf: Bitstream Vera Sans:style=Oblique
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBI.ttf: Bitstream Vera Sans Mono:style=Bold Oblique
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBd.ttf: Bitstream Vera Sans Mono:style=Bold
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoIt.ttf: Bitstream Vera Sans Mono:style=Oblique
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMono.ttf: Bitstream Vera Sans Mono:style=Roman
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraSe.ttf: Bitstream Vera Serif:style=Roman
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraSeBd.ttf: Bitstream Vera Serif:style=Bold
/usr/share/fonts/truetype/ubuntu/Ubuntu-B.ttf: Ubuntu:style=Bold
/usr/share/fonts/truetype/ubuntu/Ubuntu-BI.ttf: Ubuntu:style=Bold Italic
/usr/share/fonts/truetype/ubuntu/Ubuntu-C.ttf: Ubuntu Condensed:style=Regular
/usr/share/fonts/truetype/ubuntu/Ubuntu-L.ttf: Ubuntu,Ubuntu Light:style=Light,Regular
/usr/share/fonts/truetype/ubuntu/Ubuntu-LI.ttf: Ubuntu,Ubuntu Light:style=Light Italic,Italic
/usr/share/fonts/truetype/ubuntu/Ubuntu-M.ttf: Ubuntu,Ubuntu Light:style=Medium,Bold
/usr/share/fonts/truetype/ubuntu/Ubuntu-MI.ttf: Ubuntu,Ubuntu Light:style=Medium Italic,Bold Italic
/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf: Ubuntu:style=Regular
/usr/share/fonts/truetype/ubuntu/Ubuntu-RI.ttf: Ubuntu:style=Italic
/usr/share/fonts/truetype/ubuntu/Ubuntu-Th.ttf: Ubuntu,Ubuntu Thin:style=Thin,Regular
/usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf: Ubuntu Mono:style=Bold
/usr/share/fonts/truetype/ubuntu/UbuntuMono-BI.ttf: Ubuntu Mono:style=Bold Italic
/usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf: Ubuntu Mono:style=Regular
/usr/share/fonts/truetype/ubuntu/UbuntuMono-RI.ttf: Ubuntu Mono:style=Italic
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

@HusseinKabbout - is that what you'd expect to see in the compose log?

The Synology system is still running docker Server Version: 20.10.23. Not able to update that