[MapProxy] Missing some tiles when generating from mapnik

Matt Walker walkermatt at longwayaround.org.uk
Fri Jan 31 23:47:22 PST 2014


Hi Matthew

This will not help to resolve any underlying issues but as you are using
OpenLayers you could try setting
http://dev.openlayers.org/docs/files/OpenLayers/Util-js.html#Util.IMAGE_RELOAD_ATTEMPTS
.

Cheers,

Matt.
On 31 Jan 2014 14:45, "Matthew Ma" <matthewma.tf at gmail.com> wrote:

> Dear MapProxy mail list subscribers,
>
>
>
> I have been using MapProxy with Mapnik as source to serve and generate map
> tiles.
>
> I am in a situation that every now and then, my OpenLayers frontend fails
> to load one or two tiles if the tile needs to be generated by Mapnik on the
> fly, resulting a blank square on my map. But a simple zooming in and out
> could make the missing tile to show correct. It makes me feel the tile has
> been generated, but just didn't get sent to client.
>
> I have been trying for a while but failed to resolve. I would like to ask
> your opinion on this problem.
>
>
>
> *Environment:*
>
> Windows 7 x64
>
> Python 2.7.6
>
> MapProxy 1.6 and 1.5
>
> Mapnik 2.2
>
> Running MapProxy in "mapproxy-util serve-develop" or using IIS with
> isapi-wsgi.
>
> OpenLayers in the MapProxy Demo page or new release of OpenLayers
>
> Server and Client both on localhost
>
> And my MapProxy yaml config:
>
>
>
> services:
>
>   demo:
>
>   kml:
>
>   tms:
>
>   wmts:
>
>   wms:
>
>     md:
>
>       title: MapProxy WMS Proxy
>
>       abstract: This is the fantastic MapProxy.
>
>       online_resource: http://mapproxy.org/
>
>       contact:
>
>         person: Your Name Here
>
>       access_constraints:
>
>         The data is licensed as Creative Commons Attribution-Share Alike
> 2.0
>
>         (http://creativecommons.org/licenses/by-sa/2.0/)
>
>       fees: 'None'
>
>
>
> layers:
>
>   - name: osm
>
>     title: Omniscale OSM WMS - osm.omniscale.net
>
>     sources: [osm_cache]
>
>   - name: mymap
>
>     title: mymapCounty
>
>     sources: [ac_cache]
>
>
>
> caches:
>
>   osm_cache:
>
>     grids: [GLOBAL_MERCATOR, global_geodetic_sqrt2]
>
>     sources: [osm_wms]
>
>   ac_cache:
>
>     grids: [GLOBAL_MERCATOR, global_geodetic_sqrt2]
>
>     sources: [mymap]
>
>     cache:
>
>       type: mbtiles
>
>       filename: C:\tileserver\deployment\cache\map.mbtiles
>
>   # or use the sqlite format
>
>   # ac_cache:
>
>   #   grids: [GLOBAL_MERCATOR, global_geodetic_sqrt2]
>
>   #   sources: [mymap]
>
>   #   cache:
>
>   #     type: sqlite
>
>
>
>
>
> sources:
>
>   osm_wms:
>
>     type: wms
>
>     req:
>
>       url: http://osm.omniscale.net/proxy/service?
>
>       layers: osm
>
>   mymap:
>
>     type: mapnik
>
>     mapfile: C:\tileserver\deployment\config\mapnik.xml
>
>     layers: street,rail,water,county
>
>     use_mapnik2: false
>
>
>
>
>
>
>
> grids:
>
>   global_geodetic_sqrt2:
>
>     base: GLOBAL_GEODETIC
>
>     res_factor: 'sqrt2'
>
>
>
> globals:
>
>   cache:
>
>     base_dir: './cache_data'
>
>     lock_dir: './cache_data/locks'
>
>   image:
>
>       resampling_method: nearest
>
>
>
>
>
> *Console Exceptions:*
>
>
>
> I have noticed there are three kind of runtime exception, I think at least
> one of them is related to my problem because when I see these exceptions I
> will get at least one blank tile.
>
>
>
> 1,
>
> Traceback (most recent call last):
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\wsgiapp.py", line 166, in __call__
>
>     resp = self.handlers[handler_name].handle(req)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\service\base.py", line 30, in handle
>
>     return handler(parsed_req)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\service\tile.py", line 81, in map
>
>     tile = layer.render(tile_request,
> use_profiles=tile_request.use_profiles, c
>
> verage=limit_to, decorate_img=decorate_img)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\service\tile.py", line 307, in render
>
>     dimensions=dimensions, with_metadata=True)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\cache\tile.py", line 106, in load_tile_coord
>
>     created_tiles = creator.create_tiles([tile])
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\cache\tile.py", line 229, in create_tiles
>
>     created_tiles = self._create_meta_tiles(meta_tiles)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\cache\tile.py", line 302, in _create_meta_tiles
>
>     created_tiles.extend(self._create_meta_tile(meta_tile))
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\cache\tile.py", line 310, in _create_meta_tile
>
>     with self.tile_mgr.lock(main_tile):
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\platform\cpython\lock.py", line 42, in __enter__
>
>     self.lock()
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\platform\cpython\lock.py", line 65, in lock
>
>     self._lock = self._try_lock()
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\platform\cpython\lock.py", line 56, in _try_lock
>
>     return LockFile(self.lock_file)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\map
>
> roxy\util\ext\lockfile.py", line 118, in __init__
>
>     fp = open(path, 'w+')
>
> IOError: [Errno 22] invalid mode ('w+') or filename:
> 'c:\\tileserver\\deploym
>
>
> nt\\config\\./cache_data\\tile_locks\\b2b87fa9f6d83cb9bd5dc2251bce78cc-19332-41
>
> 96-16.lck'
>
>
>
>
>
> 2,
>
> File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\mapproxy\cache\tile.py",
> line 229, in create_tiles
>
>     created_tiles = self._create_meta_tiles(meta_tiles)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\mapproxy\cache\tile.py",
> line 302, in _create_meta_tiles
>
>     created_tiles.extend(self._create_meta_tile(meta_tile))
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\mapproxy\cache\tile.py",
> line 311, in _create_meta_tile
>
>     if not all(self.is_cached(t) for t in meta_tile.tiles if t is not
> None):
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\mapproxy\cache\tile.py",
> line 311, in <genexpr>
>
>     if not all(self.is_cached(t) for t in meta_tile.tiles if t is not
> None):
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\mapproxy\cache\tile.py",
> line 211, in is_cached
>
>     return self.tile_mgr.is_cached(tile)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\mapproxy\cache\tile.py",
> line 154, in is_cached
>
>     cached = self.cache.is_cached(tile)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\mapproxy\cache\mbtiles.py",
> line 138, in is_cached
>
>     return self.load_tile(tile)
>
>   File
> "C:\tileserver\python27\lib\site-packages\mapproxy-1.6.0-py2.7.egg\mapproxy\cache\mbtiles.py",
> line 171, in load_tile
>
>     zoom_level = ?''', tile.coord)
>
> OperationalError: database is locked
>
>
>
>
>
>
>
> 3,
>
> Traceback (most recent call last):
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 86, in run
>
>     self.finish_response()
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 128, in
> finish_response
>
>     self.write(data)
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 217, in write
>
>     self._write(data)
>
>   File "C:\tileserver\python27\Lib\site-packages\isapi_wsgi.py", line 376,
> in_write
>
>     self.ecb.WriteClient(data)
>
> ExtensionError: (1229, 'An operation was attempted on a nonexistent
> network connection.', 'WriteClient')
>
> Traceback (most recent call last):
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 86, in run
>
>     self.finish_response()
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 128, in
> finish_response
>
>     self.write(data)
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 217, in write
>
>     self._write(data)
>
>   File "C:\tileserver\python27\Lib\site-packages\isapi_wsgi.py", line 376,
> in_write
>
>     self.ecb.WriteClient(data)
>
> ExtensionError: (1229, 'An operation was attempted on a nonexistent
> network connection.', 'WriteClient')
>
> Traceback (most recent call last):
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 86, in run
>
>     self.finish_response()
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 128, in
> finish_response
>
>     self.write(data)
>
>   File "C:\tileserver\python27\lib\wsgiref\handlers.py", line 217, in write
>
>     self._write(data)
>
>   File "C:\tileserver\python27\Lib\site-packages\isapi_wsgi.py", line 376,
> in_write
>
>     self.ecb.WriteClient(data)
>
> ExtensionError: (1229, 'An operation was attempted on a nonexistent
> network connection.', 'WriteClient')
>
>
>
> Sincerely,
>
> Matthew
>
>
>
> _______________________________________________
> MapProxy mailing list
> MapProxy at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapproxy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20140201/7a12b0bc/attachment-0001.html>


More information about the MapProxy mailing list