Ticket #3243 (closed defect: wontfix)

Opened 3 years ago

Last modified 3 years ago

msDrawRaster(): Image handling error. on DEMIS world map WMS

Reported by: jachym Owned by: aboudreault
Priority: normal Milestone: 6.0 release
Component: WMS Client Version: 5.4
Severity: normal Keywords:
Cc: dmorissette

Description

Using

shp2img -m /tmp/mymap.map -o /tmp/map.png

with attached mapfile, I get

msDrawMap(): WMS connection error. Failed to draw WMS layer named '(null)'. This most likely
happened because the remote WMS server returned an invalid image, and XML exception or another
unexpected result in response to the GetMap request. Also check and make sure that the layer's
connection URL is valid.

msDrawRaster(): Image handling error. Unrecognized or unsupported image format

drawEPP(): Image handling error. /tmp/4b30c8d0_3831_0.img.tmp is not an EPPL file.

What I try is to download some data from demis world map server. Using the URL generated by MapServer directly

 http://www2.demis.nl/mapserver/wms.asp?LAYERS=Countries,Borders,Coastlines&REQUEST=GetMap&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=678&VERSION=1.1.1&SRS=EPSG:4326&WIDTH=1644&BBOX=7.03371357422342,46.9992085387121,23.8669059600633,52.4899307851778&TRANSPARENT=true&EXCEPTIONS=application/vnd.ogc.se_inimage

returns exactly the file, I'm looking for and it is of type image/png

So, why isn't MapServer able to work with returned image? Some bug maybe?

Attachments

mymap.map Download (1.7 KB) - added by jachym 3 years ago.

Change History

Changed 3 years ago by jachym

Changed 3 years ago by jachym

It should not affect the test, but I use custom EPSG 102067 definiton:

<102067> +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813975277778 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m +towgs84=498.17,136.89,510.08,6.007,4.343,3.831,3.38 no_defs <>

Changed 3 years ago by dmorissette

  • cc dmorissette added
  • owner changed from mapserverbugs to aboudreault
  • milestone set to 6.0 release

I am able to reproduce the issue using shp2img on your mapfile. We end up with a 0-byte temp file (the remote server's response), that's why we get this error, however the same request (from MapServer's DEBUG output) returns a valid image. Is this an incompatibility between MapServer/curl and the remote demis.nl server? We'll need to look deeper to figure what's happening.

Changed 3 years ago by dmorissette

  • status changed from new to closed
  • resolution set to wontfix

Ha! Fount it! The demis.nl server seems to produce a 0-byte response (intentionally?) if the user-agent string contains "MapServer/5.6.0...". Other random/unknown user-agent values do work though. Here is a 'wget' command that reproduces it:

wget --user-agent="MapServer/5.6.0" "http://www2.demis.nl/mapserver/wms.asp?LAYERS=Countries,Borders,Coastlines&REQUEST=GetMap&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=678&VERSION=1.1.1&SRS=EPSG:4326&WIDTH=1644&BBOX=7.03371357422342,46.9992085387462,23.8669059600633,52.4899307852108&TRANSPARENT=true&EXCEPTIONS=application/vnd.ogc.se_inimage" -O ttt2.gif

Closing as WONTFIX... there is unfortunately nothing we can do about this from this end.

(Well, you could always modify maphttp.c to change the default user-agent string in msHTTPExecuteRequests() to work around this if you want)

Changed 3 years ago by jachym

I aggree, this is not an mapserver issue. Looks like DEMIS tryies to block MapServer (and possibly other server) clients. Why this? Anyway, thanks.

Changed 3 years ago by pramsey

Per #2785, a patch has been applied to at least allow you to ignore these failure cases with the ON_MISSING_DATA call.

Changed 3 years ago by dmorissette

For the record, I just made a quick test and it seems that Demis no longer blocks the MapServer user agent. The following works now:

wget --user-agent="MapServer/5.6.0" "http://www2.demis.nl/wms/wms.asp?LAYERS=Countries,Borders&REQUEST=GetMap&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=678&VERSION=1.1.1&SRS=EPSG:4326&WIDTH=1644&BBOX=7.03371357422342,46.9992085387121,23.8669059600633,52.4899307851778&TRANSPARENT=true&EXCEPTIONS=application/vnd.ogc.se_inimage"  -O ttt.gif

(notice the new  http://www2.demis.nl/wms/wms.asp onlineresource URL, the one at  http://www2.demis.nl/mapserver/wms.asp that was used at the date of creation of this ticket seems to be gone)

Note: See TracTickets for help on using tickets.