WMS Troubleshooting

David Fawcett David.Fawcett at STATE.MN.US
Mon Sep 13 12:10:11 EDT 2004


I was troubleshooting a WMS server and WMS client and ran into a few
glitches.  I couldn't find much relating to these errors in the list
archives, so here are the symptoms that I had and the solutions that I
came up with.

When testing your WMS server using a WMS client, if you get an error
message like:

msDrawMap(): Image handling error.  Failed to draw layer named
'your_layer'.
msDrawRaster(): image handling error.  Unrecognized or unsupported
image format.
(followed by other error messages)

It is essentially telling you that your WMS client can't draw the WMS
layer as requested.  This could be a problem with the actual layer on
the WMS server or it could just be a problem with the syntax of your
request.  In my case, it had nothing to do with the image format
requested.

My next step was go back to my WMS server and pretend for a moment that
it was not a WMS server and to hit it through the normal CGI interface
like any other MapServer App.  The layer that I was interested in
displayed just like it should, so I started to think that maybe there
was something wrong with my WMS client.

The next logical step was to submit my GetMap request directly to the
WMS server.  I Copied the request URL out of the CONNECTION item for the
layer in the WMS client map file and submitted that directly through a
browser.

In my case, I got the following error:

msEvalRegex(): Regular expression error.
String(your_path_to_mapfile?version=1.1.1) failed expression test.

It turns out that this was telling me that there was a problem with the
URL that I was submitting. A stupid, simple typo syntax error was the
cause.  I had typed a '?' where I should have had a '&'.

Make sure that URL of your mapserver executable is followed by a '?'
and that all of the subsequent name value pairs are separated by the
'&'.

A valid URL would be:
http://127.0.0.1/cgi-bin/mapserv.exe?map=c:\apache\htdocs\mymap.map&version=1.1.1&service=wms&layers=airphotos


The following URL would give you the msEvalRegex() error:
(note the second '?' after the map path)

http://127.0.0.1/cgi-bin/mapserv.exe?map=c:\apache\htdocs\mymap.map?version=1.1.1&service=wms&layers=airphotos


David.


David J. Fawcett
MN Office of Environmental Assistance



More information about the mapserver-users mailing list