[OpenLayers-Users] Problems setting up TileCache

Ben Brehmer bbrehmer at refractions.net
Wed Nov 22 11:56:29 EST 2006


Christopher Schmidt wrote:
> On Tue, Nov 21, 2006 at 03:10:17PM -0800, Ben Brehmer wrote:
>   
>> Hello Everyone,
>>
>> I have setup a very basic Open Layers application and am now in the 
>> process of setting up TileCache. I have proded and poked my 
>> tilecache.cfg file extensively and still can't get past an error which 
>> has to do with with the "type" attribute for the [cache] section.
>> Basically when tilecache.cgi is invoked it never gets past parsing the 
>> .cfg file and errors out at the "type=DiskCache" line, saying that the 
>> string requires a character as left operand.
>>
>> Is there some other configuration issues I should know about when 
>> setting up TileCache?
>>
>>
>>
>>
>> Error and cfg file details:
>>
>> tilecache.cfg file:
>>
>> [cache]
>> type=DiskCache                                        <-----------Error
>> base=/home/httpd/cf2/html/tilecache/
>> [basic]
>> type=WMSLayer
>> url=http://office.refractions.net/ms/cgi-bin/mapserv
>> extension=png
>>
>>
>>
>> The error I pull out of my error log:
>>
>> TypeError:
>> 'in <string>' requires character as left operand
>>     
>
> Oddly enough, this sounds like a bug in ConfigParser more than anything
> else... Do the logs give you any kind of traceback or anything like a
> line number where the error is happening?
>
> We're using Python2.4 for our TileCache workings, but I know that people
> have got it running under 2.3 -- this error is definitely something you
> wouldn't see under Python2.4, but I don't know if that would fix your
> problem. 
>
> I've just downloaded a clean TileCache 1.1, and edited tilecache.cgi to
> use Python2.3, and I'm not getting this error, unfortunately. If you
> could give any more information as to where in the code this error is
> happening, I'd appreciate it, and will investigate as best I can.
>
> Regards,
>   
Hi Christopher,

This is the complete error log:

[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1] Traceback (most 
recent call last):
[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]   File 
"/home/httpd/cf2/cgi-bin/tilecache-1.1/tilecache.cgi", line 6, in ?
[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]     svc = 
Service.load(*cfgfiles)
[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]   File 
"/home/httpd/cf2/cgi-bin/tilecache-1.1/TileCache/Service.py", line 249, 
in _load
[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]     cache = 
cls.loadFromSection(config, "cache", Cache)
[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]   File 
"/home/httpd/cf2/cgi-bin/tilecache-1.1/TileCache/Service.py", line 232, 
in _loadFromSection
[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]     if opt not 
in ("type"):
[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1] TypeError: 'in 
<string>' requires character as left operand
[Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1] Premature end 
of script headers: tilecache.cgi


I definitely agree with you that this is a problem in ConfigParser, 
although this may be related to me using Python 2.2.3. I am going to 
install Python 2.4 this morning. I"ll let you know if that was the cause 
of my problems.

Thanks for you help,

Ben



More information about the Users mailing list