Phillipp

Phillipp

Problems with Elixir (erlang crypto module) on Ubuntu (ARM)

Hey,

I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the Elixir website and installed Elixir 1.6.

pi@NanoPi-M3:~$ elixir -v
Erlang/OTP 20 [erts-9.1.5] [source] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.6.1 (compiled with OTP 19)

Now when I try to install Hex I get:

pi@NanoPi-M3:~$ mix local.hex

18:04:10.362 [error] Unable to load crypto library. Failed with error:
":load_failed, Failed to load NIF library /usr/lib/erlang/lib/crypto-4.1/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.


18:04:10.372 [warn]  The on_load function for module crypto returned:
{:error, {:load_failed, 'Failed to load NIF library /usr/lib/erlang/lib/crypto-4.1/priv/lib/crypto: \'libcrypto.so.1.1: cannot open shared object file: No such file or directory\''}}

** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:eoptions, {:undef, [{:crypto, :supports, [], []}, {:tls_record, :supported_protocol_versions, 1, [file: 'tls_record.erl', line: 407]}, {:tls_record, :supported_protocol_versions, 0, [file: 'tls_record.erl', line: 247]}, {:ssl, :handle_options, 3, [file: 'ssl.erl', line: 709]}, {:ssl, :connect, 4, [file: 'ssl.erl', line: 115]}, {:http_transport, :connect, 4, [file: 'http_transport.erl', line: 109]}, {:httpc_handler, :connect, 4, [file: 'httpc_handler.erl', line: 790]}, {:httpc_handler, :connect_and_send_first_request, 3, [file: 'httpc_handler.erl', line: 802]}]}}}]}

Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.

I then tried to install erlang-crypto but it fails due to missing libssl1.1.0.

pi@NanoPi-M3:~$ sudo apt-get install erlang-crypto
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 erlang-crypto : Depends: libssl1.1 (>= 1.1.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

Then I compiled OpenSSL 1.1.0 from source.

pi@NanoPi-M3:~$ openssl version
OpenSSL 1.1.0f  25 May 2017

But I get the same error when I try to install erlang-crypto.

Now I am at the point where I want to throw the NanoPi-M3 into a corner of my room. It’s really frustrating that it seems to be impossible to get anything working on an ARM based machine.

Most Liked

maz

maz

The issue was that the alpine linux release build was at 3.8, which was at an older version of libssl. The solution was to use alpine linux version 3.9 and apk libssl1.1

dokuzbir

dokuzbir

aptitude is better about unmet dependencies. You can give it a try

sudo apt-get install aptitude
sudo aptitude install erlang-crypto
Phillipp

Phillipp

I used @dokuzbir s solution and it worked. But it seems like it swapped the esl-erlang package with the erlang-* packages. I think I gonna do a clean install with asdf later.

Mazyod

Mazyod

Sure enough, after further investigation, I had updated the executing alpine image to 3.9, but forgot to update the elixir image from 1.7.2 to 1.8.1 :man_facepalming: … As the tutorial suggests, Alpine versions from the Erlang image and executing image must match.

micahrye

micahrye

Have you tried building from source? Here are my notes of building from source in a Begalbone, obviously with ARM chip.

Where Next?

Popular in Questions Top

JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

We're in Beta

About us Mission Statement