Stuck getting compiling rebar3 errors

Hey,

I’m trying to compile my project on a Ubuntu 16.04. Digital Ocean server, but I keep getting the error:

** (Mix) Could not compile dependency :certifi, "/root/.mix/rebar3 bare compile --paths 
"/root/curvita/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile 
certifi", update it with "mix deps.update certifi" or clean it with "mix deps.clean certifi"

Everything works fine on my local OSX machine.

Versions on both Ubuntu server and OSX are:
Elixir 1.4.5
Erlang 20

The full debug log is:

===> Expanded command sequence to be run: []
===> Expanded command sequence to be run: [{default,app_discovery},
                                           {bare,compile}]
===> Compiling certifi
===> sh info:
	cwd: "/root/curvita/deps/certifi"
	cmd: make -C certs_spec all

===> 	opts: [use_stdout,
               {cd,"/root/curvita/deps/certifi"},
               {env,[{"REBAR_DEPS_DIR",
                      "/root/curvita/deps/certifi/_build/default/lib"},
                     {"REBAR_BUILD_DIR",
                      "/root/curvita/deps/certifi/_build/default"},
                     {"REBAR_ROOT_DIR","/root/curvita/deps/certifi/."},
                     {"REBAR_CHECKOUTS_DIR",
                      "/root/curvita/deps/certifi/_checkouts"},
                     {"REBAR_PLUGINS_DIR",
                      "/root/curvita/deps/certifi/_build/default/plugins"},
                     {"REBAR_GLOBAL_CONFIG_DIR","/root/.config/rebar3"},
                     {"REBAR_GLOBAL_CACHE_DIR","/root/.cache/rebar3"},
                     {"REBAR_TEMPLATE_DIR","/root/.config/rebar3/templates"},
                     {"REBAR_APP_DIRS",
                      "/root/curvita/deps/certifi/_build/default/apps/*:/root/curvita/deps/certifi/_build/default/lib/*:/root/curvita/deps/certifi/_build/default/."},
                     {"REBAR_SRC_DIRS",[]},
                     {"ERLANG_ERTS_VER","9.0"},
                     {"ERLANG_ROOT_DIR","/usr/lib/erlang"},
                     {"ERLANG_LIB_DIR_erl_interface",
                      "/usr/lib/erlang/lib/erl_interface-3.10"},
                     {"ERLANG_LIB_VER_erl_interface","3.10"},
                     {"ERL","/usr/lib/erlang/bin/erl"},
                     {"ERLC","/usr/lib/erlang/bin/erlc"},
                     {"ERLANG_ARCH","64"},
                     {"ERLANG_TARGET","20.0-x86_64-unknown-linux-gnu-64"}]},
               {abort_on_error,"Hook for compile failed!\n"}]

===> Port Cmd: make -C certs_spec all
Port Opts: [{cd,"/root/curvita/deps/certifi"},
            {env,[{"REBAR_DEPS_DIR",
                   "/root/curvita/deps/certifi/_build/default/lib"},
                  {"REBAR_BUILD_DIR",
                   "/root/curvita/deps/certifi/_build/default"},
                  {"REBAR_ROOT_DIR","/root/curvita/deps/certifi/."},
                  {"REBAR_CHECKOUTS_DIR",
                   "/root/curvita/deps/certifi/_checkouts"},
                  {"REBAR_PLUGINS_DIR",
                   "/root/curvita/deps/certifi/_build/default/plugins"},
                  {"REBAR_GLOBAL_CONFIG_DIR","/root/.config/rebar3"},
                  {"REBAR_GLOBAL_CACHE_DIR","/root/.cache/rebar3"},
                  {"REBAR_TEMPLATE_DIR","/root/.config/rebar3/templates"},
                  {"REBAR_APP_DIRS",
                   "/root/curvita/deps/certifi/_build/default/apps/*:/root/curvita/deps/certifi/_build/default/lib/*:/root/curvita/deps/certifi/_build/default/."},
                  {"REBAR_SRC_DIRS",[]},
                  {"ERLANG_ERTS_VER","9.0"},
                  {"ERLANG_ROOT_DIR","/usr/lib/erlang"},
                  {"ERLANG_LIB_DIR_erl_interface",
                   "/usr/lib/erlang/lib/erl_interface-3.10"},
                  {"ERLANG_LIB_VER_erl_interface","3.10"},
                  {"ERL","/usr/lib/erlang/bin/erl"},
                  {"ERLC","/usr/lib/erlang/bin/erlc"},
                  {"ERLANG_ARCH","64"},
                  {"ERLANG_TARGET","20.0-x86_64-unknown-linux-gnu-64"}]},
            exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof]

sh: 1: exec: make: not found
===> Hook for compile failed!

** (Mix) Could not compile dependency :certifi, "/root/.mix/rebar3 bare compile --paths "/root/curvita/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile certifi", update it with "mix deps.update certifi" or clean it with "mix deps.clean certifi"

What happens, when you run

make -v

on the Ubuntu server command line?

PS: I’m not familiar with Ubuntu - but I would think it peculiar if a *nix distribution didn’t have make - but weirder things have happened.

Seems

sudo apt-get install build-essential

is a common suggestion - but I would find out what exactly it installs first.

Package: build-essential (11.6ubuntu6)
Package: make (3.81-8.2ubuntu3)

2 Likes

**[quote=“peerreynders, post:2, topic:6857”]
sudo apt-get install build-essential
[/quote]

it worked!
Not sure how I missed it, but spent a couple hours trying to find a solution…

Thank you! :smiley:

2 Likes

Hello @dyyce, i’m currently experiencing similar problem using edeliver and distillery. The solution here seems not to work for me because make and build-essential is already installed.

Please i want to know how you were to access the log generated. I will also like to do that so i can have a pointer to issues affecting the deployment.

Ubuntu 16.10 on DigitalOcean
build-essential (12.1ubuntu2)
make (4.1)

Thank you

This is what i got when i ran MIX_ENV=prod mix edeliver build upgrade production --verbose --with=0.0.1

===> Compiling certifi
make: Entering directory '/home/deploy/ceecare/builds/deps/certifi/certs_spec'
escript ../certs_spec/gen_certifi_mod.escript
make: Leaving directory '/home/deploy/ceecare/builds/deps/certifi/certs_spec'
Killed
==> ceecare
** (Mix) Could not compile dependency :certifi, "/home/deploy/.mix/rebar3 bare compile --paths "/home/deploy/ceecare/builds/_build/prod/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile certifi", update it with "mix deps.update certifi" or clean it with "mix deps.clean certifi"

Have you tried any of these - what happens?

  • mix deps.compile certifi
  • mix deps.update certifi
  • mix deps.clean certifi

I can’t be certain but certifi is an erlang implementation of certifi and it requires rebar3 - which may not be installed. None of the Ubuntu packages seem to have it.

If rebar3 isn’t installed have a look at:

Thanks @peerreynders, the suggested mix commands without any luck.

I will install rebar3 on the server and see what happens next.

Thanks so much.

Use mix local.rebar to install it.

1 Like

hexdocs: mix local.rebar - Mix v1.4.5

Thanks immensely @peerreynders and @NobbZ. I have installed using mix local.rebar.

The installation was successful and rebar3 now works on the server.

I tried rebar but said The program 'rebar' is currently not installed. You can install it by typing: sudo apt install rebar.

Do i need to install that separately or it doesn’t matter?

Thank you once again.

It is my understanding that rebar3 is entirely separate from rebar - so the question is whether your original compile works.

Thanks @peerreynders.

I have tried to recompile using MIX_ENV=prod mix edeliver build upgrade production --verbose --with=0.0.1 but got similar error

make: Entering directory '/home/deploy/ceecare/builds/deps/certifi/certs_spec'
escript ../certs_spec/gen_certifi_mod.escript
make: Leaving directory '/home/deploy/ceecare/builds/deps/certifi/certs_spec'
Killed
==> ceecare
** (Mix) Could not compile dependency :certifi, "/home/deploy/.mix/rebar3 bare compile --paths "/home/deploy/ceecare/builds/_build/prod/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile certifi", update it with "mix deps.update certifi" or clean it with "mix deps.clean certifi"

Compilation works without any errors locally.

I have also ran
MIX_ENV=prod mix deps.update certifi
MIX_ENV=prod mix deps.compile certifi
MIX_ENV=prod mix deps.clean certifi and mix deps.get certifi

Please what i’m mine doing wrong?

I’d try to see if there is any additional information by running

/home/deploy/.mix/rebar3 bare compile --paths "/home/deploy/ceecare/builds/_build/prod/lib/*/ebin"

directly from the command line. Looking at gen_certifi_mod.escript it simply reads

/home/deploy/ceecare/builds/deps/certifi/certs_spec/cacerts.pem

(PEM - Privacy Enhanced Mail) and writes out a processed version to

 /home/deploy/ceecare/builds/deps/certifi/src/certifi_cacerts.erl
  • does cacerts.pem exist and is it valid?
  • are there read permissions for cacerts.pem?
  • are there write permissions to /home/deploy/ceecare/builds/deps/certifi/src for certifi_cacerts.erl?

Thanks so much @peerreynders. Something strange is happening.

/home/deploy/.mix/rebar3 bare compile --paths "/home/deploy/ceecare/builds/_build/prod/lib/*/ebin"
```

but i got ``-bash: /home/deploy/bin/rebar3: No such file or directory``

But when i ran ``mix local.rebar``, **rebar3** was available as a bash command

Please what could be going on?

<img src="/uploads/default/original/2X/a/afcddaa57906f35020a72702bbec01e20408c9cc.png" width="690" height="286">
This is the .mix content.

That call uses the system rebar3. Please use a fully qualified path.

1 Like

Thanks NobbZ. Please i didn’t fully get what you mean by qualified path.

Can you share any hint regarding that?

Thanks so much.

An absolute path to rebar3 as examples by @peerreynders.

1 Like

Okay. Thanks so much.

I have tried it out but got this

==> Expanded command sequence to be run: []
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {bare,compile}]
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,[]}
===> Stack trace to the error location:
[{rebar_prv_bare_compile,do,1,
                         [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_bare_compile.erl"},
                          {line,45}]},
 {rebar_core,do,2,
             [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
              {line,153}]},
 {rebar_prv_do,do_tasks,2,
               [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_do.erl"},
                {line,68}]},
 {rebar_core,do,2,
             [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
              {line,153}]},
 {rebar3,main,1,
         [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar3.erl"},
          {line,66}]},
 {escript,run,2,[{file,"escript.erl"},{line,759}]},
 {escript,start,1,[{file,"escript.erl"},{line,277}]},
 {init,start_em,1,[]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`

Rebar3 Report:

Rebar3 report
 version 3.3.6
 generated at 2017-07-20T18:29:30+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task:
Entered as:

-----------------
Operating System: x86_64-unknown-linux-gnu
ERTS: Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:0] [hipe] [kernel-poll:false]
Root Directory: /usr/lib/erlang
Library directory: /usr/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.3.0
certifi: 0.4.0
cf: 0.2.2
common_test: 1.15
compiler: 7.1
crypto: 4.0
cth_readable: 1.2.4
dialyzer: 3.2
edoc: 0.9
erlware_commons: 1.0.0
eunit: 2.3.3
eunit_formatters: 0.3.1
getopt: 0.8.2
inets: 6.4
kernel: 5.3
providers: 1.6.0
public_key: 1.4.1
relx: 3.22.3
sasl: 3.0.4
snmp: 5.2.6
ssl_verify_fun: 1.1.1
stdlib: 3.4
syntax_tools: 2.1.2
tools: 2.10

-----------------
Escript path: /home/deploy/.mix/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report shell state tar tree unlock update upgrade upgrade upgrade version xref