[MapProxy] clearing a mbtiles cache in production

dirk.thalheim at bkg.bund.de dirk.thalheim at bkg.bund.de
Fri Jul 24 02:26:41 PDT 2015


Hello list,

I'm using mbtiles as cache. This cache should be cleared automatically when disk space is getting scarce. Is it possible to run the mapproxy-seed util, when the MapProxy service is running?  I'm experiencing some issues doing so. After clearing the cache, MapProxy reports for some requested tiles an error:
2015-07-24 10:34:49,926 - CRITICAL - mapproxy.wsgiapp - fatal error in wmts for /wmts/tile/1.0.0/webatlasde/default/DE_EPSG_25832_ADV/13/2535/4983.png?
Traceback (most recent call last):
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/wsgiapp.py", line 189, in __call__
    resp = self.handlers[handler_name].handle(req)
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/service/base.py", line 30, in handle
    return handler(parsed_req)
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/service/wmts.py", line 92, in tile
    tile = tile_layer.render(request, coverage=limited_to, decorate_img=decorate_img)
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/service/tile.py", line 308, in render
    dimensions=dimensions, with_metadata=True)
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/cache/tile.py", line 106, in load_tile_coord
    created_tiles = creator.create_tiles([tile])
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/cache/tile.py", line 215, in create_tiles
    created_tiles = self._create_single_tiles(tiles)
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/cache/tile.py", line 239, in _create_single_tiles
    created_tiles.extend(self._create_single_tile(tile))
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/cache/tile.py", line 264, in _create_single_tile
    self.cache.store_tile(tile)
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/cache/mbtiles.py", line 299, in store_tile
    return self._get_level(tile.coord[2]).store_tile(tile)
  File "/opt/dev/mapproxy/local/lib/python2.7/site-packages/mapproxy/cache/mbtiles.py", line 147, in store_tile
    cursor.execute(stmt, (level, x, y, content, time.time()))
DatabaseError: database disk image is malformed

When requesting the tile again, it works. When I stop the MapProxy service, clear the cache and starting the service again it seems to work.

Has anyone experienced a similar issue and what could be the reason for that?

Kind regards,

Dirk Thalheim



More information about the MapProxy mailing list