Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#3243 closed defect (wontfix)

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 (1)

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

Download all attachments as: .zip

Change History (7)

by jachym, 14 years ago

Attachment: mymap.map added

comment:1 by jachym, 14 years ago

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 <>

comment:2 by dmorissette, 14 years ago

Cc: dmorissette added
Milestone: 6.0 release
Owner: changed from mapserverbugs to aboudreault

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.

comment:3 by dmorissette, 14 years ago

Resolution: wontfix
Status: newclosed

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)

comment:4 by jachym, 14 years ago

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

comment:5 by pramsey, 14 years ago

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

comment:6 by dmorissette, 13 years ago

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.