tilestache-server seems to fail proxying https tile providers
bong0 opened this issue · comments
I noticed that starting tilestache-server fails, if it's given an https url as tile provider like so:
tilestache2.cfg (failing):
{
"cache": {"name": "Test"},
"layers":
{
"roads":
{
"provider": {
"name": "proxy",
"url": "https://tile.openstreetmap.org/{Z}/{X}/{Y}.png"
}
}
}
}
/usr/lib/python2.7/dist-packages/mapnik2/__init__.py:27: DeprecationWarning: mapnik2 module has been deprecated,
please use 'import mapnik'
warnings.warn(msg, DeprecationWarning)
Traceback (most recent call last):
File "./scripts/tilestache-server.py", line 56, in <module>
app = TileStache.WSGITileServer(config=options.file, autoreload=True)
File "/usr/lib/python2.7/dist-packages/TileStache/__init__.py", line 375, in __init__
raise Core.KnownUnknown("Error loading Tilestache config file:\n%s" % str(e))
TileStache.Core.KnownUnknown: Error loading Tilestache config file:
'NoneType' object has no attribute 'group'
but changing the protocol to "http" -> it works:
./scripts/tilestache-server.py -i 0.0.0.0 -p 8080 -c ~/tilestache2.cfg
/usr/lib/python2.7/dist-packages/mapnik2/__init__.py:27: DeprecationWarning: mapnik2 module has been deprecated,
please use 'import mapnik'
warnings.warn(msg, DeprecationWarning)
* Running on http://0.0.0.0:8080/
Version: latest repo checkout of 19.11.2018 (1ecbb8f)
Python: 2.7.9 (debian 8)
Actually I suspect this to come from modestmaps: https://github.com/stamen/modestmaps-py/search?q=group&unscoped_q=group
Okay, so actually this is due to exactly the following line not featuring https matching in modestmaps-py as of version 1.3.1-1 in debian 8:
match = re.match(r'^(http://\S+?)(,http://\S+)?$', template)
In debian jessie's 1.4.7-1, this seems to be fixed (just looking at the regex)
Quickfix: just install the version from debian 9 on deb 8, it doesn't conflict in dependencies and isn't a complex package either: http://ftp.debian.org/debian/pool/main/m/modestmaps-py/python-modestmaps_1.4.7-1_all.deb