mod_statsdx error in logs from update_counter

I upgraded ejabberd from 1.1.4 to 2.0.4. I have installed mod_statsdx from svn-872.

Now, this error shows up in the ejabberd log.

=ERROR REPORT==== 2009-05-07 08:28:02 ===
E(<0.2340.0>:mod_statsdx:255) : get_statistic error for N: 'ejabberd@server.mydomain.edu', A: [{recv,
                                                                                                   presence,
                                                                                                   out,
                                                                                                   60000},
                                                                                                  "courses.my.domain.edu"]
{badarg,[{ets,update_counter,
              ['mod_statsdx_courses.my.domain.edu',
               {recv,"courses.my.domain.edu",presence,out},
               {2,1,0,0}]},
         {mod_statsdx,get_stat,2},
         {mod_statsdx,get_statistic,2},
         {mod_stats2file,fwttl,4},
         {mod_stats2file,write_stats,5},
         {lists,foreach,2},
         {mod_stats2file,write_statsfiles,5},
         {mod_stats2file,loop,5}]}

Try mod_stasdx/branches/ejabberd-2.0.x

zjt wrote:

I upgraded ejabberd from 1.1.4 to 2.0.4. I have installed mod_statsdx from svn-872.
Now, this error shows up in the ejabberd log.

You have ejabberd 2.0.4. You didn't specify, but it seems you are using mod_statsdx from mod_statsdx/trunk.

Can you try using instead from mod_stasdx/branches/ejabberd-2.0.x ? Check ejabberd.log and sasl.log when you start the server and when a client connects.

If that doesn't help, please comment here exactly what options did you add to ejabberd.cfg, and what are the first error messages that you see in ejabberd.log or sasl.log

Same error with mod_stasdx/branches/ejabberd-2.0.x

Thanks badlop. I wasn't using mod_stasdx/branches/ejabberd-2.0.x. I recompiled from that directory. Same errors show up in the logs.

First error:

=ERROR REPORT==== 2009-05-13 15:38:51 ===
E(<0.227.0>:mod_statsdx:248) : get_statistic error for N: 'ejabberd@xxx', A: [{"user_login",
                                                                                                  60000},
                                                                                                 server]
{badarg,[{ets,update_counter,
              [mod_statsdx_server,{user_login,server},{2,1,0,0}]},
         {mod_statsdx,get_stat,2},
         {mod_statsdx,get_statistic,2},
         {mod_stats2file,fwttl,4},
         {mod_stats2file,write_stats,5},
         {mod_stats2file,write_statsfiles,5},
         {mod_stats2file,loop,5}]}

Not sure if this is related, but these errors show up when I compile mod_statsdx

Recompile: ../../../ejabberd-dev/branches/ejabberd-2.0.x/src/gen_mod
Recompile: src/mod_statsdx
src/mod_statsdx.erl:12: Warning: behaviour gen_mod undefined
Recompile: src/mod_stats2file
src/mod_stats2file.erl:12: Warning: behaviour gen_mod undefined

From ejabberd.cfg:

  {mod_stats,    []},
  {mod_statsdx,  []},
  {mod_stats2file, [
                  {interval, 1},
                  {type, txt},
                  {basefilename, "/opt/ejabberd/var/stats/ejabberd_stats"}
                 ]},

Fixed in SVN. Update and try.

zjt wrote:

Not sure if this is related, but these errors show up when I compile mod_statsdx

Recompile: ../../../ejabberd-dev/branches/ejabberd-2.0.x/src/gen_mod
Recompile: src/mod_statsdx
src/mod_statsdx.erl:12: Warning: behaviour gen_mod undefined
Recompile: src/mod_stats2file
src/mod_stats2file.erl:12: Warning: behaviour gen_mod undefined

Not related. I also see them; don't worry about them at all. And those are warning messages, not error messages.

zjt wrote:

I wasn't using mod_stasdx/branches/ejabberd-2.0.x. I recompiled from that directory. Same errors show up in the logs.

I tried with your configuration, and I found the problem in the code. Update mod_statsdx from svn, and now it should work.

Mostly fixed

Great! Updating to r962 mostly fixed it.

Still seeing the error for 'totalmucrooms'.

=ERROR REPORT==== 2009-05-15 16:31:47 ===
E(<0.18875.1>:mod_statsdx:248) : get_statistic error for N: 'ejabberd@xxx', A: ["totalmucrooms",
                                                                                                   "xxx"]
{badarg,[{ets,safe_fixtable,[muc_online_room,true]},
         {ets,foldl,3},
         {mod_statsdx,get_totalmucrooms,1},
         {mod_statsdx,get_statistic,2},
         {mod_stats2file,fwttl,4},
         {mod_stats2file,write_stats,5},
         {lists,foreach,2},
         {mod_stats2file,write_statsfiles,5}]}

Do you have mod_muc disabled?

I get that error message if I delete a Mnesia table. In your case, maybe you have mod_muc disabled in ejabberd.cfg?
If that's your case, you have three solutions:

  • Enable mod_muc
  • Don't care about such error messages
  • Edit mod_stats2file source code to not request statistics about mod_muc

My test:

$ sudo ejabberdctl live
...

(ejabberd@localhost)1> mod_statsdx:get_statistic(node(), ["totalmucrooms","localhost"]).
0                                                                                       

(ejabberd@localhost)2> mnesia:delete_table(muc_online_room).                            
{atomic,ok}                                                                             

(ejabberd@localhost)3> mod_statsdx:get_statistic(node(), ["totalmucrooms","localhost"]).

=ERROR REPORT==== 22-May-2009::11:55:25 ===
E(<0.42.0>:mod_statsdx:248) : get_statistic error for N: ejabberd@localhost, A: ["totalmucrooms",                                                                                         
                                                                                 "localhost"]                                                                                             
{badarg,[{ets,safe_fixtable,[muc_online_room,true]},                                         
         {ets,foldl,3},                                                                      
         {mod_statsdx,get_totalmucrooms,1},                                                  
         {mod_statsdx,get_statistic,2},                                                      
         {erl_eval,do_apply,5},                                                              
         {shell,exprs,6},                                                                    
         {shell,eval_exprs,6},                                                               
         {shell,eval_loop,3}]}                                                               
unknown                                                                                      

Re: Do you have mod_muc disabled?

Ah, I still have mod_muc enabled on only 1 or the 2 nodes (the 1.1.4 way). I see now that the errors only show up on the node that doesn't have mod_muc enabled.

Now that ejabberd 2.x supports mod_muc clustering, I will figure out how to configure it on both nodes.

Thanks again for your help and your patience, badlop.

Syndicate content