You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a simple qgis project to be served by QGIS-Server/wfs3 I get a message:
<ServerException>Layer(s) not valid</ServerException>
It seems as QGISServer is seeing the relative path to my shp file as an absolute path.
IN the qgs file from the qgz I see a relative path ( attached: zippedprojectfile.zip )
I've seen this first on a Windows (OSGeo4W server instal), but I can reproduce it on a Debian based install.
As this is about WFS3, it works only in 3.10 or master
<datasource>./pc6/pc6.shp</datasource>
But in the apache log it seems QGISServer is looking at an absolute path:
../src/core/providers/ogr/qgsogrprovider.cpp:475 : (QgsOgrProvider) [1ms] Data source uri is [/pc6/pc6.shp]
../src/core/providers/ogr/qgsogrprovider.cpp:273 : (AnalyzeURI) [0ms] Data source uri is [/pc6/pc6.shp]
../src/core/providers/ogr/qgsogrprovider.cpp:4401 : (open) [0ms] mFilePath: /pc6/pc6.shp
To reproduce:
put the pc6.* files from this zip in a directory pc6 somewhere pc6.zip
create a QGIS project from (only this pc6.shp) and save it NEXT to the pc6 dir
(you can check datasource in the project file)
also make sure you tick the box that you want to server the pc6 file as a wfs3 layer (in project properties)
now copy the project.qgz file AND the data pc6/pc6.* into your /usr/lib/cgi-bin dir (next to your mapserv)
configure qgis mapserver (I do it in Apache) pointing to the projectfile by using: FcgidInitialEnv QGIS_PROJECT_FILE "pc6project.qgz"
IF instead of FcgidInitialEnv QGIS_PROJECT_FILE "pc6project.qgz"
I use FcgidInitialEnv QGIS_PROJECT_FILE "/usr/lib/cgi-bin/pc6project.qgz"
THEN the data is found...
(and off course I can also tick the checkbox 'use absolute paths' in the project file)
@elpaso is the cgi maybe not aware of it's place on the file system, if it is set relative (to the cgi)? So it cannot know that it should look for the data in /usr/lib/cgi-bin (or whatever folder you have the fcgi).
If that is the case then I think it should just not be possible to use a relative path for the QGIS_PROJECT_FILE anyway. Now it finds the project file, but cannot find the data
Else; maybe there is some logic missing?
@rduivenvoorde you mention WFS3, but does it work with plain WMS/WFS? In other words is this specific to WFS3?
Regarding your question about cgi self-awareness, I think that it does not matter: the (relative) paths are all calculated relatively to the project path.
elpaso
added a commit
to elpaso/QGIS
that referenced
this issue
Jan 20, 2020
Fixesqgis#33200 when (server) project was loaded from
the FCGI current directory with a relative path
or not path at all: the pathresolver assumed the
project file path was absolute, which wasn't the
case in this issue.
By forcing the project path to absolute, the
problem goes away.
When I create a simple qgis project to be served by QGIS-Server/wfs3 I get a message:
<ServerException>Layer(s) not valid</ServerException>
It seems as QGISServer is seeing the relative path to my shp file as an absolute path.
IN the qgs file from the qgz I see a relative path ( attached: zippedprojectfile.zip )
I've seen this first on a Windows (OSGeo4W server instal), but I can reproduce it on a Debian based install.
As this is about WFS3, it works only in 3.10 or master
<datasource>./pc6/pc6.shp</datasource>
But in the apache log it seems QGISServer is looking at an absolute path:
To reproduce:
(you can check datasource in the project file)
FcgidInitialEnv QGIS_PROJECT_FILE "pc6project.qgz"
Now go to your mapserver:
http://localhost/cgi-bin/qgis_mapserv.fcgi/wfs3
And you will see the error
Full apache log:
The text was updated successfully, but these errors were encountered: