kosmtik / kosmtik

Make maps with OpenStreetMap and Mapnik
Other
714 stars 83 forks source link

Cannot call method 'zoomToBox' of null #48

Open pnorman opened 9 years ago

pnorman commented 9 years ago

when doing a git pull

[Core] Loading project from /home/pnorman/osm/openstreetmap-carto/repo/project.yaml
[Core] Generating Mapnik XML…
[Core] Using mapnik version 2.2.0
[Core] Loading map…
[Core] Map ready
[Core] Loading map…
[Core] Map ready
[httpserver] /repo/reload/ 200
[httpserver] /repo/poll/ 200
file could not be found: '/home/pnorman/osm/openstreetmap-carto/repo/symbols/picnic.p.16.png' in style 'amenity-points-poly' in PointSymbolizer at line 14543
[httpserver] /repo/tile/17/70544/43861.xray?t=1425253156811&layer=landuse-overlay&background= 500

/usr/home/pnorman/osm/kosmtik/src/back/Tile.js:39
    map.zoomToBox(this.projection.forward([this.minX, this.minY, this.maxX, th
        ^
TypeError: Cannot call method 'zoomToBox' of null
    at Tile.renderToVector (/usr/home/pnorman/osm/kosmtik/src/back/Tile.js:39:9)
    at /usr/home/pnorman/osm/kosmtik/src/back/ProjectServer.js:124:21
    at dispense (/usr/home/pnorman/osm/kosmtik/node_modules/generic-pool/lib/generic-pool.js:250:16)
    at Object.me.release (/usr/home/pnorman/osm/kosmtik/node_modules/generic-pool/lib/generic-pool.js:349:5)
    at release (/usr/home/pnorman/osm/kosmtik/src/back/ProjectServer.js:120:55)
    at ProjectServer.raise (/usr/home/pnorman/osm/kosmtik/src/back/ProjectServer.js:218:13)
    at /usr/home/pnorman/osm/kosmtik/src/back/ProjectServer.js:121:30
    at /usr/home/pnorman/osm/kosmtik/node_modules/generic-pool/lib/generic-pool.js:274:11
    at loaded (/usr/home/pnorman/osm/kosmtik/src/back/MapPool.js:24:37)
Segmentation fault (core dumped)
yohanboniface commented 9 years ago

Very bad :(

Is it every time you load a project? Every project?

pnorman commented 9 years ago

Not every time I load a project - I'm not sure if I did a git pull since then, but I think so, so it's not even every time I git pull

yohanboniface commented 9 years ago

humm, I'm not sure how git pull is linked to the issue, can you provide steps to reproduce?

pnorman commented 9 years ago

My guess is git pull changed a bunch of files on Kosmtik. Looking at the error it either removed an image file before the rest of the changes or something similar. I'll see if I can reproduce.

yohanboniface commented 9 years ago

Oh, now I understand why you talk about git pull. It's on the Carto project, not on the kosmtik project, that you run it, right?

I'll see how I can prevent that the project is autoreloaded when more than once file is changed in a very short time. For your information, you can set autoReload: false in your kosmtik.yml to deactivate autoreload, so you can reload clicking on the reload button (which will be orange when the map has changed), for example:

screenshot from 2015-03-11 22 10 31

I'm running with this myself.

(It doesn't fix the initial issue, but that's a workaround that may interest you. Myself I prefer not to have autoreload.)

pnorman commented 9 years ago

Oh, now I understand why you talk about git pull. It's on the Carto project, not on the kosmtik project, that you run it, right?

Yes.

I turn off autoreload sometimes, but across so many machines it's not always off.