What is the bug or the crash?
Using QGIS Server I get a
<ServerException>Layer(s) not valid</ServerException>
error, although the layer is ok. It only occurs once in a setup, where more than one .qgs projects use the same WMS source as layer. Requests to the projects works for the 1st project called, but not for the 2nd. Exact way to reproduce see in section below.
Steps to reproduce the issue
- create several QGIS project files containing the same WMS sources as layers. For example qgis1.qgs with layer 1
URL https://wms.geo.admin.ch/?VERSION=1.3.0
Source contextualWMSLegend=0&crs=EPSG:2056&dpiMode=7&featureCount=10&format=image/jpeg&layers=ch.swisstopo.pixelkarte-grau&styles&tilePixelRatio=0&url=https://wms.geo.admin.ch/?VERSION%3D1.3.0
and layer 2
URL https://sgx.geodatenzentrum.de/wms_topplus_open
Source contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=web_grau&styles&tilePixelRatio=0&url=https://sgx.geodatenzentrum.de/wms_topplus_open
- repeat step 1 for 2 to 4 more projects qgis2, qgis3 etc with identical content.
- serve the projects to QGIS server (data folder). I do this via docker compose like here: https://github.com/qgis/qgis-docker/blob/main/docker-compose.yml
- in docker curl "localhost/ogc/qgis1?SERVICE=WMS&REQUEST=GetCapabilities" -> works fine
- curl "localhost/ogc/qgis2?SERVICE=WMS&REQUEST=GetCapabilities" -> layer not valid
- curl "localhost/ogc/qgis3?SERVICE=WMS&REQUEST=GetCapabilities" -> works fine
I can change the order of the request with the result, that always the project I request as second will fail. But only once. So I can do:
- curl "localhost/ogc/qgis2?SERVICE=WMS&REQUEST=GetCapabilities" -> works fine
- curl "localhost/ogc/qgis1?SERVICE=WMS&REQUEST=GetCapabilities" -> layer not valid
- curl "localhost/ogc/qgis1?SERVICE=WMS&REQUEST=GetCapabilities" -> works fine
Or:
- curl "localhost/ogc/qgis3?SERVICE=WMS&REQUEST=GetCapabilities" -> works fine
- curl "localhost/ogc/qgis1?SERVICE=WMS&REQUEST=GetCapabilities" -> layer not valid
- curl "localhost/ogc/qgis2?SERVICE=WMS&REQUEST=GetCapabilities" -> works fine
- curl "localhost/ogc/qgis1?SERVICE=WMS&REQUEST=GetCapabilities" -> works fine
It can be reproduced when only one layer is in the projects. QGIS Server must be restartet, to get the invalid layer again. So there is maybe some issue with cache?
Versions
I tested with the following docker images, which all result in layer not valid error:
- 3.40
- 3.40.1
- 3.40-jammy
- 3.40-bookworm
- 3.42
- 3.44
It works fine in 3.38 and 3.34
Supported QGIS version
New profile
Additional context
No response
What is the bug or the crash?
Using QGIS Server I get a
<ServerException>Layer(s) not valid</ServerException>error, although the layer is ok. It only occurs once in a setup, where more than one .qgs projects use the same WMS source as layer. Requests to the projects works for the 1st project called, but not for the 2nd. Exact way to reproduce see in section below.
Steps to reproduce the issue
and layer 2
I can change the order of the request with the result, that always the project I request as second will fail. But only once. So I can do:
Or:
It can be reproduced when only one layer is in the projects. QGIS Server must be restartet, to get the invalid layer again. So there is maybe some issue with cache?
Versions
I tested with the following docker images, which all result in layer not valid error:
It works fine in 3.38 and 3.34
Supported QGIS version
New profile
Additional context
No response