Darkpingouin

Darkpingouin

Hello,

So I just setup a new debian machine at work for elixir development. We usually use distillery to create the releases that we then put on the server.

I juts tried to make a new release from this machine and I have runtime errors when launching the binary on ther sever. The only difference between my old debian and the new one is the erlanf erts version

Old one:  Erlang/OTP 21 [erts-10.1.3] 
New one: Erlang/OTP 21 [erts-10.2.4]

On the server when launching the new release I get this with verbose:

 ./bin/prestashopapi foreground --verbosity=verbose

/home/tutu/erts-10.2.4/bin/beam.smp: /lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /home/tutu/erts-10.2.4/bin/beam.smp)
/home/tutu/erts-10.2.4/bin/beam.smp: /lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /home/tutu/erts-10.2.4/bin/beam.smp)
/home/tutu/erts-10.2.4/bin/beam.smp: /lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /home/tutu/erts-10.2.4/bin/beam.smp)
/home/tutu/erts-10.2.4/bin/beam.smp: /lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /home/tutu/erts-10.2.4/bin/beam.smp)
/home/tutu/erts-10.2.4/bin/beam.smp: /lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /home/tutu/erts-10.2.4/bin/beam.smp)
/home/tutu/erts-10.2.4/bin/beam.smp: /lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /home/tutu/erts-10.2.4/bin/beam.smp)
2019-02-28 15:15:14.855123
args: [load_failed,"Failed to load NIF library /home/tutu/lib/crypto-4.4/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.\n"]
format: "Unable to load crypto library. Failed with error:~n\"~p, ~s\"~n~s"
label: {error_logger,error_msg}
2019-02-28 15:15:14.864482 crash_report #{label=>{proc_lib,crash},report=>[[{initial_call,{supervisor,kernel,['Argument__1']}},{pid,<0.1514.0>},{registered_name,[]},{error_info,{exit,{on_load_function_failed,crypto},[{init,run_on_load_handlers,0,[]},{kernel,init,1,[{file,"kernel.erl"},{line,212}]},{supervisor,init,1,[{file,"supervisor.erl"},{line,295}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,374}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,342}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}},{ancestors,[kernel_sup,<0.1488.0>]},{message_queue_len,0},{messages,[]},{links,[<0.1490.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,273}],[]]}2019-02-28 15:15:14.865151 supervisor_report #{label=>{supervisor,start_error},report=>[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{on_load_function_failed,crypto}},{offender,[{pid,undefined},{id,kernel_safe_sup},{mfargs,{supervisor,start_link,[{local,kernel_safe_sup},kernel,safe]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
2019-02-28 15:15:15.876872 crash_report #{label=>{proc_lib,crash},report=>[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,<0.1487.0>},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,138}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}},{ancestors,[<0.1486.0>]},{message_queue_len,1},{messages,[{'EXIT',<0.1488.0>,normal}]},{links,[<0.1486.0>,<0.1485.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,27},{reductions,193}],[]]}
2019-02-28 15:15:15.889010 std_info #{label=>{application_controller,exit},report=>[{application,kernel},{exited,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}}})

Crash dump is being written to: erl_crash.dump...done

Does anyone have any Idea of what could be missing ?

I already installed erlang-crypto and openSSL but that didn’t solve the problem.

Showing Posts 1 to 10

Fl4m3Ph03n1x

Fl4m3Ph03n1x

With distillery, you must compile the project on a machine with the same specs as the machine you will deploy it in.

If for example, you compiled your project on Ubuntu 17.04 and your server has Debian or even Ubuntu 17.10 or 18.04, then the project will fail to run (you will be likely otherwise).

Both machines must also have the same architecture type (x86, etc )

Darkpingouin

Darkpingouin OP

Oh ok. That explains a lot. Is there a reason why the machines should have the same specs ?

Fl4m3Ph03n1x

Fl4m3Ph03n1x

Distillery will compile everything and include the erlang runtime in the package. If the machines are different, then the compiled code wont run on the other machine. See it this way - would a windows app work on a Linux system? Both system are different, same with compiled code for specific machines :smiley:

tty

tty

Distillery does allow you to cross compile to a different target machine via the include_erts: parameter. However I haven’t personally tried this.

Fl4m3Ph03n1x

Fl4m3Ph03n1x

From the book “Elixir in Action”:

I want to stress that the release is no longer dependent on your system’s Erlang and Elixir. It’s fully standalone: you can copy the contents of the _build/prod/rel/todo subfolder to another machine where Elixir and Erlang aren’t installed, and it will still work. Of course, because the release contains Erlang runtime binaries, the target machine has to be powered by the same OS and architecture.

This is possible when you include the erlang runtime, but it has the limitation I mentioned before (must be compiled in machines with the same specs).

Darkpingouin

Darkpingouin OP

Thanks a lot. Unfortunatly that’s why I do, I copy the _build/prod/rel/api/releases/0.0.1/api.tar.gz to the server.
I also tried to copy the whole subfolder to the server but I still get the errors above. As I said the difference is that the server is using debian jessie and I compiled it on a debian stretch.
But it should normaly use the erlang runtime binaries that aren’t working for some reason…

Fl4m3Ph03n1x

Fl4m3Ph03n1x

That’s likely the source of your problem :smiley:

Darkpingouin

Darkpingouin OP

Yes tha’ts what we guessed. Well, I guess I’ll need to re-install another system then… :woman_shrugging:

shanesveller

shanesveller

To clarify for other readers, this phrasing can give the wrong impression. The conflict to watch out for is in the libraries present, not that you happened to use one Linux distribution or another. If the required OS libraries (libc, openssl, etc.) were compatible on both the build host and the deployment host, the release would still run between different distributions just fine. Most people just choose not to try to shave that particular yak, and it’s simplest to target the same OS at both ends. But it was never about the choice of OS specifically, so we shouldn’t phrase it that way when trying to teach others about good practices.

This part in particular was dangerous because it could make people believe that you meant it must have the same number of CPU cores, or same RAM total, or same disk size/speed, etc. That’s not at all true.

Yes, that part’s accurate.

Fl4m3Ph03n1x

Fl4m3Ph03n1x

True. Point is that different Linux distros (and versions from the same distro) use different libraries. We had this issue when we compiled in Ubuntu 18.04 and tried to deploy in Ubuntu 18.10.

I feel this is being taken out of context :stuck_out_tongue: You care correct in your assessment though, distillery artifacts couldn’t care less about how much RAM a machine has.

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews