mapbox / mapbox-studio-classic

https://www.mapbox.com/mapbox-studio/
BSD 3-Clause "New" or "Revised" License
1.14k stars 229 forks source link

Crash on OS X 10.10.3, when exporting .mbtiles file #1311

Closed jaketangosierra closed 9 years ago

jaketangosierra commented 9 years ago

Hi,

When I try to export an MBTiles file from Mapbox Studio 0.2.7 on OS X 10.10.3, the entire application crashes. I'm trying to use a PostGIS source with a custom query (which joins a parent table with 2 children tables). If needed, I can send a copy of this somehow, but it's relatively big (the child tables are OSM data for MN, and the parent table subsets them for our application's purposes).

My ~/.mapbox_studio/app.log says

<Tue, 14 Apr 2015 21:25:11 GMT> Mapbox Studio @ http://localhost:3000/ <Tue, 14 Apr 2015 21:25:18 GMT> Mapbox Studio @ http://localhost:3002/ <Tue, 14 Apr 2015 21:27:19 GMT> Mapbox Studio @ http://localhost:3000/ <Tue, 14 Apr 2015 21:31:25 GMT> Mapbox Studio @ http://localhost:3000/

and my ~/.mapbox_studio/shell.log says

<Tue, 14 Apr 2015 21:25:18 GMT> Mapbox Studio @ http://localhost:3002/ <Tue, 14 Apr 2015 21:26:31 GMT> Mapbox Studio exited with 8. <Tue, 14 Apr 2015 21:27:19 GMT> Mapbox Studio @ http://localhost:3000/ <Tue, 14 Apr 2015 21:27:34 GMT> Mapbox Studio exited with 8. <Tue, 14 Apr 2015 21:31:25 GMT> Mapbox Studio @ http://localhost:3000/

The reason these are clean is because I've already tried removing ~/.mapbox_studio once, which didn't fix the problem.

My end goal here is exporting an MBTiles file for self-hosting of vector tiles.

springmeyer commented 9 years ago

This is probably the "failing extent" calculation bug (#966). I would recommend installing mapbox studio from source using latest github because we've recently fixed this. Would you be up for trying that route? (https://github.com/mapbox/mapbox-studio#install-from-source)

jaketangosierra commented 9 years ago

Sure, I'd be happy to do that, and I'll report back.

Thanks!

On Tuesday, April 14, 2015, Dane Springmeyer notifications@github.com wrote:

This is probably the "failing extent" calculation bug (#966 https://github.com/mapbox/mapbox-studio/pull/966). I would recommend installing mapbox studio from source using latest github because we've recently fixed this. Would you be up for trying that route? ( https://github.com/mapbox/mapbox-studio#install-from-source)

— Reply to this email directly or view it on GitHub https://github.com/mapbox/mapbox-studio/issues/1311#issuecomment-93075740 .[image: Web Bug from https://github.com/notifications/beacon/AF1YvB3_XukmVG2q0Gb9seJd7dk-2Fr8ks5n_YFvgaJpZM4EAmib.gif]

jaketangosierra commented 9 years ago

After following the instructions you linked, and going to load the source that I had last time, map box crashed, and this is log output:

mapbox-studio@0.2.7 start /Users/theba004/development/mapbox-studio ./index.js

<Tue, 14 Apr 2015 22:03:40 GMT> Mapbox Studio @ http://localhost:3000/ _http_client.js:75 throw new Error('Protocol "' + protocol + '" not supported. ' + ^ Error: Protocol "https:" not supported. Expected "http:". at new ClientRequest (_http_client.js:75:11) at Object.exports.request (http.js:49:10) at Object.exports.request (https.js:136:15) at Get.request (/Users/theba004/development/mapbox-studio/node_modules/tilejson/node_modules/get/lib/index.js:92:22) at Get.perform (/Users/theba004/development/mapbox-studio/node_modules/tilejson/node_modules/get/lib/index.js:132:30) at Get.asBuffer (/Users/theba004/development/mapbox-studio/node_modules/tilejson/node_modules/get/lib/index.js:298:10) at CachingSource.TileJSON.get (/Users/theba004/development/mapbox-studio/node_modules/tilejson/lib/tilejson.js:211:19) at CachingSource.TileJSON.getTile (/Users/theba004/development/mapbox-studio/node_modules/tilejson/lib/tilejson.js:142:10) at /Users/theba004/development/mapbox-studio/lib/cache.js:58:38 at Statement. (/Users/theba004/development/mapbox-studio/node_modules/mbtiles/lib/mbtiles.js:150:20)

npm ERR! Darwin 14.3.0 npm ERR! argv "node" "/usr/local/bin/npm" "start" npm ERR! node v0.12.0 npm ERR! npm v2.7.1 npm ERR! code ELIFECYCLE npm ERR! mapbox-studio@0.2.7 start: ./index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the mapbox-studio@0.2.7 start script './index.js'. npm ERR! This is most likely a problem with the mapbox-studio package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ./index.js npm ERR! You can get their info via: npm ERR! npm owner ls mapbox-studio npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/theba004/development/mapbox-studio/npm-debug.log

and the nom-debug.log says:

0 info it worked if it ends with ok 1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ] 2 info using npm@2.7.1 3 info using node@v0.12.0 4 verbose node symlink /usr/local/bin/node 5 verbose run-script [ 'prestart', 'start', 'poststart' ] 6 info prestart mapbox-studio@0.2.7 7 info start mapbox-studio@0.2.7 8 verbose unsafe-perm in lifecycle true 9 info mapbox-studio@0.2.7 Failed to exec start script 10 verbose stack Error: mapbox-studio@0.2.7 start: ./index.js 10 verbose stack Exit status 1 10 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16) 10 verbose stack at EventEmitter.emit (events.js:110:17) 10 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:14:12) 10 verbose stack at ChildProcess.emit (events.js:110:17) 10 verbose stack at maybeClose (child_process.js:1008:16) 10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5) 11 verbose pkgid mapbox-studio@0.2.7 12 verbose cwd /Users/theba004/development/mapbox-studio 13 error Darwin 14.3.0 14 error argv "node" "/usr/local/bin/npm" "start" 15 error node v0.12.0 16 error npm v2.7.1 17 error code ELIFECYCLE 18 error mapbox-studio@0.2.7 start: ./index.js 18 error Exit status 1 19 error Failed at the mapbox-studio@0.2.7 start script './index.js'. 19 error This is most likely a problem with the mapbox-studio package, 19 error not with npm itself. 19 error Tell the author that this fails on your system: 19 error ./index.js 19 error You can get their info via: 19 error npm owner ls mapbox-studio 19 error There is likely additional logging output above. 20 verbose exit [ 1, true ]

I'm trying to install node 0.10 and try this again, just to ensure that it's not a versioning issue

springmeyer commented 9 years ago

right, node v0.12.0 is not supported yet, please stick to 0.10 until #1209 is closed.

jaketangosierra commented 9 years ago

The proper node version worked, now I'm running into a postGIS error, but that looks like it's a config thing on my end. Will there be a new build in the near future?

springmeyer commented 9 years ago

please share your postgis error - it might be solvable via https://github.com/mapbox/mapbox-studio/compare/postgis-srid. Yes, a new release is coming, but more PostGIS testing is one thing that needs to happen first so any details you can provide would be great.

jaketangosierra commented 9 years ago

Could not load layer "gun-carry" in datasource '"': "Error: Postgis Plugin: PostGIS: unable to query the layer extent of table 'location' because we cannot determine the geometry field name. Please provide either an 'extent' parameter to skip this query, a 'geometry_field' and/or 'geometry_table' parameter, or add a record to the 'geometry_columns' for your table."

using the query

((select location.id, allowed, geom from location, nodes where location_type like 'osm_node' and osm_id=nodes.id) union all (select location.id, allowed, linestring as geom from location, ways where location_type like 'osm_way' and osm_id=ways.id)) as data

After re-arranging the order of the tables in the join, I got a different error about not being able to find geometry 'linestring'. All this together looks like a union in the way I was trying to do it doesn't fit into what mapbox studio is expecting

After messing around with the query a little bit, I'm going to use different sources for each join I need to do.