Skip to content
This repository was archived by the owner on Dec 2, 2026. It is now read-only.
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

Closed

Description

@erbridge
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)

Activity

  1. johnhaley81 commented on Dec 29, 2015

    @johnhaley81
    Collaborator

    You need to update your version of libstdc++. Try this:

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt-get update
    sudo apt-get install gcc-4.9
    sudo apt-get upgrade libstdc++6
    
  2. erbridge commented on Dec 29, 2015

    @erbridge
    Author

    Not sure I have that sort of access on Heroku... Is there a prior version that's compatible with gcc-4.8?

  3. johnhaley81 commented on Dec 29, 2015

    @johnhaley81
    Collaborator

    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=true

  4. erbridge commented on Dec 29, 2015

    @erbridge
    Author

    Ok, I'll give rebuilding a try. Odd that Heroku is supporting Node 4+ without proper support...

  5. johnhaley81 commented on Dec 29, 2015

    @johnhaley81
    Collaborator
  6. erbridge commented on Jan 3, 2016

    @erbridge
    Author

    Ok, so I solved this using your first suggestion. For future reference, that was achieved using the APT buildpack with the following Aptfile:

    http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/gcc-4.9_4.9.2-10ubuntu13_amd64.deb
    http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/libstdc%2b%2b6_4.9.2-10ubuntu13_amd64.deb
    

    Thanks for your help :).

  7. neekey commented on May 30, 2016

    @neekey

    @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 )

    $ heroku buildpacks:add --index 1 https://github.com/ddollar/heroku-buildpack-apt.git --app [your-app-name]
    

    ( you can find the "apt" buildpack here )

    STEP 2:

    Add a file named Aptfile and add dependences into it:

    http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/gcc-4.9_4.9.2-10ubuntu13_amd64.deb
    http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/libstdc%2b%2b6_4.9.2-10ubuntu13_amd64.deb
    

    STEP 3:

    commit your change and deploy your app again, hope it works for you : )

  8. maxkorp commented on Jun 2, 2016

    @maxkorp
    Collaborator

    I'll be adding that to the docs!

  9. carpeliam commented on Jun 6, 2016

    @carpeliam

    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... :bowtie:

    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 say Error: Cannot find module '../build/Debug/nodegit.node'.

  10. added a commit that references this issue on Aug 20, 2016
  11. georgeedwards commented on Sep 3, 2016

    @georgeedwards

    The steps above that @neekey wrote out throw the following warning from the Heroku build dialogue.

    remote: -----> Apt app detected
    remote: WARNING: This buildpack is no longer maintained.
    remote:
    remote: Please choose a different buildpack or go to https://github.com/ddollar/heroku-buildpack-apt
    remote: and fork it to your own account.
    remote:
    remote: This buildpack will cease to function at the stroke of midnight on January 1, 2017.
    remote: -----> Updating apt caches
    

    It seems that the project has been replaced by Convox? Is it worth updating these steps / docs to reflect this?

  12. jrjohnson commented on Mar 8, 2017

    @jrjohnson

    Heroku has an official apt build back now:

    Just replace the @neekey's with:

    heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions