rebar: error exit on create-app: {crypto,start,[]}
Asked Answered
B

5

9

I followed the instructions here, to the letter. I then ran the instruction to create an application project structure, and got the following error.

$ ./rebar create-app appid=myapp
Uncaught error in rebar_core: {'EXIT',
                              {undef,
                                  [{crypto,start,[]},
                                   {rebar_core,run,1},
                                   {rebar,main,1},
                                   {escript,run,2},
                                   {escript,start,1},
                                   {init,start_it,1},
                                   {init,start_em,1}]}}

Any ideas what I'm doing wrong?

Bullhead answered 20/1, 2011 at 0:6 Comment(0)
C
12

It looks like your Erlang was compiled without OpenSSL (the crypto module). crypto is required for many (most?) Erlang applications. You'll need to get a version of Erlang with a working crypto module, and then you shouldn't have any problems like this.

Corkscrew answered 20/1, 2011 at 1:34 Comment(3)
ahh. A windows install. I'm starting to realise that Erlang on windows is probably less pleasant than on Linux. Is there a way to see whether it was built with OpenSSH? Or find a pre-built version made for Cygwin 1.7+ (which is what I normally use to get over having to work on windows) I see nothing similar in my ...\erlang\erl5.8.1.1\erts-5.8.1.1\bin directory.Bullhead
I'd help if I could, but I have never used Erlang on Windows.Corkscrew
Have you openSSL installed on your windows box? I did that some time ago, using the compiled windows install from erlang.org , and I remember this is mostly about having the correct openSSl DLL present in your PATH. Hope this helps.Gurango
A
6

A clarification to YOUR ARGUMENT IS VALID's answer (adding as an answer because the comment is too short).

It may be that Erlang was compiled properly but the OpenSSL libraries are not visible to Erlang, so the crypto server can't be started. I compiled Erlang on Solaris 10 and it didn't complain about OpenSSL not being installed. In fact, it compiled crypto and installed it in: /usr/local/lib/erlang/lib/crypto-2.2/

But Rebar still wasn't working. It's easy to check if the problem is indeed with the crypto module.

Open Erlang shell and type crypto:start(). This was happening on my system:

bash-3.2# erl
Erlang R15B03 (erts-5.9.3.1) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.3.1  (abort with ^G)
1> crypto:start().
** exception error: undefined function crypto:start/0
2>
=ERROR REPORT==== 8-Feb-2013::15:28:43 ===
Unable to load crypto library. Failed with error:
"load_failed, Failed to load NIF library: 'ld.so.1: beam.smp: fatal: relocation error: file /usr/local/lib/erlang/lib/crypto-2.2/priv/lib/crypto.so: symbol DES_ede3_cfb_encrypt: referenced symbol not found'"
OpenSSL might not be installed on this system.

=ERROR REPORT==== 8-Feb-2013::15:28:43 ===
The on_load function for module crypto returned {error,
                                                 {load_failed,
                                                  "Failed to load NIF library: 'ld.so.1: beam.smp: fatal: relocation error: file /usr/local/lib/erlang/lib/crypto-2.2/priv/lib/crypto.so: symbol DES_ede3_cfb_encrypt: referenced symbol not found'"}}

If OpenSSL is installed in a non-standard location, as it is the case when using OpenCSW to install OpenSSL on Solaris 10, it is easy to fix the problem by adding the library path to the environment variable. For example on Solaris 10 to /etc/profile:

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/csw/lib
export LD_LIBRARY_PATH

Then log-out and log-in or re-load the bash environment, for example like this:

bash-3.2# . /etc/profile

Result:

bash-3.2# erl
Erlang R15B03 (erts-5.9.3.1) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.3.1  (abort with ^G)
1> crypto:start().
ok
Antichlor answered 8/2, 2013 at 16:0 Comment(0)
M
1

I'd recommend using precompiled Erlang which is available from Erlang Solutions: https://www.erlang-solutions.com/downloads/download-erlang-otp

There's one for Windows too.

Mastersinger answered 1/11, 2012 at 1:12 Comment(1)
this results to a 404 pageMongeau
M
1

Getting this error when running make command:

root@hs:/var/www/html/ejabberd-master# make
rm -rf deps/.got
rm -rf deps/.built
/usr/local/lib/erlang/bin/escript rebar get-deps && :> deps/.got
Uncaught error in rebar_core: {'EXIT',
                           {undef,
                            [{crypto,start,[],[]},
                             {rebar,run_aux,2,
                              [{file,"src/rebar.erl"},{line,163}]},
                             {rebar,main,1,
                              [{file,"src/rebar.erl"},{line,58}]},
                             {escript,run,2,
                              [{file,"escript.erl"},{line,757}]},
                             {escript,start,1,
                              [{file,"escript.erl"},{line,277}]},
                             {init,start_it,1,[]},
                             {init,start_em,1,[]}]}}
make: *** [deps/.got] Error 1

The erlang details are:

root@hs:/home/node# erl
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-    threads:10] [hipe] [kernel-poll:false]

Eshell V7.0  (abort with ^G)
1> crypto:start()
1> 

Seems like crypto not working, as the command gives "Ok" or "exception error".

Help needed.

Mongeau answered 21/4, 2016 at 11:36 Comment(1)
You forgot the "." at the end of crypto:start(), so it hasn't executed yet.Olen
M
0

Thanks for the answer Ivan. But it seems I figured out the issue: The ubuntu auto updates were turned off and the dependencies were not installed while compiling erlang (e.g. libssh-dev). Once the auto update was turned on it compiled and make command ran fine.

Mongeau answered 4/5, 2016 at 7:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.