Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_statsdx doesn't work #185

Closed
beherit opened this issue Aug 14, 2016 · 6 comments
Closed

mod_statsdx doesn't work #185

beherit opened this issue Aug 14, 2016 · 6 comments

Comments

@beherit
Copy link
Contributor

beherit commented Aug 14, 2016

After upgrading ejabberd from 16.04 to 16.08 I have problem with module mod_statsdx, in error.log I see:

2016-08-14 10:07:35.159 [critical] <0.38.0>@gen_mod:start_module:162 Problem starting the module mod_statsdx for host <<"domain.tld">> 
 options: [{hooks,traffic}]
 exit: {aborted,
           {bad_type,
               {ejabberd_commands,get_top_users,
                   [stats],
                   "Get top X users with larger offlinemsg, vcard or roster.",
                   [],0,mod_statsdx,get_top_users,
                   [{topnumber,integer},{topic,string}],
                   admin,
                   {top,
                       {list,
                           {user,
                               {tuple,
                                   [{value,integer},
                                    {user,string},
                                    {server,string}]}}}},
                   none,none,none,none}}}
[{mnesia,abort,1,[{file,"mnesia.erl"},{line,310}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1336}]},
 {mod_statsdx,start,2,[{file,"src/mod_statsdx.erl"},{line,60}]},
 {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,76}]},
 {application_master,start_it_old,4,
                     [{file,"application_master.erl"},{line,272}]}]
2016-08-14 10:07:35.159 [critical] <0.38.0>@gen_mod:maybe_halt_ejabberd:170 ejabberd initialization was aborted because a module start failed.
@badlop
Copy link
Member

badlop commented Sep 28, 2016

I try again to reproduce this problem. This is what I do:

  1. Download ejabberd git repo, compile, install, start, register an account, login to it. It works correctly.
  2. Execute those commands:
$ ejabberdctl modules_update_specs
ok
$ ejabberdctl module_install mod_statsdx
src/mod_stats2file.erl:12: Warning: undefined callback function depends/2 (behaviour 'gen_mod')
src/mod_stats2file.erl:12: Warning: undefined callback function mod_opt_type/1 (behaviour 'gen_mod')
src/mod_statsdx.erl:14: Warning: undefined callback function depends/2 (behaviour 'gen_mod')
ok

Notice that this downloads the ejabberd-contrib git repo, compiles this module, and enables its configuration in $HOME/.ejabberd-modules, so there is nothing to configure in the main ejabberd configuration file.
3. Stop ejabberd
4. Start ejabberd. It starts correctly, just shows some errors related to mod_stats2file.
5. Login to the webadmin, and the Stats Dx page is there with some information.

Why does in your case mention that the module is configured with hooks,traffic? Don't touch any configuration at all, simply follow the most simple steps I showed. Later, if all works correctly, you will be able to touch the configuration.

@beherit
Copy link
Contributor Author

beherit commented Sep 28, 2016

@badlop but I must change something in default config ;_; In ejabberd 16.04 everything works, in newer versions there is a problem, even when I delete default config and add own configuration in my main config file.

@beherit
Copy link
Contributor Author

beherit commented Sep 28, 2016

I tried add config to /etc/ejabberd/modules.d/mod_statsdx.yml (this is my CONTRIB_MODULES_CONF_DIR) but file is ignored...

@badlop
Copy link
Member

badlop commented Sep 28, 2016

You are having a problem, I invested time trying to reproduce it, provided you precise steps, and asked you a very precise question: If you follow those steps, does it work correctly, or not?

Now that you mention, I've added

CONTRIB_MODULES_CONF_DIR=/tmp/config

to ejabberdctl.cfg, and then created the file /tmp/config/mod_statsdx.yml with this content:

modules:
  mod_statsdx:
    hooks: taffic

Then I started ejabberd, and the module started correctly, it only reported that I made a typo error in the config:

18:04:23.112 [error] ignoring invalid value 'taffic' for option 'hooks' of module 'mod_statsdx'

This proves that the file is read correctly.

@beherit
Copy link
Contributor Author

beherit commented Sep 28, 2016

You are having a problem, I invested time trying to reproduce it, provided you precise steps, and asked you a very precise question: If you follow those steps, does it work correctly, or not?
If I follow those steps everythig work correctly BUT:

  1. I have this error when I delete the default module config and add it to main config file (just like I have on ejabberd 16.05 instance).
  2. CONTRIB_MODULES_CONF_DIR dosen't work for me, maybe it's problem with apt from jabber.at, I don't know.

@beherit beherit closed this as completed Sep 28, 2016
@badlop
Copy link
Member

badlop commented Oct 3, 2016

Oh, quite strange, because I have tried 16.09 (from git), and your test 1 works correctly for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants