[Mapserver-users] WMS server - client communication error

Sean Gillies sgillies at frii.com
Fri May 7 12:08:30 EDT 2004


On 07/mag/04, at 08:47, Daniel Morissette wrote:

> Alexandros Chimarios wrote:
>> Traceback (most recent call last):
>>   File "./src/test.py", line 131, in ?
>>     image = mo.draw();
>>   File "/usr/lib/python2.2/site-packages/mapscript.py", line 1783, in 
>> draw
>>     def draw(*args): return apply(_mapscript.mapObj_draw,args)
>> _mapscript.MapServerError: msLookupHashTable: Hash table error. 
>> Invalid hash table or key
>
> A similar problem was reported a few weeks ago:
>
> http://lists.gis.umn.edu/pipermail/mapserver-dev/2004-April/000955.html
>
> In this case it was with python as well, and it was not possible to 
> reproduce with the regular CGI. Perhaps there is something specific to 
> that flavour of MapScript?  I would suggest that you file a bug about 
> this.
>
> Daniel

Alexandros,

The Python mapscript module is set up so that the MapServer error stack 
is
checked after method calls (such as mapObj.draw), MapServer errors are
converted to Python exceptions and are raised.

Somewhere in msDrawMap, maybe in the WMS HTTP request code, 
msLookupHashTable
is being used to access layer or map metadata and is not finding 
something
it expects.  Maybe your mapfile lacks a WMS metadata parameter?
In the CGI MapServer, such an error will be reported but will
not necessarily stop execution of the program.  With the Python 
MapScript,
unhandled exceptions will stop execution.

I suggest that you try some code like this for now:

     image = mo.prepareImage() # so that it is defined outside the 
try/except
     try:
         image = mo.draw()
     except MapServerError:
         pass

Let me know how it goes and together we can work towards a better
solution.

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies




More information about the mapserver-users mailing list