bensheldon / mapnik-on-heroku

Holy crap, it's Mapnik on heroku!
mapnik-on-heroku.herokuapp.com
6 stars 1 forks source link

Symbol lookup error #2

Open gadybadger opened 11 years ago

gadybadger commented 11 years ago

So I cloned your repo, pushed it to a shiny new Heroku app, set the LD_LIBRARY_PATH config var, and when I run the app I get an application error and heroku logs tell me why:

node: symbol lookup error: /app/node_modules/mapnik/lib/_mapnik.node: undefined symbol: _ZN2v814ObjectTemplate11SetAccessorENS_6HandleINS_6StringEEEPFNS1_INS_5ValueEEENS_5LocalIS2_EERKNS_12AccessorInfoEEPFvS7_NS6_IS4_EESA_ES5_NS_13AccessControlENS_17PropertyAttributeE

Any idea why this is happening? Am I missing a step somewhere?

springmeyer commented 11 years ago

This is because you are using a different node version that the binary was compiled with. I can't recall what version I originally build the binary against - likely v0.6. What version of node are you targeting?

gadybadger commented 11 years ago

Thanks for getting back to me on this. I didn't change anything from the original clone, and package.json specifies "engines": { "node": "0.6.x" }. And when I try to push that to Heroku, I get the following:

-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.6.20
       Using npm version: 1.2.15
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       npm ERR! cb() never called!
       npm ERR! not ok code undefined
       npm ERR! cb() never called!
       npm ERR! not ok code 1
 !     Failed to install --production dependencies with npm
 !     Heroku push rejected, failed to compile Node.js app

To git@heroku.com:mapnik-tester.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:mapnik-tester.git'

After doing some research, I found out that this problem is fixed if you use Node version 0.8.x, so I changed to that version of the engine, push that to Heroku, and that's when I get the symbol lookup error (which you pointed out is due to the difference in versions of Node and the compiled binary). So basically the barrier to using this out-of-the-box is the above error when using 0.6.x. Please let me know if I can give you more info to troubleshoot, I would love to get this up and running.

springmeyer commented 11 years ago

Okay. If I were you I would try to find another workaround for that odd npm ERR! cb() never called! error that can allow you to avoid upgrading to node v0.8. If that is not possible, then I would take a look at targeting node v0.10.0. I plan to update the heroku binary but since node v0.10 is out I would prefer to do a build for that version.

gadybadger commented 11 years ago

Cool, I'll see what I can come up with for the odd error and post results here.

On Mon, Apr 1, 2013 at 6:23 PM, Dane Springmeyer notifications@github.comwrote:

Okay. If I were you I would try to find another workaround for that odd npm ERR! cb() never called! error that can allow you to avoid upgrading to node v0.8. If that is not possible, then I would take a look at targeting node v0.10.0. I plan to update the heroku binary but since node v0.10 is out I would prefer to do a build for that version.

— Reply to this email directly or view it on GitHubhttps://github.com/bensheldon/mapnik-on-heroku/issues/2#issuecomment-15748198 .

gadybadger commented 11 years ago

So unfortunately I haven't found any other workarounds. Targeting node v0.10.0 seems to be the way to go...

springmeyer commented 11 years ago

Okay, node v0.10.0 is very close - just some build tweaking to be done. Then the task is to provide precompiled binaries of libmapnik to build against, which is on my list. Let's track at https://github.com/mapnik/mapnik-packaging/issues/73.

gadybadger commented 11 years ago

Sounds good, let me know if I can help test.

gadybadger commented 6 years ago

Hi @springmeyer and @bensheldon, this is an old thread, but I'm running into the need to run Node & Mapnik on Heroku again. What's considered the best way to do this now?

springmeyer commented 6 years ago

@gadybadger the official node-mapnik release I think will run fine on heroku now. Please try it and create an issue at https://github.com/mapnik/node-mapnik/issues if you have any trouble. Also see https://github.com/mapnik/node-mapnik/issues/863 for details on running on lambda.

gadybadger commented 6 years ago

@springmeyer, yep, it works like a charm on Heroku with the following:

  1. The following buildpacks:

    https://github.com/heroku/heroku-buildpack-apt
    https://github.com/heroku/heroku-buildpack-pgbouncer
    heroku/nodejs

    (pgbouncer so I can use Heroku's config vars to access the database connection info in the Node app)

  2. An Aptfile containing the following:

    libc6
    libgcc1
    libstdc++6
    http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.8/gcc-4.8_4.8.4-2ubuntu1~14.04.3_amd64.deb
    http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.8/libstdc%2B%2B6_4.8.4-2ubuntu1~14.04.3_amd64.deb
  3. A Procfile with web: bin/start-pgbouncer-stunnel node app.js.

  4. package.json with the following:

    {
    ...  
    "dependencies": {
    "express": "2.5.x",
    "mapnik": "3.5.x"
    },
    "engines": {
    "node": "0.10.x",
    "npm": "2.11.2"
    }
    }

Running on Lambda looks awesome, I will try that out.

springmeyer commented 6 years ago

@gadybadger could you try with node-mapnik 3.7.1? If it works, would be great to get these setup instructions into the node-mapnik wiki/docs.

gadybadger commented 6 years ago

@springmeyer, node-mapnik v3.7.1 works fine as well. I'm happy to add to the wiki, just let me know where to put it.

bensheldon commented 6 years ago

@springmeyer Thank you for helping track this down.