Bug report #8027

qgis-server doesn't understand correctly the relative path

Added by aperi2007 - over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:QGIS Server
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:16872

Description

As reported:
Using a relative path and putting the db spatialite in the same folder where is the project.
The qgis-server don't find the db spatialite.

It work only if the path is absolute.

I don't know if this was an older and always existent bug.
Bug surely if a bad bug because in a server the absolute path is not so easy to extablish.

So I put it as a blocker bug.

History

#1 Updated by Paolo Cavallini over 7 years ago

  • Category set to QGIS Server

If I understand it correctly, it works here.

#2 Updated by René-Luc ReLuc over 7 years ago

Can you give us more information :
  • How did you defined that QGIS-Server doesn't find spatialite db in relative path ?
  • Do you have some test to reproduce the bug ?
  • What is the OS of your server ?
  • WHat is the OS of your desktop ?
  • What is the version of the Desktop and Server version ?

We propose with LizMap, some examples data in spatialite with relative path and QGIS-Server-master has no problem to find there.

#3 Updated by aperi2007 - over 7 years ago

I create a db spatialite using the spatialite 4.0 or 4.1
after this I convert it to a spatialite 3.0
On a windows 7 64 bit I create a qgis project using a qgis-dev .
Using relate path and putting the file spatialite 3.0 and the qgis file project in the same path.

In this configuration it work.
After this I send it to a server sending both the qgis prject file and the db file in the cgi-bin folder of the webserver.
In the server there is a cgi of a qgis-server compiled from the seme code from GITHub.

When I try to invoke it from my qgis desktop as a layer wms it not respond anything.

If I change manually the path in the qgis project changing it from

dbname='./xxxxx.sqlite'

to

dbname='/home/.../path-tocgi/cgi/xxxxx.sqlite'

It start to respond.

#4 Updated by René-Luc ReLuc over 7 years ago

  • What is the OS of your server ?
  • Do you have the same problem with other vector data file ?
  • Do you use MAP parameter in you're WMS request ?
  • Do you look at the GetCapabilities Response in a Web Browser ?
  • DO you have the same problem if you move the project in an other directory with the MAP parameter ?

#5 Updated by aperi2007 - over 7 years ago

What is the OS of your server ?
--> The server OS is RedHat ES6 64 bit.

Do you have the same problem with other vector data file ?
--> I don't knowI'm use only spatialites dbfiles. This is the first try to use qgis-server . Usually I use Mapserver.

Do you use MAP parameter in you're WMS request ?
--> yes out call is something like:
http://www......./cgi-bin/qgis?map=project.qgs

Do you look at the GetCapabilities Response in a Web Browser ?
--> I guess yes, because I'm using the qgis desktop from a pc client to test the work of wms service.
I know the add layer wms will use the getcapabilities to understand all the layers and the urls.

DO you have the same problem if you move the project in an other directory with the MAP parameter ?
--> I will try this early to properly response to this.

Regards.

#6 Updated by aperi2007 - over 7 years ago

I tested using a subfolder as relative path.
Still it is not working.

More precisely.
I'm able to connect to the qgis-server wms.
Also I see the right list of layer and also I'm able to add a layer to the canvas.
But I don't see anything as the geometries was fully transparency or null.

Regards.

However this seem to be a problem only of my server .
So I guess this ticket could be closed.

#7 Updated by aperi2007 - over 7 years ago

  • Status changed from Open to Closed
  • Resolution set to invalid

I close the ticket this work correctly on other external system, as reported.
So the only possible cause can be an incompatibility between
qgis-server (or its spatialite driver) and the RedHat ES 6 64 bit.

However the workaround of absolute path seem to work.
So this is not really a big problem for who use qgis-server on redhat.

#8 Updated by Paolo Cavallini over 7 years ago

  • Subject changed from qgis-server don't understand correctly the relative path in a spatialite db to qgis-server doesn't understand correctly the relative path
  • Status changed from Closed to Reopened

#9 Updated by Paolo Cavallini over 7 years ago

  • Status changed from Reopened to Closed

So, relative paths to projects are not supported as for now.

Also available in: Atom PDF