processone / ejabberd-contrib

Growing and curated ejabberd contributions repository - PR or ask to join !
http://ejabberd.im
250 stars 140 forks source link

mod_logxml fails to start in ejabberd 17 #216

Closed jploski closed 7 years ago

jploski commented 7 years ago

Using the exact configuration from mod_logxml module's README.txt and ejabberd Docker image rroemhild/ejabberd:17.01 or rroemhild/ejabberd:17.03, here's what I get:

2017-06-12 13:23:58.176 [critical] <0.38.0>@gen_mod:start_module:162 Problem starting the module mod_logxml for host <<"xxxxxxxx.com">>
 options: [{stanza,[iq,other]},
           {direction,[external]},
           {orientation,[send,recv]},
           {logdir,<<"/tmp/logs/">>},
           {timezone,universal},
           {show_ip,false},
           {rotate_days,1},
           {rotate_megs,100},
           {rotate_kpackets,no},
           {check_rotate_kpackets,1}]
 error: undef
[{mod_logxml,start,
             [<<"xxxxxxxx.com">>,
              [{stanza,[iq,other]},
               {direction,[external]},
               {orientation,[send,recv]},
               {logdir,<<"/tmp/logs/">>},
               {timezone,universal},
               {show_ip,false},
               {rotate_days,1},
               {rotate_megs,100},
               {rotate_kpackets,no},
               {check_rotate_kpackets,1}]],
             []},
 {gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,154}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1336}]},
 {ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,77}]},
 {application_master,start_it_old,4,
                     [{file,"application_master.erl"},{line,272}]}]
2017-06-12 13:23:58.176 [critical] <0.38.0>@gen_mod:maybe_halt_ejabberd:170 ejabberd initialization was aborted because a module start failed.

I checked that mod_logxml.erl in the container matches commit 5359c2a0dd916dd7a4efcb3eb8089b30ed738acb I didn't manage to find a workaround for the above start error.

badlop commented 7 years ago

The error message says that the function mod_logxml:start with two arguments is undefined. This surely means erlang couldn't find the file mod_logxml.beam

What's the practical problem, and how to solve it, depends on how you installed that contributed module.

tungd commented 7 years ago

I think he uses uses modules_update_specs/module_install. These commands work on CentOS, but not Debian. On both system I installed Ejabberd from the packaged .deb/.rpm.

My quick workaround is to copy the module .beam file from .ejabberd-modules/<mod_name>/ebin/<mod_name>.beam to lib/ejabberd-<version>/ebin.

badlop commented 7 years ago

I installed ejabberd-17.07-linux-x86_64-installer.run in my debian machine, then run

$ ./ejabberdctl modules_update_specs
$ ./ejabberdctl module_install mod_logxml

The module was compiled, installed, started with its default config, and it started logging already.

jploski commented 7 years ago

Sorry for the late reply. This ticket did not concern the manual installation of the module. Rather, it concerns that the pre-installed version from the Docker image provided by https://hub.docker.com/r/rroemhild/ejabberd/ does not work. The .beam file was already contained in the image, so I assumed that the module was installed - yet it did not start (as reported).

badlop commented 7 years ago

Then you better contact the author of the corresponding package.