tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.12k stars 528 forks source link

Tile is not defined... in tilemill export #2559

Closed emacgillavry closed 5 years ago

emacgillavry commented 8 years ago

Running the export command, the process died unexpectedly. Running Ubuntu 14.04 with fresh clone of TileMill. Postgres is running on the same server.

[0s] Part(1/1) 17.1053%Export process died: ReferenceError: tile is not defined at Scanline. (/usr/local/src/tilemill/commands/export.bones:519:43) at Scanline.EventEmitter.emit (events.js:95:17) at /usr/local/src/tilemill/node_modules/tilelive/lib/stream-scanline.js:105:24 at /usr/local/src/tilemill/node_modules/tilelive/lib/stream-util.js:262:22 at Function. (/usr/local/src/tilemill/node_modules/tilelive-mapnik/lib/mapnik_backend.js:330:25) at /usr/local/src/tilemill/node_modules/tilelive-mapnik/lib/lockingcache.js:72:26 at Array.forEach (native) at LockingCache. (/usr/local/src/tilemill/node_modules/tilelive-mapnik/lib/lockingcache.js:71:23) at process._tickDomainCallback (node.js:463:13) Exiting process [tm-buildings.mbtiles]

emacgillavry commented 8 years ago

Upping the connect_timeout parameter in the MML file seems to address the problem.

emacgillavry commented 8 years ago

Hitting same wall again. Zoom level 8 or 9 (one at a time) for just NL works, but supplying 8 through to 18 fails. Now setting concurrency to 1?

emacgillavry commented 8 years ago

concurrency=1 and scheme=pyramid seems to work nicely. Now leaving out concurrency again, while maintaining scheme=pyramid.

F3L1X79 commented 6 years ago

The bug is due to this line 518 in /commands/export.bones:

function writeTiles() {
     get.on('error', function(errtile) {
    console.warn('\r\033[K' + tile.toString() + ': ' + err.message);
    fs.write(fd, JSON.stringify(tile) + '\n');
    //report(task.stats.snapshot());
    });

A coma is missing between err and tile... The good code should be:

function writeTiles() {
     get.on('error', function(err, tile) {
    console.warn('\r\033[K' + tile.toString() + ': ' + err.message);
    fs.write(fd, JSON.stringify(tile) + '\n');
    //report(task.stats.snapshot());
    });

** EDIT: it's still crashing because tile is not defined. ** Final code simply is:

function writeTiles() {
     get.on('error', function(err) {
    console.warn('\r\033[K' + ': ' + err.message);
    //fs.write(fd, JSON.stringify(tile) + '\n');
    //report(task.stats.snapshot());
    });

so you can now log your errors...

Mine was due to: Postgis Plugin: ERROR: invalid input syntax for type double precision: "1,7" which I don't know how to resolve...

azizul-bkash commented 6 years ago

I am facing the same issue currently. Did anyone solved this?

F3L1X79 commented 6 years ago

@azizul-bkash Didn't my answer help?

azizul-bkash commented 6 years ago

How can I see my logs?

azizul-bkash commented 6 years ago

Sorry, I meant, How can I see my logs?

F3L1X79 commented 6 years ago

You launch the command with --verbose=on

After editing the function in /commands/export.bones line 518 of your tilemill install folder like this:

function writeTiles() {
     get.on('error', function(err) {
    console.warn('\r\033[K' + ': ' + err.message);
    //fs.write(fd, JSON.stringify(tile) + '\n');
    //report(task.stats.snapshot());
    });
azizul-bkash commented 6 years ago

After performing your instruction......the export running but it returns few error messages

: Postgis Plugin: FATAL:  remaining connection slots are reserved for non-replication superuser connections
Connection string: 'host=localhost port=5432 dbname=osm user=admin connect_timeout=4'
F3L1X79 commented 6 years ago

So it's not a TileMill issue. I'm too bad at Postgis, so I can't help you on this.

csytsma commented 5 years ago

Appears to have been fixed in TileOven, prior to merge back into TileMill.