Bug report #13088
qgis-server mixing layer db-connections
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Linux / Ubuntu / Debian||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||21155|
2 PostGIS databases
2 project files, one for each database
When using the qgis-web-client and qgis-server to display the projects, the qgis-server mixes the database-connections and displays data from the other project. This happens randomly, but is reproducible after a few tries.
It only happens when the 2 projects are accessed simultaneously (e.g. using 2 browsers, and switching between them).
I compiled qgis-server from source (2015-06-08), and added some debug statements. Somehow after the QgsPostgresProvider for the layer is created (Line: "p3: Table name is.."), some calls to featureSource return the right datasource-uri, and some use another.
That's how far I got.
This happens on my Ubuntu 14.04 /64bit and Debian Jessie 64bit, using Apache2
I would be happy to supply some more information.
#1 Updated by Tom Palan about 5 years ago
- File disable_layer_caching.patch added
Update: The problem only occures if the 2 projects have layers with the same name. Apparently somewhere in QgsWMSProjectParser::mapLayerFromStyle (when called with useCache=true) mixes layers from different projects.
I was able to "fix" it by disabling caching of layers, see patch. As this is only a temporary fix, could somebody with more knowledge of QGIS chime in?