Silent-Wraith01
Getting error: Unable to load crypto library.. OpenSSL might not be installed on this system
dev@dev:\~/discuss$ iex -S mix phx.server
Erlang/OTP 25 \[erts-13.1.5\] \[source\] \[64-bit\] \[smp:16:2\] \[ds:16:2:10\] \[async-threads:1\] \[jit:ns\]
\[error\] Unable to load crypto library. Failed with error:
“:load_failed, Failed to load NIF library /home/dev/.asdf/installs/erlang/25.2.3/lib/crypto-5.1.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.
\[warning\] The on_load function for module crypto returned:
{:error,
{:load_failed,
‘Failed to load NIF library /home/dev/.asdf/installs/erlang/25.2.3/lib/crypto-5.1.2/priv/lib/crypto: 'libcrypto.so.1.1: cannot open shared object file: No such file or directory'’}}
\[notice\] Application plug exited: Plug.Application.start(:normal, [ ]) returned an error: shutdown: failed to start child: Plug.Upload
\*\* (EXIT) an exception was raised:
\*\* (UndefinedFunctionError) function :crypto.strong_rand_bytes/1 is undefined (module :crypto is not available)
(crypto 5.1.2) :crypto.strong_rand_bytes(3)
(plug 1.16.1) lib/plug/upload.ex:210: Plug.Upload.init/1
(stdlib 4.2) gen_server.erl:851: :gen_server.init_it/2
(stdlib 4.2) gen_server.erl:814: :gen_server.init_it/6
(stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
\[notice\] Application telemetry exited: :stopped
\[notice\] Application plug_crypto exited: :stopped
\[notice\] Application mime exited: :stopped
\[notice\] Application eex exited: :stopped
\[notice\] Application runtime_tools exited: :stopped
\*\* (Mix) Could not start application plug: Plug.Application.start(:normal, [ ]) returned an error: shutdown: failed to start child: Plug.Upload
\*\* (EXIT) an exception was raised:
\*\* (UndefinedFunctionError) function :crypto.strong_rand_bytes/1 is undefined (module :crypto is not available)
(crypto 5.1.2) :crypto.strong_rand_bytes(3)
(plug 1.16.1) lib/plug/upload.ex:210: Plug.Upload.init/1
(stdlib 4.2) gen_server.erl:851: :gen_server.init_it/2
(stdlib 4.2) gen_server.erl:814: :gen_server.init_it/6
(stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
dev@dev:\~/discuss$
Most Liked
NobbZ
Wait, I have read the original error again. It is asking for version 1.1 of the library. That has been deprecated many years ago and hasn’t been shipped in Ubuntu since 22.04.
I also have realized, that you are using OTP 25.2. The prebuilt versions might indeed still link to that old version. If you are lucky a very recent 25.3.2.21 might link the correct libcrypto by default, as it is a quite recent release.
If not you might have to force a sourcebuild or try even OTP 26 or newer.
I haven’t used ASDF in ages, so I do not remember how to enforce an erlang build from source.
NobbZ
With “your Linux Distributions manual” I meant whatever ressources you can find through the Internet.
Though for Ubuntu its very likey apt install openssl, maybe openssl-dev
NobbZ
You have to install libcrypto, usually part of OpenSSL.
Details on how to do that should be described in your Linux Distributions manual.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









