Opened 14 years ago
Closed 13 years ago
#3525 closed defect (fixed)
WMS 1.3.0 - Wrong default EXCEPTIONS parameter
Reported by: | colivier | Owned by: | assefa |
---|---|---|---|
Priority: | normal | Milestone: | 5.6.5 release |
Component: | WMS Server | Version: | 5.6 |
Severity: | normal | Keywords: | WMS 1.3.0 EXCEPTIONS default |
Cc: | dmorissette, sholl |
Description
Hi,
On 5.6.5 (didn't check for trunk) the default value for EXCEPTIONS parameter seems not right for WMS 1.3.0
Following patch against 5.6 branch fix this behaviour:
Index: mapwms.c =================================================================== --- mapwms.c (revision 10484) +++ mapwms.c (working copy) @@ -90,6 +90,8 @@ wms_exception_format = "SE_XML"; /* WMS 1.0.1 to 1.0.7 */ else if (nVersion <= OWS_1_1_1) wms_exception_format = "application/vnd.ogc.se_xml"; /* WMS 1.1.0 to 1.1.1 */ + else if (nVersion == OWS_1_3_0) + wms_exception_format = "XML"; /* WMS 1.3.0 */ else wms_exception_format = "text/xml"; }
HTH,
Attachments (1)
Change History (27)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Hi Amaul,
Yes the previous tiny patch give a correct default value to EXCEPTIONS in 1.3.0 so it allow EXCEPTIONS to be optional in request (and so to follow the spec)
comment:3 by , 14 years ago
Owner: | changed from | to
---|
Hi all,
I was checking this and using a GetMap request that fails, I get an exception returned with a Content-type: text/xml, which I believe is correct.
My request has the version set to 1.3.0, and no exception defined:
Would you please let me know how I can reproduce the problem you are seeing? I have tried this request with both 5.6.x branch and trunk.
best regards,
comment:4 by , 14 years ago
Hi Assefa,
I used a 5.6.5 on a linux box
./configure --with-fastcgi --with-wmsclient --with-curl-config=/usr/bin/curl-config --with-proj MapServer version 5.6.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=FASTCGI INPUT=EPPL7 INPUT=JPEG INPUT=SHAPEFILE
WMS 1.3.0 GetMap
http://www.oslandia.com/cgi-bin/mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=587049,6222392,588268,6231438&HEIGHT=822&FORMAT=image/png&WIDTH=905&LAYERS=VOIE_FERREES&STYLES=&CRS=EPSG:2154
It supposed to work but return instead:
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?> <ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd"> <ServiceException code="InvalidFormat"> msWMSLoadGetMapParams(): WMS server error. Invalid format for the EXCEPTION parameter. </ServiceException> </ServiceExceptionReport>
On the other hand, it works fine with WMS 1.1.1
http://www.oslandia.com/cgi-bin/mapserv.fcgi?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=587049,6222392,588268,6231438&HEIGHT=822&FORMAT=image/png&WIDTH=905&LAYERS=VOIE_FERREES&STYLES=&SRS=EPSG:2154
But i realize that my previous patch is not 'enough' as i still meet the problem with 1.3.0 request :/
comment:5 by , 14 years ago
Bonjour Olivier,
Is it possible that there is some cookie called EXCEPTIONS? Looking into the code, I see no reason It should throw the error if the EXCEPTIONS paramater is not set in the URL or in a cookie. Could you please when you have a minute patch the 5.6.x to display the value of this EXCEPTIONS parameter?
Thanks
--- mapwms.c (revision 10488) +++ mapwms.c (working copy) @@ -740,8 +740,8 @@ strcasecmp(wms_exception_format, "XML") != 0) { msSetError(MS_WMSERR, - "Invalid format for the EXCEPTION parameter.", - "msWMSLoadGetMapParams()"); + "Invalid format %s for the EXCEPTIONS parameter.", + "msWMSLoadGetMapParams()", wms_exception_format); return msWMSException(map, nVersion, "InvalidFormat"); } }
comment:6 by , 14 years ago
Done,
The behaviour is unpredictible, It could work as expected (i.e produce a map)
or produce an error message like this one: {{{<ServiceExceptionReport version="1.3.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd"> <ServiceException code="InvalidFormat">
msWMSLoadGetMapParams(): WMS server error. Invalid format €¢±‘— for the EXCEPTIONS parameter. </ServiceException> </ServiceExceptionReport> }}}
or like this one:
<ServiceExceptionReport version="1.3.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd"> <ServiceException code="InvalidFormat"> msWMSLoadGetMapParams(): WMS server error. Invalid format VOIE_FERREES for the EXCEPTIONS parameter. </ServiceException> </ServiceExceptionReport>
comment:7 by , 14 years ago
Cc: | added |
---|
I was able to reproduce with your site the unpredictable behavior:
http://www.oslandia.com/cgi-bin/mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=587049,6222392,588268,6231438&HEIGHT=822&FORMAT=image/png&WIDTH=905&LAYERS=VOIE_FERREES&STYLES=&CRS=EPSG:2154&
Looking at your url, I see that fast cgi is used. I am wondering if that is the issue since the wms code uses a global variable (wms_exception_format). I have tried locally to reproduce it with fast cgi (and non fast cgi) but could not. I am wondering if using just the cgi would have this unpredictable behavior on your site. If not maybe removing this global variable could be done.
comment:8 by , 14 years ago
Assefa,
You're right, with same binary running as cgi everything is fine.
http://www.oslandia.com/cgi-bin/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=587049,6222392,588268,6231438&HEIGHT=822&FORMAT=image/png&WIDTH=905&LAYERS=VOIE_FERREES&STYLES=&CRS=EPSG:2154
comment:9 by , 14 years ago
Thanks for the tests Olivier. I will see if I can remove the use of this global variable.
comment:10 by , 13 years ago
Cc: | added |
---|
Assefa,
is the FCGI-Issue with the exception-stuff already solved or still pending?
Is the above mentioned patch already applied to trunk though? It seems that there is an issue with fcgi then.
Could anyone give a hint how to get this solved?
TIA
Stephan
follow-up: 12 comment:11 by , 13 years ago
Stephan, the patch mentioned above was not enough to solve the issue in fstcgi mode. I have not started addressing bugs for 6.0 yet . This will be done in january/feb before the release. At that point I will also work on this bug.
comment:12 by , 13 years ago
Replying to assefa:
Stephan, the patch mentioned above was not enough to solve the issue in fstcgi mode. I have not started addressing bugs for 6.0 yet . This will be done in january/feb before the release. At that point I will also work on this bug.
Thanks for your information. It seems there is currently no workarround to get this done in 5.6.5 though. Due to the fact that it does only happen sometimes I need to think about not using fcgi. One thing one could try is to always send the exceptions-format-KVP in correct notation, perhaps this solves the issue.
Best
Stephan
comment:14 by , 13 years ago
I can also reproduce this issue with QGis 1.6.0 (which doesn't set the EXCEPTION parameter), using mapserver 5.6.5 in fastcgi mode too. Any workaround/fix welcome.
follow-up: 17 comment:16 by , 13 years ago
I have attached a patch against 5.6.x (bug3525_ms5.6.patch ) I would appreciate if someone can test it.
comment:17 by , 13 years ago
Replying to assefa:
I have attached a patch against 5.6.x (bug3525_ms5.6.patch ) I would appreciate if someone can test it.
I will give it a shot with a patched 5.6.5 MS and report back soon. Thanks for backporting it!
Stephan
comment:18 by , 13 years ago
I can confirm that bug3525_ms5.6.patch fixes the issue for me on 5.6.5. Thanks a lot!
comment:19 by , 13 years ago
valid GetMap-Request without an (optional) EXCEPTIONS-Parameter do not work.
curl "http://lvermgeo-geo4.intevation.de/fcgi-bin/dop20_geo4_r02.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=48.878182,5.912260,50.986500,8.662410&CRS=EPSG:4326&WIDTH=670&HEIGHT=514&LAYERS=dop&STYLES=&FORMAT=image/jpeg" <?xml version='1.0' encoding="UTF-8" standalone="no" ?> <ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd"> <ServiceException code="InvalidFormat"> msWMSLoadGetMapParams(): WMS server error. Invalid format for the EXCEPTION parameter. </ServiceException> </ServiceExceptionReport>
I assumed the optional-parameter should default to XML, which actualy does not work here (using QGIS) which lacks this paramete when requesting WMS-layers.
comment:20 by , 13 years ago
Stephane,
Is the error you are getting with trunk or with mapserver 5.6 (+ patch)?
It is the same problem that you were having before, right? This error reported seems to indicate that what was done to solve this issue had no effect in your case?
comment:21 by , 13 years ago
Assefa,
this was tried with the patched 5.6.5 version, yes. I must admit that I there are also other patches patched against vanilla MS 5.6.5:
Patch-Order from top to bottom.
yes, its the same problem. /me rethinks stuff. Restarting Apache solved the problem right now since the new binary was introduced by a new debian-package.
Bottomline: all fine now, sorry for my noise.
comment:22 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks for testing.
I have committed the fix in the 5.6.x branch (r10868)
comment:23 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Assefa,
I monitored the maschine some days and the problem is back. Restarting Apache solves it (at least for a while).
Therefore I reopend the ticket again. Could you have a look again please?
Thanks
comment:24 by , 13 years ago
Looking into this:
can I ask you to apply theis patch so that we see what the value of the exception is:
Index: mapwms.c =================================================================== --- mapwms.c (revision 10869) +++ mapwms.c (working copy) @@ -739,8 +739,8 @@ strcasecmp(wms_exception_format, "XML") != 0) { msSetError(MS_WMSERR, - "Invalid format for the EXCEPTIONS parameter.", - "msWMSLoadGetMapParams()"); + "Invalid format %s for the EXCEPTIONS parameter.", + "msWMSLoadGetMapParams()", wms_exception_format); return msWMSException(map, nVersion, "InvalidFormat", wms_exception_format); } }
comment:26 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Replying to assefa:
Is this still an issue?
no, not as far as I can see till today. THanks for fixing.
Best
Stephan
Additionally the exceptions parameter should be optional for the GetMap request as the OGC WMS 1.3.0 specification states on page 37:
7.3.3.11 EXCEPTIONS The optional EXCEPTIONS parameter is defined in 6.9.4. The default value is XML if this parameter is absent from the request...
Currently the exceptions parameter must be present in the GET parameter list for a working GetMap request.