camptocamp / c2cgeoportal

c2cgeoportal application
http://geomapfish.org
Other
64 stars 46 forks source link

Error when printing external WMS (QGIS server) layers #2958

Closed gnerred closed 7 years ago

gnerred commented 7 years ago

Print V 3 GMF V 2.1

A Java error "is denied" is thrown when trying to print external WMS layers (from QGIS server) layers. To reproduce :

1°/ Go to https://preprod.cartoriviera.ch/s/vBFG 2°/ Click on the print button 3°/ Click on "Imprimer PDF" -> http://127.0.0.1/qgis/qgis_mapserver.fcgi?TRANSPARENT=true&TRANSPARENT=true&MAP_RESOLUTION=254&BBOX=554365.05%2C145408.75%2C554929.4500000001%2C145683.75&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&HEIGHT=1375&REQUEST=GetMap&LAYERS=export_wastewater_structure&STYLES=&MAP=%2Fvar%2Fsig%2Fqgis%2Fexport.qgs&SRS=EPSG%3A21781&WIDTH=2822 is denied.

Is there a special access to configure to avoid this "is denied" error ?

sbrunner commented 7 years ago

1°/ Go to https://preprod.cartoriviera.ch/s/vBFG

=> 404 not found ...

gnerred commented 7 years ago

Yes, my preprod is no more working because of the issue concerning migration from 2.1.2 to 2.1.4... https://github.com/camptocamp/c2cgeoportal/issues/2959

gnerred commented 7 years ago

@sbrunner , my preprod is now running again, you can test

sbrunner commented 7 years ago

Thanks :-)

sbrunner commented 7 years ago

Here there is a missing en entry for qgis server: https://github.com/camptocamp/cartoriviera_geomapfish/blob/master/print/print-apps/cartoriviera/config.yaml.mako#L54-L55 :-)

gnerred commented 7 years ago

I've tried with the following configurations, but I get the same problem at each time (at this time, the last one is configured) :

            - !localMatch
              pathRegex: http://127.0.0.1/qgis

            - !localMatch
              pathRegex: /${__import__('re').escape(instanceid)}/qgis

            - !localMatch
              pathRegex: /${__import__('re').escape(instanceid)}/qgis/qgis_mapserver.fcgi
ochriste commented 7 years ago

try

ochriste commented 7 years ago

err, more likely

pathRegex: "/qgis/.*"

gnerred commented 7 years ago

Great thanks @ochriste , it works :O) !

sbrunner commented 7 years ago

or :-)

            - !localMatch
              pathRegex: /qgis/qgis_mapserver.fcgi