adamvduke / mod_interact

A module to forward certain ejabberd notifications to an arbitrary url
89 stars 30 forks source link

ejabberd 14.05 - ejabberd initialization was aborted because a module start failed. #5

Open igama opened 10 years ago

igama commented 10 years ago
    {'src/mod_offline_post', [{outdir, "ebin"},{i,"/opt/ejabberd/lib/ejabberd-14.05/include"}]}.
    {'src/mod_available_post', [{outdir, "ebin"},{i,"/opt/ejabberd/lib/ejabberd-14.05/include"}]}.
    {'src/mod_unavailable_post', [{outdir, "ebin"},{i,"/opt/ejabberd/lib/ejabberd-14.05/include"}]}.
ejabberd@external:~/mod_interact$ /build.sh
Recompile: src/mod_offline_post
Recompile: src/mod_available_post
Recompile: src/mod_unavailable_post

in ejabberd.yml

  mod_offline_post:
    auth_token: "offline_post_auth_token"
    post_url: "http://localhost:4567/offline_post"

running ejabberdctl live

12:50:51.700 [critical] Problem starting the module mod_offline_post for host <<"example.org">>
 options: [{auth_token,<<"offline_post_auth_token">>},
           {post_url,<<"http://localhost:4567/offline_post">>}]
 error: undef
[{p1_logger,info_msg,[mod_offline_post,45,"Starting mod_offline_post",[]],[]},
 {mod_offline_post,start,2,[{file,"src/mod_offline_post.erl"},{line,45}]},
 {gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,69}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1323}]},
 {ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,66}]},
 {application_master,start_it_old,4,
                     [{file,"application_master.erl"},{line,269}]}]
12:50:51.700 [critical] ejabberd initialization was aborted because a module start failed.

Crash dump was written to: /opt/ejabberd/logs/erl_crash_20140624-125049.dump
Problem starting the module mod_offline_post for host <<"example.org">>
 options: [{auth_token,<<"offline_post_auth_token">>},
           {post_url,<<"http://localhost:4567/offline_post">>}]
 error: un
adamvduke commented 10 years ago

Thanks for the bug report. Without digging in too deep my first thought is that this is likely due to the use of the INFO_MSG macro in some of the modules. I unfortunately don't have time to debug any deeper at this time, but removing those calls may get you unblocked.

likai757 commented 9 years ago

I want to use "INFO_MSG" to print log message, How shall I do ?

raelmax commented 9 years ago

I've downloaded the 14.12 version from github, compiled from source code and have the same issue, I followed this steps to solve:

Add this:

-define(LAGER, 1).

To "/lib/ejabberd/include/logger.hrl", before the line:

ifdef(LAGER)

And compile module with: $ erlc -I /lib/ejabberd/include/ -pa ~[path-to-ejabberd-code]/ejabberd/deps/lager/ebin/ src/mod_offline_post.erl $ sudo mv mod_offline_post.beam /lib/ejabberd/ebin/ $ sudo ejabberdctl start

This works for me on: Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 Codename: trusty