Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebar3 Installation Bootstrap Error: escript: exception error: no match of right hand side value {error,enoent} #374

Closed
sagungargs opened this issue Apr 26, 2015 · 16 comments

Comments

@sagungargs
Copy link

While trying to install rebar3 and using the command ./bootstrap I am getting the above error

@sagungargs sagungargs changed the title escript: exception error: no match of right hand side value {error,enoent} Rebar3 Installation Bootstrap Error: escript: exception error: no match of right hand side value {error,enoent} Apr 27, 2015
@sagungargs
Copy link
Author

@tsloughter @ferd any inputs or links where I can resolve this. I am getting this only on my Macbook Air, my colleague could smoothely install the same a few days back on OSX machines. Since this is an installation issue that I am facing with rebar3 I am getting a little impatient. After enjoying your talk at EUC SF 2015 I can't wait to get my hands on it for my project

@ferd
Copy link
Collaborator

ferd commented Apr 27, 2015

Yeah sorry I was out for the week-end. If the impatience is too much, you can always use one of our nightly-built versions at http://www.rebar3.org (direct link: https://s3.amazonaws.com/rebar3/rebar3).

In any case, do you get any output? This error ({error, enoent}) tends to happen after an unsuccessful bootstrap command because something else failed to compile.

Without any of the compile output, it's hard to diagnose anything.

@tsloughter
Copy link
Collaborator

@sagungargs is this with the latest master? It should give more output than that. Also run with DEBUG=1 ./bootstrap and let us know what OTP version you are running.

@sagungargs
Copy link
Author

@tsloughter & @ferd thanks for the inputs tried figuring out the OTP version; both OTP_RELEASE and OTP_VERSION are missing from the installation at erlang installation folder

$ cat releases/17/OTP_RELEASE 
17.3

, apologies for not reporting the version anything beyond 17. I took a cue and installed the latest version OTP 17.5 (Standard Edition from Erlang Solutions Download section for Mac OSX Yosemite (10.10.1) and tried bootstrapping again with ./bootstrap, this time I move beyond the previous error {error,enoent} so I really don't know why did this occur in the first place.

Now I am getting

===> Bad packages index, try to fix with `rebar3 update` 

just after running the ./bootstrap command though all looks fine at the end of the script. I tried rebar3 update command and it reports

rebar3: command not found

I copied rebar3 in the msgpack-rpc and tried using it. On ./rebar3 compile it throws the same

===> Bad packages index, try to fix with `rebar3 update` 

error and goes on to compile the 3 applications ranch, msgpack and msgpack-rpc

Has rebar3 installed correctly and is this an expected behaviour? for the error it throws? Because I was not getting these errors in other two Mac OS X machines

@ferd
Copy link
Collaborator

ferd commented Apr 28, 2015

I guess the problem would be with that missing OTP version file: https://github.com/rebar/rebar3/blob/578a27f506a00615f41803c277cc3069a7f3022a/bootstrap#L192-L220 and https://github.com/rebar/rebar3/blob/0537a0699d01e4ae61dd32db0d964224bf9a1f5e/src/rebar_utils.erl#L294-L301

This file is specified to be required in http://www.erlang.org/doc/system_principles/versions.html#id65106 -- I do believe however, that releases generated with Reltool (and maybe systools?) don't include them, which would be a bug. Then when the Erlang Solutions folks generate their custom releases and packages, the file turns out to be missing.

I guess the required workaround will be to behave such that when the file isn't there, we display a warning ("OTP_VERSION file missing from the Erlang/OTP install; assuming major version ~p") and use only the major version.

Otherwise we'll need to keep failing the way we are until toolchains are fixed.


For the current problem, I'd really like to see logs about the whole failing run, not just the failing message to be able to properly locate things.


For the msgpack rebar3, you can just use the one I linked to previously that is a nightly build. It should work fine. The bad package index might be there from a previous run or just has never run at this point in time. rebar3 update should fetch a hex index and save it to disk, hopefully fixing the problem and then you'd have a usable version.

But it's possible that if you use conflicting rebar3 versions, both could be using a distinct package manager version and they'll keep breaking eachother.

@tsloughter
Copy link
Collaborator

So the "error" about packages is harmless (unless you try to use a package dependency.

But I see that we can move the loading of the package index to somewhere that it won't happen unless you do have a package dep listed so that it won't show that message if you don't.

Updating now.

@sagungargs
Copy link
Author

rebar3 update

still throws

-bash: rebar3: command not found

@ferd
Copy link
Collaborator

ferd commented Apr 29, 2015

yes that's because the command is not in your path. Is the rebar3 file even on disk?

@tsloughter
Copy link
Collaborator

@sagungargs can we close this?

@ferd ferd closed this as completed May 22, 2015
@benseshi
Copy link

benseshi commented Nov 8, 2017

Recompile: src/rebar_xref
Recompile: src/rmemo
Uncaught error in rebar_core: {'EXIT',
{undef,
[{crypto,start,[],[]},
{rebar,run_aux,2,
[{file,"src/rebar.erl"},{line,209}]},
{rebar,main,1,
[{file,"src/rebar.erl"},{line,58}]},
{erl_eval,do_apply,6,
[{file,"erl_eval.erl"},{line,670}]},
{escript,eval_exprs,5,
[{file,"escript.erl"},{line,873}]},
{erl_eval,local_func,6,
[{file,"erl_eval.erl"},{line,557}]},
{escript,interpret,4,
[{file,"escript.erl"},{line,789}]},
{escript,start,1,
[{file,"escript.erl"},{line,277}]}]}}

@benseshi
Copy link

benseshi commented Nov 8, 2017

can anyone please give me solution for this im fed up with trying to resolve this
thankyou

@benseshi
Copy link

benseshi commented Nov 8, 2017

./bootstrap
./bootstrap:40: Warning: string:strip/3: deprecated; use string:trim/3 instead
./bootstrap:149: Warning: string:strip/3: deprecated; use string:trim/3 instead
./bootstrap:150: Warning: string:strip/3: deprecated; use string:trim/3 instead
No beam files found.
Recompile: src/rebar
src/rebar.erl:529: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar.erl:596: Warning: string:join/2: deprecated; use lists:join/2 instead
Recompile: src/rebar_abnfc_compiler
Recompile: src/rebar_app_utils
src/rebar_app_utils.erl:134: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_app_utils.erl:139: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
Recompile: src/rebar_appups
Recompile: src/rebar_asn1_compiler
Recompile: src/rebar_base_compiler
Recompile: src/rebar_cleaner
Recompile: src/rebar_config
Recompile: src/rebar_core
src/rebar_core.erl:599: Warning: string:join/2: deprecated; use lists:join/2 instead
Recompile: src/rebar_cover_utils
src/rebar_cover_utils.erl:186: Warning: string:str/2: deprecated; use string:find/2 instead
Recompile: src/rebar_ct
src/rebar_ct.erl:168: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_ct.erl:172: Warning: string:str/2: deprecated; use string:find/2 instead
src/rebar_ct.erl:175: Warning: string:str/2: deprecated; use string:find/2 instead
src/rebar_ct.erl:181: Warning: string:str/2: deprecated; use string:find/2 instead
src/rebar_ct.erl:239: Warning: string:join/2: deprecated; use lists:join/2 instead
src/rebar_ct.erl:291: Warning: crypto:rand_uniform/2 is deprecated and will be removed in a future release; use rand:uniform/1
src/rebar_ct.erl:385: Warning: string:join/2: deprecated; use lists:join/2 instead
src/rebar_ct.erl:401: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_ct.erl:428: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_ct.erl:429: Warning: string:join/2: deprecated; use lists:join/2 instead
src/rebar_ct.erl:445: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_ct.erl:446: Warning: string:join/2: deprecated; use lists:join/2 instead
Recompile: src/rebar_deps
src/rebar_deps.erl:111: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_deps.erl:202: Warning: string:join/2: deprecated; use lists:join/2 instead
Recompile: src/rebar_dia_compiler
Recompile: src/rebar_dialyzer
src/rebar_dialyzer.erl:218: Warning: string:strip/3: deprecated; use string:trim/3 instead
Recompile: src/rebar_edoc
Recompile: src/rebar_erlc_compiler
Recompile: src/rebar_erlydtl_compiler
src/rebar_erlydtl_compiler.erl:239: Warning: string:substr/3: deprecated; use string:slice/3 instead
src/rebar_erlydtl_compiler.erl:266: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
Recompile: src/rebar_escripter
Recompile: src/rebar_eunit
src/rebar_eunit.erl:155: Warning: string:str/2: deprecated; use string:find/2 instead
src/rebar_eunit.erl:236: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_eunit.erl:250: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_eunit.erl:257: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_eunit.erl:282: Warning: crypto:rand_uniform/2 is deprecated and will be removed in a future release; use rand:uniform/1
src/rebar_eunit.erl:371: Warning: string:concat/2: deprecated; use [Str1,Str2] instead
src/rebar_eunit.erl:414: Warning: string:str/2: deprecated; use string:find/2 instead
src/rebar_eunit.erl:423: Warning: string:concat/2: deprecated; use [Str1,Str2] instead
Recompile: src/rebar_file_utils
src/rebar_file_utils.erl:67: Warning: string:join/2: deprecated; use lists:join/2 instead
Recompile: src/rebar_getopt
src/rebar_getopt.erl:440: Warning: string:to_lower/1: deprecated; use string:lowercase/1 or string:casefold/1 instead
src/rebar_getopt.erl:498: Warning: string:to_lower/1: deprecated; use string:lowercase/1 or string:casefold/1 instead
src/rebar_getopt.erl:601: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_getopt.erl:772: Warning: string:cspan/2: deprecated; use string:take/3 instead
Recompile: src/rebar_lfe_compiler
Recompile: src/rebar_log
Recompile: src/rebar_metacmds
Recompile: src/rebar_mustache
src/rebar_mustache.erl:98: Warning: string:substr/3: deprecated; use string:slice/3 instead
src/rebar_mustache.erl:99: Warning: string:substr/2: deprecated; use string:slice/3 instead
src/rebar_mustache.erl:100: Warning: string:substr/3: deprecated; use string:slice/3 instead
src/rebar_mustache.erl:101: Warning: string:substr/3: deprecated; use string:slice/3 instead
src/rebar_mustache.erl:129: Warning: string:substr/3: deprecated; use string:slice/3 instead
src/rebar_mustache.erl:130: Warning: string:substr/2: deprecated; use string:slice/3 instead
src/rebar_mustache.erl:131: Warning: string:substr/3: deprecated; use string:slice/3 instead
src/rebar_mustache.erl:144: Warning: string:substr/3: deprecated; use string:slice/3 instead
Recompile: src/rebar_neotoma_compiler
src/rebar_neotoma_compiler.erl:170: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
Recompile: src/rebar_otp_app
Recompile: src/rebar_otp_appup
Recompile: src/rebar_port_compiler
src/rebar_port_compiler.erl:80: Warning: string:join/2: deprecated; use lists:join/2 instead
src/rebar_port_compiler.erl:204: Warning: string:join/2: deprecated; use lists:join/2 instead
src/rebar_port_compiler.erl:263: Warning: string:join/2: deprecated; use lists:join/2 instead
src/rebar_port_compiler.erl:268: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
Recompile: src/rebar_proto_compiler
Recompile: src/rebar_proto_gpb_compiler
Recompile: src/rebar_protobuffs_compiler
Recompile: src/rebar_qc
Recompile: src/rebar_rand_compat
Recompile: src/rebar_rel_utils
src/rebar_rel_utils.erl:263: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
src/rebar_rel_utils.erl:264: Warning: string:strip/3: deprecated; use string:trim/3 instead
Recompile: src/rebar_reltool
src/rebar_reltool.erl:202: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
Recompile: src/rebar_require_vsn
Recompile: src/rebar_shell
Recompile: src/rebar_subdirs
Recompile: src/rebar_templater
src/rebar_templater.erl:75: Warning: string:join/2: deprecated; use lists:join/2 instead
Recompile: src/rebar_upgrade
Recompile: src/rebar_utils
src/rebar_utils.erl:261: Warning: string:chr/2: deprecated; use string:find/2 instead
src/rebar_utils.erl:590: Warning: string:join/2: deprecated; use lists:join/2 instead
src/rebar_utils.erl:644: Warning: string:strip/3: deprecated; use string:trim/3 instead
src/rebar_utils.erl:664: Warning: string:strip/3: deprecated; use string:trim/3 instead
src/rebar_utils.erl:786: Warning: string:tokens/2: deprecated; use string:lexemes/2 instead
Recompile: src/rebar_xref
Recompile: src/rmemo
Uncaught error in rebar_core: {'EXIT',
{undef,
[{crypto,start,[],[]},
{rebar,run_aux,2,
[{file,"src/rebar.erl"},{line,209}]},
{rebar,main,1,
[{file,"src/rebar.erl"},{line,58}]},
{erl_eval,do_apply,6,
[{file,"erl_eval.erl"},{line,670}]},
{escript,eval_exprs,5,
[{file,"escript.erl"},{line,873}]},
{erl_eval,local_func,6,
[{file,"erl_eval.erl"},{line,557}]},
{escript,interpret,4,
[{file,"escript.erl"},{line,789}]},
{escript,start,1,
[{file,"escript.erl"},{line,277}]}]}}

this is the whole thing output im getting

@ferd
Copy link
Collaborator

ferd commented Nov 8, 2017

You are running a version of Erlang that does not have the crypto NIFs compiled in. You need to build (or install) a copy of Erlang with these libraries for things to work.

@benseshi
Copy link

benseshi commented Nov 8, 2017

how to do that sir can you help me with this

@benseshi
Copy link

benseshi commented Nov 8, 2017

can you brief me step by step

@ferd
Copy link
Collaborator

ferd commented Nov 8, 2017

Aside from what is documented at http://www.rebar3.org/docs/getting-started#section-installing-erlang I do not really have the details nor the information required about your system to give any help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants