Mongodump: error while loading shared libraries - when running on Heroku

I have a nodejs app running on Heroku and have a cron scheduled task to backup nightly my Mongodb Atlas serverless instance.

The command is mongodump --uri mongodb+srv:/[username]:[password][dbname] --out [dumppath]

It runs fine locally.

But when run on Heroku I am getting the error:

mongodump: error while loading shared libraries: cannot open shared object file: No such file or directory

Does anyone have an idea of what’s going wrong?

Hi @Steven_Manus, the error indicates that mongodump is trying to use OpenSSL but the libraries are not available on Heroku. I suspect you’re using an older version of mongodump since the newer versions do not use OpenSSL. Instead they use Go TLS. What version of mongodump are you using? I recommend using the latest version, which is 100.9.4 at time of writing.

Hi @Tim_Fogarty -

Thanks for the reply. My understanding is that in order to use mongodump on Heroku, I need to add a buildpack. Apparently, the latest Mongodb buildpack for Heroku is siesgstarena/heroku-buildpack-mongo, but when I try to push my app to Heroku after adding this buildpack, I get the following compile error:

The buildpack that does compile installs MongoDB version 4.0.8:

So, I don’t know how to get a newer version of mongodump running on Heroku. Can you propose a solution?

Download from:

Database tools has been separated from the database for a few versions now.

1 Like

Yeah that buildpack is very old. I wouldn’t recommend using it. Chris is right that you should download a newer version. You could use curl to download the tools on heroku. The buildpack shows how you can do this. I think you just need to change the version:

It’s been a while since I’ve used heroku but I think you can deploy docker images now. If that’s an option, it might also be easier to deploy the official MongoDB docker image. That will have up to date tools.


@chris and @Tim_Fogarty -

Thanks for the suggestions. Following your suggestions, I forked siesgstarena’s buildpack and modified it to use the current Linux 86-64 database tools. Worked perfectly!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.