QWC2 Docker – Can SQL Server, Geopackage, and Shapefile Data be Served?

qgisqgis-serverqgis-web-clientqwc2

Whenever my projects have local shapefile data, Geopackage or SQL Server data I get an error in creating the configuration and/or the files are not recognized in the Add Resources section of the admin interface.

I am only able to include WFS/WMS/WMTS data in the qgs file for it to work.

Where should local data be to work in Qgis Web Client?

WFS/WMS data in the qgs work fine.


INFO: Config destination: '/srv/qwc_service/config-out/default'
INFO: Searching for projects files in /srv/qwc_service/config-in/default/qgis_projects
INFO: Searching for projects files in /data/scan
INFO: Scanning for thumbnail(QWC_Demo.png) under /qwc2/assets/img/mapthumbs
INFO: Thumbnail: QWC_Demo.png could not be found under /qwc2/assets/img/mapthumbs/QWC_Demo.png
INFO: Adding project /data/scan/QWC_Demo.qgs
INFO: Downloading GetProjectSettings from http://qwc-qgis-server/ows/qwc_demo
CRITICAL: Could not get GetProjectSettings from http://qwc-qgis-server/ows/qwc_demo:
b'Layer(s) not valid\n'
INFO: Downloading GetProjectSettings from http://qwc-qgis-server/ows/scan/QWC_Demo
INFO: Writing 'ogcConfig.json' service config file
WARNING: Skipping theme item 'Demo': Could not get capabilities for /ows/qwc_demo
INFO: Using WMS GetMap to generate thumbnail for scan/QWC_Demo
INFO: Copying 'index.html' to tenant dir
INFO: Skipping JSON schema check for MapViewer
INFO: Writing 'mapViewerConfig.json' service config file
INFO: Writing 'featureInfoConfig.json' service config file
INFO: Writing 'printConfig.json' service config file
INFO: Writing 'searchConfig.json' service config file
INFO: Writing 'adminGuiConfig.json' service config file
INFO: Writing 'dbAuthConfig.json' service config file
INFO: Writing 'elevationConfig.json' service config file
INFO: Writing 'mapinfoConfig.json' service config file
INFO: Writing 'permalinkConfig.json' service config file
INFO: Reading 'scan/QWC_Demo.qgs'
INFO: Writing 'dataConfig.json' service config file
INFO: Writing 'legendConfig.json' service config file
CRITICAL: The generation of the configuration files resulted in a failure
CRITICAL: The configuration files were not updated!
INFO: Collecting 'ogc' service permissions
INFO: Collecting 'mapViewer' service permissions
INFO: Collecting 'featureInfo' service permissions
INFO: Collecting 'print' service permissions
INFO: Collecting 'search' service permissions
INFO: Collecting 'adminGui' service permissions
INFO: Collecting 'dbAuth' service permissions
INFO: Collecting 'elevation' service permissions
INFO: Collecting 'mapinfo' service permissions
INFO: Collecting 'permalink' service permissions
INFO: Collecting 'data' service permissions
INFO: Collecting 'legend' service permissions
INFO: Writing 'permissions.json' permissions file
CRITICAL: The generation of the permission files resulted in a failure.
CRITICAL: The permission files were not updated!

I have been following https://github.com/qwc-services/qwc-docker#adding-qgis-projects on Ubuntu 20.4

Best Answer

To run QWC Services on Docker with MS SQL support, an ODBC version of qwc-qgis-server image must be used in docker composer (version 3.22-odbc or greater)

Required changes in docker-composer.yml to run QWC Services with ODBC support:

  ...
  qwc-qgis-server:
    image: sourcepole/qwc-qgis-server:3.22-odbc
    ports:
      - "127.0.0.1:8001:80"
    volumes:
      - ./volumes/qgs-resources:/data:ro
      - ./pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
      - ./odbc.ini:/etc/odbc.ini
  ...
  1. Copy or link odbc.ini with MS SQL datasources to same directory of your docker-composer.yml
Related Question