[OpenLayers-Users] TileCache and error "Zero length data

Duarte Carreira DCarreira at edia.pt
Fri Dec 22 13:13:57 EST 2006


 
Christopher,

Thanks for your input.

I've tried your python statements and got the following:

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>>> data =
urllib.urlopen("http://labs.metacarta.com/wms/vmap0?REQUEST=GETCAPABI
LITIES")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "F:\Python25\lib\urllib.py", line 82, in urlopen
    return opener.open(url)
  File "F:\Python25\lib\urllib.py", line 190, in open
    return getattr(self, name)(url)
  File "F:\Python25\lib\urllib.py", line 334, in open_http
    return self.http_error(url, fp, errcode, errmsg, headers)
  File "F:\Python25\lib\urllib.py", line 347, in http_error
    result = method(url, fp, errcode, errmsg, headers)
  File "F:\Python25\lib\urllib.py", line 687, in http_error_407
    errcode, errmsg, headers)
  File "F:\Python25\lib\urllib.py", line 355, in http_error_default
    void = fp.read()
  File "F:\Python25\lib\socket.py", line 290, in read
    data = self._sock.recv(recv_size)
IOError: [Errno socket error] (10054, 'Connection reset by peer')
>>>

If I try with urllib2 I get a more specific error message:

>>> import urllib2
>>> data =
urllib2.urlopen("http://labs.metacarta.com/wms/vmap0?REQUEST=GETCAPAB
ILITIES")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "F:\Python25\lib\urllib2.py", line 121, in urlopen
    return _opener.open(url, data)
  File "F:\Python25\lib\urllib2.py", line 380, in open
    response = meth(req, response)
  File "F:\Python25\lib\urllib2.py", line 491, in http_response
    'http', request, response, code, msg, hdrs)
  File "F:\Python25\lib\urllib2.py", line 418, in error
    return self._call_chain(*args)
  File "F:\Python25\lib\urllib2.py", line 353, in _call_chain
    result = func(*args)
  File "F:\Python25\lib\urllib2.py", line 499, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 407: Proxy Authentication Required ( The
ISA Serve
r requires authorization to fulfill the request. Access to the Web Proxy
service
 is denied.  )

Do you think this can be overcome using Python's proxy commands? Or is
this something to review with our net admin?

Duarte


> Date: Fri, 22 Dec 2006 13:12:29 -0000
> From: "Duarte Carreira" <DCarreira at edia.pt>
> Subject: Re: [OpenLayers-Users] TileCache and error "Zero length data
> 	returned from layer"
> To: <users at openlayers.org>
> Message-ID: <94C0F903807262438796839A98A9BA50015CF27B at beja001.edia.pt>
> Content-Type: text/plain;	charset=us-ascii
> 
> I'm responding to myself - maybe this will help someone else. 
> 
> Tilecache wasn't working even for localhost mapservices or intranet.
> 
> After reading the Tile Map Service Specification, I read the 
> notice stating IIS does not conform to the CGI specification 
> regarding path_info. So I followed the instructions to set 
> this up given on the MS link 
> (http://support.microsoft.com/kb/q184320/).
> 
> After this, the error did not occur if the mapservice was on 
> the Intranet. But I was getting no images in my map...
> 
> After digging a bit more, I looked at the generated source in 
> Firefox, and all images were being styled with 'display: 
> none' and had a "src=tilecache.py?......" without the 
> complete url (localhost/....).
> I edited the test page pointing the layer to a complete url, 
> and finally got tilecache working.
> 
> Another solution was using this line from the demo on
> http://labs.metacarta.com/wms-c/demo.html:
> 
> OpenLayers.Tile.Image.prototype = OpenLayers.Class.inherit( 
> OpenLayers.Tile.Image, { checkImgURL: function() {} });
> 
> Now, everything works only on intranet mapservices, and every 
> attempt to use external mapservices resulted in the same zero 
> length error.
> I'm on an ISA server lan, so I'm guessing there's a problem 
> there. I saw many references to this issue on the net but 
> could not figure out a solution other than installing the 
> latest python 2.5 which didn't help.
> I may be wrong about the root of the problem being ISA 
> Server/proxy, so if anyone else has an ideia about this I'd 
> be happy to hear about it.
> 
> Thanks.
> Duarte Carreira
> 
> 
> 
> -----Mensagem original-----
> ----------------------------------------------------------------------
> Date: Tue, 12 Dec 2006 19:38:47 -0000
> From: "Duarte Carreira" <DCarreira at edia.pt>
> Subject: [OpenLayers-Users] TileCache and error "Zero length data
> 	returned	from layer"
> To: <users at openlayers.org>
> Message-ID: <94C0F903807262438796839A98A9BA50015151BA at beja001.edia.pt>
> Content-Type: text/plain; charset="us-ascii"
> 
> I'm trying to setup TileCache under Windows + Python 2.4 + 
> IIS 5.1 + CGI.
>  
> I can get a python test page to work ok.
>  
> I use the default configuration pointing to metacarta's vmap0 
> wms service.
>  
> Then I try the example url:
> http://localhost/tilecache/tilecache.cgi?LAYERS=basic&SERVICE=
WMS&VERSIO
> N=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-180,-90,0,90&WIDTH=
> 256&HEIGHT
> =256
> <http://localhost/tilecache/tilecache.cgi?LAYERS=basic&SERVICE
=WMS&VERSI
> ON=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-180,-90,0,90&WIDTH
=256&HEIGH
> T=256> 
> 
> And I get the following error:
> 
> An error occurred: Zero length data returned from layer.
>   File "C:\wms\tilecache-1.3\TileCache\Service.py", line 427, 
> in cgiHandler
>     format, image = service.dispatchRequest( params, path_info, host )
> 
>   File "C:\wms\tilecache-1.3\TileCache\Service.py", line 383, 
> in dispatchRequest
>     return self.renderTile(tile, params.has_key('FORCE'))
> 
>   File "C:\wms\tilecache-1.3\TileCache\Service.py", line 362, 
> in renderTile
>     else: raise Exception("Zero length data returned from layer.")
> 
> I have seen another message in the lists pointing the same 
> error and it seems the culprit is urllib2.
> 
> Is there a solution to this problem? Some additional 
> configuration needed? Is there anyone running the same 
> configuration successfully?
> 
> Thanks,
> 
> Duarte
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Fri, 22 Dec 2006 10:01:38 -0500
> From: Christopher Schmidt <crschmidt at metacarta.com>
> Subject: Re: [OpenLayers-Users] TileCache and error "Zero length data
> 	returned from layer"
> To: Duarte Carreira <DCarreira at edia.pt>
> Cc: users at openlayers.org
> Message-ID: <20061222150138.GA26467 at metacarta.com>
> Content-Type: text/plain; charset=us-ascii
> 
> On Fri, Dec 22, 2006 at 01:12:29PM -0000, Duarte Carreira wrote:
> > I'm responding to myself - maybe this will help someone else. 
> > 
> > Tilecache wasn't working even for localhost mapservices or intranet.
> > 
> > After reading the Tile Map Service Specification, I read the notice 
> > stating IIS does not conform to the CGI specification regarding 
> > path_info. So I followed the instructions to set this up 
> given on the 
> > MS link (http://support.microsoft.com/kb/q184320/).
> 
> That's unfortunate. I'll document that in the next TileCache release.
> 
> > After this, the error did not occur if the mapservice was on the 
> > Intranet. But I was getting no images in my map...
> > 
> > After digging a bit more, I looked at the generated source 
> in Firefox, 
> > and all images were being styled with 'display: none' and had a 
> > "src=tilecache.py?......" without the complete url (localhost/....).
> > I edited the test page pointing the layer to a complete url, and 
> > finally got tilecache working.
> 
> This part is a problem with OpenLayers 2.2 -- relative URLs 
> don't work.
> We've got an open bug on this that I haven't had time to 
> review a patch on -- I'm sorry about the fact that this was 
> causing you pain.
> 
> > Another solution was using this line from the demo on
> > http://labs.metacarta.com/wms-c/demo.html:
> > 
> > OpenLayers.Tile.Image.prototype = OpenLayers.Class.inherit( 
> > OpenLayers.Tile.Image, { checkImgURL: function() {} });
> > 
> > Now, everything works only on intranet mapservices, and 
> every attempt 
> > to use external mapservices resulted in the same zero length error.
> 
> If you run Python on the command line, and use urllib to open 
> a URl which is failing, does it work? Open a command line 
> prompt on the server, run Python, and then type:
> 
> import urllib
> data = 
> urllib.urlopen("http://example.com/cgi-bin/mapserv?request=Get
Capabilities")
> print len(data.read())
> 
> If you get 0, or an exception of some kind, then this won't 
> work, and you probably want to talk to your network 
> administrator and ask why -- typically, this indicates that 
> the server can not speak to port 80 outbound.
> 
> Regards,
> --
> Christopher Schmidt
> MetaCarta
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Fri, 22 Dec 2006 17:02:12 +0100
> From: "Bart van den Eijnden (OSGIS)" <bartvde at osgis.nl>
> Subject: [OpenLayers-Users] show waitimage for overlays
> To: users at openlayers.org
> Message-ID: <c8c595eba7c9d403aa31838f150a7a89 at 145.50.39.11>
> Content-Type: text/plain; 	charset="iso-8859-1"
> 
> Hi list,
> 
> setting a background url for the OpenLayers' div shows an animated gif
> (waitimage) until the base layer is loaded, but it does not show the
> waitimage when overlays are loading.
> 
> So I am showing a waitimage in a div, and I want to remove it 
> when all the
> overlays finish loading. Is there an event I can hook into 
> which gives me an
> idea when the overlays finish loading?
> 
> Any help very much appreciated!
> 
> Best regards,
> Bart
> 
> 
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 
> End of Users Digest, Vol 3, Issue 24
> ************************************
> 



More information about the Users mailing list