Bug report #20873

QGIS Server 3.4 broken on Windows

Added by Uroš Preložnik almost 6 years ago. Updated over 5 years ago.

Status:Feedback
Priority:High
Assignee:-
Category:QGIS Server
Affected QGIS version:3.4.4 Regression?:Yes
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:28692

Description

Latest QGIS Server from OSGeo4W doesn't work. Maybe is related to Python configuration.

This are Apache environment variables used (I checked, they are valid paths):

SetEnv GDAL_DATA "C:\OSGeo4W64\share\gdal"
SetEnv QGIS_AUTH_DB_DIR_PATH "C:\OSGeo4W64\apps\qgis\resources"
SetEnv PYTHONHOME "C:\OSGeo4W64\apps\Python37"
SetEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\Qt5\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;"
SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis"
SetEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis\qtplugins;C:\OSGeo4W64\apps\Qt5\plugins;"

Call to GetCapabilities
http://localhost:8080/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

Request takes over 7 seconds and generates broken response, some text on screen but not complete XML.

Attached is QGIS Server log file only for that request.

qgis-server.log Magnifier (5.95 KB) Uroš Preložnik, 2018-12-23 09:20 AM

qgis server 3.4.4 uncomplete response.xml Magnifier (3.99 KB) Uroš Preložnik, 2019-02-14 08:12 PM

qgis-server-3.4.4.log Magnifier (7.71 KB) Uroš Preložnik, 2019-02-14 08:12 PM

httpd-vhosts.conf Magnifier - vhosts (2.81 KB) João Gaspar, 2019-03-08 09:42 AM

httpd.conf Magnifier - httpd.conf (20.4 KB) João Gaspar, 2019-03-08 09:48 AM

History

#1 Updated by Giovanni Manghi almost 6 years ago

  • Priority changed from Normal to High
  • Affected QGIS version changed from 3.4.2 to 3.4.4
  • Regression? changed from No to Yes

#2 Updated by Paul Blottiere over 5 years ago

Hi @Uroš Preložnik,

Request takes over 7 seconds

It's very strange considering that the logfile is stating 08:33:52 INFO Server3568: Request finished in 118 ms.

and generates broken response, some text on screen but not complete XML.

Can you give us the text which is actually displayed? Moreover, it seems that QGIS_PROJECT_FILE environment variable is empty as well as the MAP parameter. So the server will probably raise an exception.

Thanks for your report and send us news :).

#3 Updated by Paul Blottiere over 5 years ago

  • Status changed from Open to Feedback

#4 Updated by Uroš Preložnik over 5 years ago

Thanks for dealing with this.

Missing MAP parameter is not relevant, I always test server with plain GetCapabilities request. This should give XML reponse. So before dealing with projects and data just check if server is working, and it doesn't in this case.

First I updated my install from 3.4.2 to 3.4.4 (QGIS Desktop+server). Problem is the same, and I'm pretty sure that something with Python is messed up. Now I have Python27+Pythno37 (previously only 37).

I'm attaching uncomplete QGIS Server response and QGIS Server log file containing Python errors.

Hope it helps.

#5 Updated by Paul Blottiere over 5 years ago

Hi @Uroš Preložnik,

I'm attaching uncomplete QGIS Server response and QGIS Server log file containing Python errors.

Do you have Server Python plugins?

#6 Updated by Uroš Preložnik over 5 years ago

Paul Blottiere wrote:

Do you have Server Python plugins?

No, nothing custom. Just default setup of QGIS Desktop + server.

#7 Updated by João Gaspar over 5 years ago

Environment:
Windows 10 Home 64-bits
QGIS 3.4.5 Madeira 64-bits

Uros, I did a clean install with Apache Lounge Installers [https://www.apachelounge.com/download/]. I put the configurations in attach for httpd.conf and virtualhosts.config.

Note: The correct Python paths variables need to be pointed to 3.7.

Regards,
João

#8 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

#9 Updated by Uroš Preložnik over 5 years ago

Thanks João, so with your config QGIS server is running correctly, right?

I checked but nothing special, my paths are all valid also. I did another install today with latest LTR (3.4.7) but problem is the same.

What do you get if you run GetCapabilities (from your config should be something like that, correct if i wrote wrong):

http://localhost/qgis/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

Example of plain response what I can't get on Windows and is without MAP parameter is using this test server:
https://test.level2.si/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

Also available in: Atom PDF