erszcz / ejabberd-trace

Easy tracing of users connected to ejabberd
11 stars 4 forks source link

Fails to start #3

Open runderwo opened 8 years ago

runderwo commented 8 years ago
$ erl -pa ebin
Erlang/OTP 17 [erts-6.2] [source] [async-threads:10] [kernel-poll:false]

Eshell V6.2  (abort with ^G)
1> application:start(ejabberd_trace).
{error,{bad_return,{{ejabberd_trace,start,[normal,[]]},
                    {'EXIT',{badarg,[{ets,lookup,[config,hosts],[]},
                                     {ejabberd_trace,autodetect_string_type,0,
                                                     [{file,"src/ejabberd_trace.erl"},{line,93}]},
                                     {ejabberd_trace,start,2,
                                                     [{file,"src/ejabberd_trace.erl"},{line,114}]},
                                     {application_master,start_it_old,4,
                                                         [{file,"application_master.erl"},{line,272}]}]}}}}}

=INFO REPORT==== 7-Jun-2016::00:05:50 ===
    application: ejabberd_trace
    exited: {bad_return,
                {{ejabberd_trace,start,[normal,[]]},
                 {'EXIT',
                     {badarg,
                         [{ets,lookup,[config,hosts],[]},
                          {ejabberd_trace,autodetect_string_type,0,
                              [{file,"src/ejabberd_trace.erl"},{line,93}]},
                          {ejabberd_trace,start,2,
                              [{file,"src/ejabberd_trace.erl"},{line,114}]},
                          {application_master,start_it_old,4,
                              [{file,"application_master.erl"},
                               {line,272}]}]}}}}
    type: temporary
erszcz commented 8 years ago

Hi! The error states that the config table is not available - you have to start the application in the same BEAM (Erlang VM) instance ejabberd/MongooseIM is running in. In order to do that use ERL_LIBS environment variable or code:add_path/1 in the Erlang shell. However, please note that both servers have evolved since I last worked on this tool. YMMV.

runderwo commented 8 years ago

Confused. Also, I know next to nothing about erlang. Like this?
$ ERL_LIBS=/usr/lib/i386-linux-gnu/ejabberd erl -pa ebin

/usr/lib/i386-linux-gnu/ejabberd/ebin is where the ejabberd beam modules live.

erszcz commented 8 years ago

Are you using this with ejabberd or MongooseIM? If with the latter, you might have better luck trying mlp. Just set the log level appropriately and pipe through mlp to get a human-readable XML output.

If you're lucky, it might also work with ejabberd, but I haven't tried that (and the log messages might be too different - TBH the mlp filter is quite dumb).

BTW, contrary to what the README says (sorry, it's outdated) mlp also works with ordinary TCP connections, not just BOSH connections (which are XMPP streams over long-polling HTTP).

erszcz commented 8 years ago

@runderwo I've made sure mlp works out of the box and added some details on using it to the README. I strongly advise to use it instead of this project - the result to effort ratio is much better (unless you're interested in how ejabberd-trace works internally... that's a different pair of shoes).