I'm trying to install new mod_ecaptcha
mod in ejabberd-contrib
. But ejabberd crashed after enabling it.
My initial data:
ejabberd 23.01
erlang 25.2.3
I have enabled ejabberd-contrib by ejabberdctl modules_update_specs
Installed and recompiled mod_ecaptcha
ejabberdctl module_install mod_ecaptcha
make -C .ejabberd-modules/sources/ejabberd-contrib/mod_ecaptcha/deps/ecaptcha/c_src
ejabberdctl module_upgrade mod_ecaptcha
It's compiled without errors.
Installed erlang-dev apt install erlang-dev
because without it it wasn't compiled
I'm using basic config
captcha_cmd: mod_ecaptcha
captcha_url: http://myjabber:5280/captcha
listen:
-
port: 5280
module: ejabberd_http
request_handlers:
/captcha: ejabberd_captcha
modules:
mod_ecaptcha: {}
In final I started my ejabberd and receive errors in error.log and ejabberd service crashes.
2023-06-19 19:59:11.892726+03:00 [error]
<0.757.0>@proc_lib:crash_report/4:539 CRASH REPORT: crasher:
initial call: ejabberd_captcha:init/1
pid: <0.757.0>
registered_name: []
exception error: undefined function ecaptcha_nif:rand_size/0
in function ecaptcha:pixels/2 (/var/lib/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_ecaptcha/deps/ecaptcha/src/ecaptcha.erl,
line 63)
in call from ecaptcha:img/3 (/var/lib/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_ecaptcha/deps/ecaptcha/src/ecaptcha.erl,
line 107)
in call from mod_ecaptcha:create_image/1 (/var/lib/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_ecaptcha/src/mod_ecaptcha.erl,
line 78)
in call from ejabberd_captcha:check_captcha_setup/0 (ejabberd_captcha.erl, line 573)
in call from ejabberd_captcha:init/1 (ejabberd_captcha.erl, line 294)
in call from gen_server:init_it/2 (gen_server.erl, line 851)
in call from gen_server:init_it/6 (gen_server.erl, line 814)
ancestors: [ejabberd_sup,<0.123.0>]
message_queue_len: 0
messages: []
links: [<0.412.0>]
dictionary: [{rand_seed,{#{bits => 58,jump => #Fun<rand.3.34006561>,
next => #Fun<rand.0.34006561>,type => exsss,
uniform => #Fun<rand.1.34006561>,
uniform_n => #Fun<rand.2.34006561>},
[114826259057369191|191927986778231166]}}]
trap_exit: false
status: running
heap_size: 376
stack_size: 28
reductions: 393 neighbours: 2023-06-19 19:59:11.925067+03:00 [critical] <0.123.0>@ejabberd_app:start/2:68 Failed to start ejabberd
application: {error,
{shutdown,
{failed_to_start_child,
ejabberd_captcha,
{undef,
[{ecaptcha_nif,rand_size,[],[]},
{ecaptcha,pixels,2,
[{file,
"/var/lib/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_ecaptcha/deps/ecaptcha/src/ecaptcha.erl"},
{line,63}]},
{ecaptcha,img,3,
[{file,
"/var/lib/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_ecaptcha/deps/ecaptcha/src/ecaptcha.erl"},
{line,107}]},
{mod_ecaptcha,create_image,1,
[{file,
"/var/lib/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_ecaptcha/src/mod_ecaptcha.erl"},
{line,78}]},
{ejabberd_captcha,
check_captcha_setup,0,
[{file,"ejabberd_captcha.erl"},
{line,573}]},
{ejabberd_captcha,init,1,
[{file,"ejabberd_captcha.erl"},
{line,294}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},
{line,851}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},
{line,814}]}]}}}}
Full logs:
Error.log https://pastebin.com/yQKefm4N
Ejabberd.log https://pastebin.com/uENVE5fC
Can you help me please?