kosmtik icon indicating copy to clipboard operation
kosmtik copied to clipboard

Cannot call method 'drain' of undefined

Open pnorman opened this issue 10 years ago • 8 comments

Version 4c6fa1c on Ubuntu 14.04

[Core] File roads.mss changed on disk
[Core] File roads.mss changed on disk
[Core] File roads.mss changed on disk
[Core] File roads.mss changed on disk
[Core] File roads.mss changed on disk
[httpserver] /repo/poll/ 200
[Core] Loading project from /home/pnorman/osm/openstreetmap-carto/repo/project.yaml
[Core] Loading project from /home/pnorman/osm/openstreetmap-carto/repo/project.yaml
[Core] Loading project from /home/pnorman/osm/openstreetmap-carto/repo/project.yaml
[Core] Loading project from /home/pnorman/osm/openstreetmap-carto/repo/project.yaml
[Core] Loading project from /home/pnorman/osm/openstreetmap-carto/repo/project.yaml
[Local Config] Patched config from /home/pnorman/osm/openstreetmap-carto/repo/localconfig.json

/home/pnorman/osm/kosmtik-3/src/back/ProjectServer.js:270
        self.mapPool.drain(function() {
                     ^
TypeError: Cannot call method 'drain' of undefined
    at Array.0 (/home/pnorman/osm/kosmtik-3/src/back/ProjectServer.js:270:22)
    at null.<anonymous> (/home/pnorman/osm/kosmtik-3/src/back/StateBase.js:27:43)
    at null.<anonymous> (/home/pnorman/osm/kosmtik-3/src/back/StateBase.js:37:13)
    at DataSourceLoader.patchMML (/home/pnorman/osm/kosmtik-3/src/plugins/datasource-loader/index.js:36:15)
    at null.<anonymous> (/home/pnorman/osm/kosmtik-3/src/back/StateBase.js:35:74)
    at done (/home/pnorman/osm/kosmtik-3/src/plugins/local-config/index.js:14:23)
    at /home/pnorman/osm/kosmtik-3/src/plugins/local-config/index.js:52:13
    at /home/pnorman/osm/kosmtik-3/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:76:16
    at fs.js:268:14
    at /home/pnorman/osm/kosmtik-3/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:42:10

pnorman avatar Feb 17 '16 07:02 pnorman

Which NodeJS version? Any project?

yohanboniface avatar Feb 17 '16 08:02 yohanboniface

osm-carto, nodejs v0.10.25 (Ubuntu 14.04 LTS)

pnorman avatar Feb 17 '16 08:02 pnorman

Do you have the error with all projects or only this one? Are you still on mapnik 3.4.7?

yohanboniface avatar Feb 17 '16 09:02 yohanboniface

Do you have the error with all projects or only this one?

It's intermittent, so hard to say.

Are you still on mapnik 3.4.7?

Yes

pnorman avatar Feb 17 '16 17:02 pnorman

I've been seeing this error when a project file fails to load due to invalid yaml, then i change the file to make it valid, and it auto-reloads again.

JesseCrocker avatar Mar 30 '16 20:03 JesseCrocker

I've been seeing this error when a project file fails to load due to invalid yaml, then i change the file to make it valid, and it auto-reloads again.

If Kosmtik reloads the project file while it's being saved, it might get an invalid YAML file. If you truncate the file at a random place you'll normally get valid YAML, but there are some quoted strings that might result in something invalid.

pnorman avatar Mar 30 '16 20:03 pnorman

Doesn't look like it's related to YAML. I got this when I had invalid MSS, fixed it, then hit reload on the web interface. Autoreload was off.

pnorman avatar Sep 14 '16 00:09 pnorman

I've been seeing this error when a project file fails to load due to invalid yaml, then i change the file to make it valid, and it auto-reloads again.

This happens with both MSS and YAML. The general sequence is to have a syntax error (e.g. missing }), start Kosmtik, then fix the error. When it auto-reloads it encounters this.

pnorman avatar Jan 29 '17 08:01 pnorman