2

I have been trying to install erlang16 through kerl. I am getting the following error:

 Uncaught error in rebar_core: {'EXIT',
 {undef,
 [{crypto,start,[],[]},

This has been a issue quite a lot of people had before but none of those solutions worked for me.

I did according to this: Unable to install erlang on cent os but failed

If I do, crypto:start(), it does not return me ok. Can someone help. Thanks

Error message:

  1> crypto:start().
  ** exception error: undefined function crypto:start/0
  2> 
  =ERROR REPORT==== 2-Apr-2016::07:28:13 ===
  Unable to load crypto library. Failed with error:
  "load_failed, Failed to load NIF library: 
 '/usr/local/lib/erlang/lib/crypto-       3.0/priv/lib/crypto.so: undefined  symbol: EC_GROUP_new_curve_GF2m'"
  OpenSSL might not be installed on this system.

  =ERROR REPORT==== 2-Apr-2016::07:28:13 ===
  The on_load function for module crypto returned {error,
                                             {load_failed,
                                              "Failed to load NIF library:  '/usr/local/lib/erlang/lib/crypto-3.0/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'"}}

Doing this is fine:

 Eshell V5.10.2  (abort with ^G)
 1> application:start(crypto).
 ok
Community
  • 1
  • 1
listen
  • 217
  • 2
  • 7
  • Duplicate of http://stackoverflow.com/q/20166216/409228, which unfortunately does not have an accepted answer. – Steve Vinoski Apr 02 '16 at 12:07
  • It's not a duplicate, see the error message in the comment under my answer. – Greg Apr 03 '16 at 00:35
  • Or it could be a duplicate but this question and error is specific to CentOS. The other question contains a different error message. To make it a duplicate you would probably need to add details from this question to the other question. – Greg Apr 03 '16 at 00:42
  • The application may be starting but `crypto` module is an Erlang NIF which doesn't load until you call a function from `crypto`. Try to call for example `crypto:info_lib().` to see if it works. It should show the version of OpenSSL that it's using. – Greg Apr 03 '16 at 08:55

1 Answers1

1

Your Erlang has been built without OpenSSL. Either OpenSSL hasn't been installed or enabled when building Erlang from sources. OpenSSL is required to build the crypto application. See the Erlang installation guide.

And the simplest way of checking if crypto has been built is simply, as you did, by trying to start crypto.

1> application:start(crypto).
ok

Can you try to download a pre-compiled version from Erlang Solutions? Otherwise you will need to find out why kerl isn't picking up OpenSSL (if it's installed). Maybe try to verify configure or compilation logs.

Greg
  • 8,230
  • 5
  • 38
  • 53
  • Does it differ if I install from erlang.org directly(erlang r16b01). – listen Apr 02 '16 at 05:14
  • Of course not, it's only that on erlang.org there is a very limited set of operating systems for which you can download the installer. But if you can find a package for your system it shouldn't matter. Please note that you might need to install OpenSSL separate for it to work. Even if Erlang has been compiled with OpenSSL it stil needs to be installed for the crypto application to work. – Greg Apr 02 '16 at 07:58
  • I did sudo yum install openssl-devel and then installed erlang R16B01 from erlang.org and the problem still persists. application:start(crypto) returns ok but crypto:start() fails. also, first installed openssl and then installed erlang. – listen Apr 02 '16 at 17:17
  • `application:start(crypto).` is the same as `crypto:start().`. See https://github.com/erlang/otp/blob/OTP-18.3/lib/crypto/src/crypto.erl#L203 So it's already working. If not then please post the exact error message. – Greg Apr 02 '16 at 21:42
  • Unable to load crypto library. Failed with error: "load_failed, Failed to load NIF library: '/usr/local/lib/erlang/lib/crypto-3.0/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'" OpenSSL might not be installed on this system. The on_load function for module crypto returned {error, {load_failed, "Failed to load NIF library: '/usr/local/lib/erlang/lib/crypto-3.0/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'"}} ** exception error: undefined function crypto:start/0 – listen Apr 02 '16 at 22:11
  • Sorry about the bad formatting but that is what is returned when I do crypto:start(). If I do application:start(crypto) it returns me ok. – listen Apr 02 '16 at 22:13
  • Please add the error message to the question so that it isn't closed as duplicate. Seems that Erlang R16 had a particular problem with OpenSSL on RedHat, which is probably close enough to CentOS to reproduce the same issue. See this post: http://erlang.org/pipermail/erlang-questions/2014-February/076760.html If you follow the thread it gives some Makefile options that you can try to use when compiling. – Greg Apr 03 '16 at 00:37