Issue with mix release and deploy

Hello!

I am very new to Elixir and started a Phoenix project and in the process of learning to deploy. I setup a dummy build server and dummy dev server with the same specs on EC2 (Ubuntu 18.04, Erlang 22 ) and used mix release to generate an executable. I then used tarred it up and used scp to upload it to the dev server. After untarring the file, I attempted to run the executable and ran into the following error.

deploy@ip-172-30-0-172:/releases/hercules_umbrella$ bin/hercules_umbrella start
2019-11-13 20:26:01.624321
args: [load_failed,“Failed to load NIF library /releases/hercules_umbrella/lib/crypto-4.4.2/priv/lib/crypto: ‘libcrypto.so.1.1: cannot open shared object file: No such file or directory’”,“OpenSSL might not be installed on this system.\n”]
format: “Unable to load crypto library. Failed with error:~n”~p, ~s"~n~s"
label: {error_logger,error_msg}

Does anyone have an idea of what I did wrong or what I should I do instead?

1 Like

Hello and welcome,

Your error message seems to indicate You are missing OpenSSL. How did You install Erlang?

Prior to this, I usually add some packages.

$ sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop

# For asdf, I add also...

$ sudo apt-get install libreadline-dev libyaml-dev libxslt-dev libffi-dev

You might start by installing only libssl-dev and libssh-dev, and see if this works.

I just tried that and still got the same error. I installed Erlang and Elixir via asdf.

Did You install recommended packages, as mentionned on asdf erlang page?

This has to be done before installing Erlang
 if not, You will need to reinstall Erlang.

2 Likes

you may want to try building openssl 1.1.1 from source. I recall having some problems with releases as a result on some distros (it might have been CentOS, though https://www.openssl.org/source/)

Can you make sure that you have libcrypto.so.1.1 in /usr/lib/x86_64-linux-gnu/