This repository was archived by the owner on Dec 2, 2026. It is now read-only.
Crash on Heroku: GLIBCXX_3.4.20 not found #845
Copy link
Copy link
Closed
Description
2015-12-29T05:37:03.055410+00:00 app[worker.1]: /app/node_modules/nodegit/lib/nodegit.js:13
2015-12-29T05:37:03.055414+00:00 app[worker.1]: throw ex;
2015-12-29T05:37:03.055416+00:00 app[worker.1]: ^
2015-12-29T05:37:03.055416+00:00 app[worker.1]:
2015-12-29T05:37:03.055419+00:00 app[worker.1]: Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /app/node_modules/nodegit/build/Release/nodegit.node)
2015-12-29T05:37:03.055420+00:00 app[worker.1]: at Error (native)
2015-12-29T05:37:03.055420+00:00 app[worker.1]: at Object.Module._extensions..node (module.js:450:18)
2015-12-29T05:37:03.055421+00:00 app[worker.1]: at Module.load (module.js:356:32)
2015-12-29T05:37:03.055422+00:00 app[worker.1]: at Function.Module._load (module.js:313:12)
2015-12-29T05:37:03.055422+00:00 app[worker.1]: at Module.require (module.js:366:17)
2015-12-29T05:37:03.055423+00:00 app[worker.1]: at require (module.js:385:17)
2015-12-29T05:37:03.055424+00:00 app[worker.1]: at Object.<anonymous> (/app/node_modules/nodegit/lib/nodegit.js:8:12)
2015-12-29T05:37:03.055425+00:00 app[worker.1]: at Module._compile (module.js:425:26)
2015-12-29T05:37:03.055425+00:00 app[worker.1]: at Object.Module._extensions..js (module.js:432:10)
2015-12-29T05:37:03.055426+00:00 app[worker.1]: at Module.load (module.js:356:32)
Metadata
Metadata
Assignees
Labels
No labels
Activity
johnhaley81 commentedon Dec 29, 2015
You need to update your version of
libstdc++. Try this:erbridge commentedon Dec 29, 2015
Not sure I have that sort of access on Heroku... Is there a prior version that's compatible with
gcc-4.8?johnhaley81 commentedon Dec 29, 2015
You could force it to rebuild against your gcc 4.8 headers. Our CI builds with gcc 4.9 for our coverage tests and those are the binaries that are built and published. If we can find a way around that requirement for the published binaries but NAN 2 has a hard c++11 requirement so you'll have to update to support node 4+.
To force it to build set
BUILD_ONLY=trueerbridge commentedon Dec 29, 2015
Ok, I'll give rebuilding a try. Odd that Heroku is supporting Node 4+ without proper support...
johnhaley81 commentedon Dec 29, 2015
You could also try http://wclark3.github.io/2014/12/20/heroku-gcc.html
erbridge commentedon Jan 3, 2016
Ok, so I solved this using your first suggestion. For future reference, that was achieved using the APT buildpack with the following
Aptfile:Thanks for your help :).
https://github.com/nodegit/nodegit/issues/845#issuecomment-168531320
add apt file to solve gcc problems, see:
neekey commentedon May 30, 2016
@erbridge It works for me. In case other people run into the same problem, I want to leave some more detailed steps to solve it.
First as we know Heroku use what called "Buildpack" to build our source code like install all the dependences, based on the language your application are using, different buildpacks are used. For example for a NodeJS application, Heroku use "heroku/nodejs" by default.
So in this issue case, we are running a NodeJS application but we also want to use kind of a "apt" dependence, which leads to the requirement for multi-buildpack. Fortunately, heroku has already support for it
Basically what you need to do is add another buildpack and specify some dependences you need.
============== SOLUTION ===============
STEP 1:
Add another buildpack through heroku-cli ( we switch the apt buildpack to the first position so that it can be build before nodejs buildpack )
( you can find the "apt" buildpack here )
STEP 2:
Add a file named
Aptfileand add dependences into it:STEP 3:
commit your change and deploy your app again, hope it works for you : )
maxkorp commentedon Jun 2, 2016
I'll be adding that to the docs!
carpeliam commentedon Jun 6, 2016
I'm running into the same issue (at least, I think so) on Cloud Foundry. I'm running node v6.1.0. I'm not sure if any of the above solutions can apply to me as I'm not actually on Heroku, but I can look into it.
Reading into @johnhaley81's comment from several months ago, it seems as though it's the CI build that depends on 4.9, but not the library itself? Can you guys speak more to that? I don't suppose you could be convinced to run separate builds...
update I tried the suggestion of setting
BUILD_ONLY=true, which seemed to take effect ([nodegit] BUILD_ONLY is set to true, no fetching allowed.), but didn't seem to create a successful build: the logs [gist here] only seemed to sayError: Cannot find module '../build/Debug/nodegit.node'.🔮 Fix Heroku nodegit build issue
georgeedwards commentedon Sep 3, 2016
The steps above that @neekey wrote out throw the following warning from the Heroku build dialogue.
It seems that the project has been replaced by Convox? Is it worth updating these steps / docs to reflect this?
jrjohnson commentedon Mar 8, 2017
Heroku has an official apt build back now:
Just replace the @neekey's with:
oagix commentedon Mar 17, 2018
This is now a broken link:
http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/gcc-4.9_4.9.2-10ubuntu13_amd64.deb