Server does not start

I am using cqerl library to connect to Cassandra, but when I start the server, I get this error:

Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false]

2017-05-24 08:07:36 crash_report
initial_call: {supervisor,kernel,['Argument__1']}
pid: <0.1756.0>
registered_name: []
error_info: {exit,{on_load_function_failed,lz4},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,352}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ancestors: [kernel_sup,<0.1732.0>]
messages: []
links: [<0.1733.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 376
stack_size: 27
reductions: 117
2017-05-24 08:07:36 supervisor_report
supervisor: {local,kernel_sup}
errorContext: start_error
reason: {on_load_function_failed,lz4}
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}]
2017-05-24 08:07:37 crash_report
initial_call: {application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}
pid: <0.1731.0>
registered_name: []
error_info: {exit,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,lz4}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,134}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ancestors: [<0.1730.0>]
messages: [{'EXIT',<0.1732.0>,normal}]
links: [<0.1730.0>,<0.1729.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 376
stack_size: 27
reductions: 152
2017-05-24 08:07:37 std_info
application: kernel
exited: {{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,lz4}}},{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,lz4}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,lz4}}},{kernel,start,[normal,[]]}}})
Can you please advice how to solve this issue?

cqerl library depends on lz4 which did not start as in the error above, any idea how to solve such an issue?

reason: {on_load_function_failed,lz4}

The reason in the error report suggests that it couldn’t load the NIF code of the lz4 library. In other words the erlang wrapper around lz4 should load the lz4 c code during startup, but has failed to do so.

There can be various reasons why the loading fails, so it’s difficult to give a solution, but most the time the reason is an error compiling the c code, or erlang can not find the compiled c library.

1 Like