pink tiles

3 messages Options Options
Embed this Post
Permalink
Sylvain Pasche-2

pink tiles

Reply Threaded MoreMore options
Print post
Permalink
Hi,

I hit the "pink tiles" issue recently on a project. I'm using tilecache
revision 139 with mod_python.

Here's the exception I received from the server:

An error occurred: [Errno 17] File exists:
'/tmp/tilecache/teleatlas/04/000/000/432'
  File "/var/lib/python-support/python2.4/TileCache/Service.py", line
459, in modPythonHandler
    host )
  File "/var/lib/python-support/python2.4/TileCache/Service.py", line
443, in dispatchRequest
    return self.renderTile(tile, params.has_key('FORCE'))
  File "/var/lib/python-support/python2.4/TileCache/Service.py", line
402, in renderTile
    if (data): image = self.cache.set(tile, data)
  File "/var/lib/python-support/python2.4/TileCache/Cache.py", line 132,
in set
    os.makedirs(dirname)
  File "os.py", line 156, in makedirs
    makedirs(head, mode)
  File "os.py", line 156, in makedirs
    makedirs(head, mode)
  File "os.py", line 159, in makedirs
    mkdir(name, mode)


I used the attached patch to work around the issue (simply ignores the
mkdir exception in case of error). Maybe there's a better way to solve this.


Regards,
Sylvain


--- /var/lib/python-support/python2.4/TileCache/Cache.py.orig
+++ /var/lib/python-support/python2.4/TileCache/Cache.py
@@ -129,7 +129,11 @@
         filename = self.getKey(tile)
         dirname  = os.path.dirname(filename)
         if not self.access(dirname, 'write'):
-            os.makedirs(dirname)
+            try:
+                os.makedirs(dirname)
+            except OSError:
+                # Hack
+                pass
         tmpfile = filename + ".%d.tmp" % os.getpid()
         output = file(tmpfile, "wb")
         output.write(data)



_______________________________________________
Tilecache mailing list
Tilecache@...
http://openlayers.org/mailman/listinfo/tilecache
Christopher Schmidt-2

Re: pink tiles

Reply Threaded MoreMore options
Print post
Permalink
On Fri, Mar 07, 2008 at 11:04:26AM +0100, Sylvain Pasche wrote:
> Hi,
>
> I hit the "pink tiles" issue recently on a project. I'm using tilecache
> revision 139 with mod_python.
>
> Here's the exception I received from the server:

Yeah, I think kleptog and I worked out that this is a bug in os.mkdirs,
but I thought we had fixed it... looks like we talked about it, then
never did anything about it.

> I used the attached patch to work around the issue (simply ignores the
> mkdir exception in case of error). Maybe there's a better way to solve this.

No, i think that makes sense, but you'd need to write a patch against
SVN for me to be able to apply it :)

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
Tilecache@...
http://openlayers.org/mailman/listinfo/tilecache
Christopher Schmidt-2

Re: pink tiles

Reply Threaded MoreMore options
Print post
Permalink
On Fri, Mar 07, 2008 at 09:02:34AM -0500, Christopher Schmidt wrote:

> On Fri, Mar 07, 2008 at 11:04:26AM +0100, Sylvain Pasche wrote:
> > Hi,
> >
> > I hit the "pink tiles" issue recently on a project. I'm using tilecache
> > revision 139 with mod_python.
> >
> > Here's the exception I received from the server:
>
> Yeah, I think kleptog and I worked out that this is a bug in os.mkdirs,
> but I thought we had fixed it... looks like we talked about it, then
> never did anything about it.
>
> > I used the attached patch to work around the issue (simply ignores the
> > mkdir exception in case of error). Maybe there's a better way to solve this.
>
> No, i think that makes sense, but you'd need to write a patch against
> SVN for me to be able to apply it :)

I took your patch, made it more specific (only catching on errno 17,
since errno 13, 'no permission', is useful, as are others like 'out of
disk space'), and committed it to trunk. Thanks.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
Tilecache@...
http://openlayers.org/mailman/listinfo/tilecache