Bug report #17951

QGIS Server lost (most of the times) the ability to cascade WFS layers

Added by Giovanni Manghi about 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:QGIS Server
Affected QGIS version:2.18.16 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25847

Description

This is a regression in 2.18 as the scenario I'm about to describe works flawlessly in QGIS Server 2.14.

Let's use only QGIS Server here, but the source of our external WFS layers could be any WFS service.

1) Create a QGIS project
2) Add a WFS layer from a whatever service
3) Configure the OWS properties of the project in order to allow it be used to publish OGC services. Be sure to enable the WFS capabilities for the just added external WFS layer
4) Save the project
5) Put the project somewhere (server or local machine) where it can be published with QGIS Server
6) In a clean QGIS project create a WMS or WFS connection pointing to the service created with the project saved previously
7) Try add as WMS or WFS the layer that originally we added from an external WFS service

If used QGIS Server is 2.14 it works ok 100% of time, if is 2.18 then most of the times the retrieval of images (WMS) or features (WFS) fail. Scrolling/zooming/panning makes sometimes the images/features show, but most of the times it does not work.

bug_17951.qgs (26.4 KB) Alessandro Pasotti, 2018-03-16 05:23 PM


Related issues

Duplicates QGIS Application - Bug report #16462: QGIS Server lost the ability to cascade WMS layers publis... Closed 2017-04-23

History

#1 Updated by Alessandro Pasotti about 6 years ago

This does not affect master, correct?

#2 Updated by Nicolai Mogensen about 6 years ago

I am experiencing the same issue on QGIS server Version: 1:2.18.14+24xenial (2.18.14). WFS layers will toggle on and off randomly. Our services are external WFS services. The behavior is exactly as described by Giovanni. Sometimes panning and zooming will make some layers appear, but most of the time no layers are drawn.

#3 Updated by Giovanni Manghi about 6 years ago

  • Status changed from Open to Feedback

To check if this applies also to qgis server 3-

#4 Updated by Alessandro Pasotti about 6 years ago

Can you please attach a sample project?

#5 Updated by Alessandro Pasotti about 6 years ago

  • Assignee set to Alessandro Pasotti

I cannot reproduce:

I've built a simple project with one WMS and one WFS https cascaded layers from the official geoserver demo.
Serving that project with QGIS Server 2.18 shows no issues.

Attaching the project.

#6 Updated by Alessandro Pasotti about 6 years ago

#7 Updated by Alessandro Pasotti about 6 years ago

  • Duplicates Bug report #16462: QGIS Server lost the ability to cascade WMS layers published using HTTPS added

#8 Updated by René-Luc ReLuc almost 6 years ago

If this issue duplicates #16462

The solution is the same.

To fix this issue, you have to add HOME environmental variable to a directory in which the directory .qgis2 is writable for the user used by QGIS Server, with Apache2, it's www-data.

For exemple, do these commands:

mkdir /srv/qgis/.qgis2
chown www-data:www-data /srv/qgis/.qgis2
chmod 774 /srv/qgis/.qgis2

And add this in your apache virtual host:

FcgidInitialEnv HOME "/srv/qgis" 

#9 Updated by Giovanni Manghi almost 6 years ago

René-Luc ReLuc wrote:

If this issue duplicates #16462

The solution is the same.

To fix this issue, you have to add HOME environmental variable to a directory in which the directory .qgis2 is writable for the user used by QGIS Server, with Apache2, it's www-data.

For exemple, do these commands:
[...]

And add this in your apache virtual host:
[...]

is this a workaround awaiting for the proper fix, or is really the right solution?

#10 Updated by René-Luc ReLuc almost 6 years ago

It's not a workaround, it's the solution.

#11 Updated by Alessandro Pasotti almost 6 years ago

@Renè: any reason to not close this?

#12 Updated by Giovanni Manghi almost 6 years ago

René-Luc ReLuc wrote:

It's not a workaround, it's the solution.

I'll document it then.

#13 Updated by Giovanni Manghi almost 6 years ago

René-Luc ReLuc wrote:

It's not a workaround, it's the solution.

one additional question: why is this necessary now, while is wasn't in older QGIS Server releases?

#14 Updated by Giovanni Manghi almost 6 years ago

René-Luc ReLuc wrote:

It's not a workaround, it's the solution.

gave it a try and seems to work as you described, thanks!

#15 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed/implemented

Also available in: Atom PDF