Giter Club home page Giter Club logo

ejabberd-contrib's Introduction

ejabberd-contrib

This is a collaborative development area for ejabberd module developers and users.

Those modules are not officially supported by ProcessOne.

For users

To use an ejabberd module coming from this repository:

  • You need to have ejabberd installed.

  • If you have not already done it, run ejabberdctl modules_update_specs to retrieve the list of available modules.

  • Run ejabberdctl module_install <module> to get the source code and to compile and install the beam file into ejabberd's module search path. This path is either ~/.ejabberd-modules or defined by the CONTRIB_MODULES_PATH setting in ejabberdctl.cfg.

  • Edit the configuration file provided in the conf directory of the installed module and update it to your needs. Or, if you prefer so, configure it in your main ejabberd configuration file.

  • Run ejabberdctl module_uninstall <module> to remove a module from ejabberd.

For developers

The following organization has been set up for the development:

  • Development and compilation of modules is done by ejabberd. You need ejabberd installed. Use ejabberdctl module_check <module> to ensure it compiles correctly before committing your work. The sources of your module must be located in $CONTRIB_MODULES_PATH/sources/<module>.

  • Compilation can by done manually (if you know what you are doing) so you don't need ejabberd running:

    cd /path/of/module
    mkdir ebin
    /path/of/ejabberd's/erlc \
       -o ebin \
       -I include -I /path/of/ejabberd/lib/ejabberd-XX.YY/include \
       -DLAGER -DNO_EXT_LIB \
       src/*erl
    
  • The module directory structure is usually the following:

    • README.txt: Module description.
    • COPYING: License for the module.
    • doc/: Documentation directory.
    • src/: Erlang source directory.
    • lib/: Elixir source directory.
    • priv/msgs/: Directory with translation files (pot, po and msg).
    • conf/<module>.yml: Configuration for your module.
    • <module>.spec: Yaml description file for your module.
  • Module developers should note in the README.txt file whether the module has requirements or known incompatibilities with other modules.

  • If your module project contains several erlang modules, you should export a function pre_uninstall/0 in the main one listing the other ones. See mod_statsdx as an example.

Broken modules

This is the list of modules that are known to be broken with latest ejabberd master branch.

If you feel they are worth it, your help to fix them is welcome:

  • atom_pubsub: "Provides access to all PEP nodes via an AtomPub interface."
  • ircd: "This is an IRC server frontend to ejabberd."
  • mod_archive: "Message Archiving (XEP-0136)."
  • mod_irc: "IRC transport."
  • mod_mam_mnesia: This feature got included in ejabberd 15.06
  • mod_openid: "Transform the Jabber Server in an openid provider."
  • mod_profile: "User Profile (XEP-0154) in Mnesia table."
  • mod_promethus_exporter: There is brand new module that adds Prometheus support, see mod_prometheus

ejabberd-contrib's People

Contributors

badlop avatar beherit avatar benlangfeld avatar dunglas avatar guerteltier avatar guusdk avatar hamano avatar licaon-kter avatar marktran avatar mathiasertl avatar michaelansel avatar mjohnson9 avatar mremond avatar paulsd avatar pouriya avatar prefiks avatar pyrote avatar rahulgautam avatar romanhargrave avatar saeed-rz avatar sando38 avatar santiago26 avatar scrogson avatar sezuan avatar sonnyp avatar timclassic avatar weiss avatar ytkang avatar zachgoldberg avatar zinid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ejabberd-contrib's Issues

mod_archive_odbc

Hello,

I've managed to have this compiled and loaded the module.

here's from the configuration file

mod_archive_odbc:
    database_type: mysql
    default_auto_save: true
    enforce_default_auto_save: true
    default_expire: "infinity"
    enforce_min_expire: 0
    enforce_max_expire: "infinity"
    replication_expire: 31536000

but after restarting the ejabberd i got this error

2014-03-07 16:01:08.866 [error] <0.9739.0> CRASH REPORT Process <0.9739.0> with 0 neighbours exited with reason: no case clause matching undefined in gen_iq_handler:add_iq_handler/6 line 65 in gen_server:init_it/6 line 328

hoping you guys could shed some light on the one. thank you very much

incorrect-fsf-address in some of the copying files

found with our build checks:

  • mod_admin_extra/COPYING
  • mod_cron/COPYING
  • mod_logxml/COPYING
  • mod_statsdx/COPYING
  • mod_webpresence/COPYING
  • mod_muc_log_http/COPYING
  • mod_muc_admin/COPYING
  • mod_multicast/COPYING

yet another srg_* command problem

Hello I found another bug while developing my app using ejabberd

ejabberdctl srg_get_info group1 localhost
Problem 'error function_clause' occurred executing the command.
Stacktrace: [{mod_admin_extra,'-srg_get_info/2-lc$^0/1-0-',
[error],
[{file,"src/mod_admin_extra.erl"},{line,1336}]},
{ejabberd_ctl,call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,294}]},
{ejabberd_ctl,try_call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,270}]},
{ejabberd_ctl,process2,3,
[{file,"src/ejabberd_ctl.erl"},{line,219}]},
{ejabberd_ctl,process,1,
[{file,"src/ejabberd_ctl.erl"},{line,204}]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,205}]}]

thank you very much

mod_multicast could not work with ejabberd 14.12

I've installed ejabberd 14.12 on my server, all the modules work well but mod_multicast always return service unavailable to clients

I've tested config mod multicast with:
empty option: mod_multicast: []
option with host: mod_multicast: "multicast.@host@"
option with host and access:
mod_multicast:
host: "multicast.@host@"
access: multicast (multicast defined before)

but when I start ejabberd, there's always error in error.log:
2015-03-12 17:44:53.900 [error] <0.800.0>@gen_mod:stop_module_keep_config:126 {noproc,{gen_server,call,['ejabberd_mod_multicast_unityappstudio.com',stop]}}
2015-03-12 17:44:53.904 [error] <0.800.0>@gen_mod:stop_module_keep_config:126 {noproc,{gen_server,call,[ejabberd_mod_multicast_localhost,stop]}}
2015-03-12 17:45:02.090 [error] <0.1496.0> CRASH REPORT Process <0.1496.0> with 0 neighbours exited with reason: bad argument in call to erlang:list_to_atom([101,106,97,98,98,101,114,100,95,111,100,98,99,95,115,117,112,95|<<"unityappstudio.com">>]) in gen_mod:get_module_proc/2 line 232 in application_master:init/4 line 133
2015-03-12 17:47:40.145 [error] <0.439.0> CRASH REPORT Process <0.439.0> with 0 neighbours exited with reason: no function clause matching mod_multicast:'-get_from_limitopts/2-lc$^0/1-0-'(undefined) line 1175 in gen_server:init_it/6 line 328
2015-03-12 17:47:40.229 [error] <0.528.0> CRASH REPORT Process <0.528.0> with 0 neighbours exited with reason: no function clause matching mod_multicast:'-get_from_limitopts/2-lc$^0/1-0-'(undefined) line 1175 in gen_server:init_it/6 line 328
When client try to access, they alaways receive Service unavailable

I do copy beam file from ebin folder of ejabberd, except ejabberd_c2s, ejabberd_sup, that's only way could make ejabberd server run
If I copy all of them without gen_mod.beam or with gen_mod.beam, all the case make server couldn't even start.

[15.03] mod_admin_extra srg_get_info output changed

Hi,

[root@central-server ejabberd]# ejabberdctl srg_get_info 'All\ Users' `hostname`
name    <<"All Users">>
displayed_groups    [<<"All Hypervisors">>,<<"All Virtual Machines">>]
description <<"Automatic group">>

why those <<>>> ??

On older version:

[root@server ~]#  ejabberdctl srg_get_info 'All\ Users' `hostname`
name    "All Users"
displayed_groups        ["All Hypervisors","All Virtual Machines"]
description     "Automatic group"

mod_mam does not start

Hey, I want to enable mod_mam on my server, but it does not start.

2015-04-07 17:17:12.559 [critical] <0.38.0>@gen_mod:start_module:90 Problem starting the module mod_mam for host <<"xmpp.ajs124.de">> 
 options: []
 error: undef
[{mod_mam,start,[<<"xmpp.ajs124.de">>,[]],[]},
 {gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,82}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1336}]},
 {ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,68}]},
 {application_master,start_it_old,4,
                     [{file,"application_master.erl"},{line,272}]}]
2015-04-07 17:17:12.560 [critical] <0.38.0>@gen_mod:start_module:95 ejabberd initialization was aborted because a module start failed.

My ejabberd version is 15.03 with erlang 17.4, as shipped by Arch Linux.

@weiss, do you have any idea what might be the problem here?

mod_webpresence crashing in 13.10

Everything was working great in 2.1.13.

After updating ejabberd to 13.10 mod_webpresence wasn't working so I thought maybe Erlang had to be upgraded so I built it from their latest as well. It still crashes though. ejabberd keeps running but some of the pages in the admin don't work and give off errors as well. I'm not sure if they are different or helpful so I will include errors from the initial starting of ejabberd and if you need those error logs then I can easily get those for you.

Current versions:
ejabberd 13.10 - I installed both ejabberd's from the pre-built binary .run files from http://www.process-one.net/en/ejabberd/downloads/

Erlang R16B02 (erts-5.10.3)
Eshell V5.10.3

Latest mod_webpresence from ejabberd-contrib master repo as of this moment. I rebuilt it just now with the above Erlang version just to make sure and it still is crashing with these errors.

From erlang.log

=CRASH REPORT==== 14-Oct-2013::19:46:43 ===
  crasher:
    initial call: mod_webpresence:init/1
    pid: <0.12675.0>
    registered_name: []
    exception exit: {badarg,
                        [{erlang,binary_to_list,["webpresence.@HOST@"],[]},
                         {ejabberd_regexp,greplace,3,
                             [{file,"src/ejabberd_regexp.erl"},{line,80}]},
                         {mod_webpresence,init,1,[]},
                         {gen_server,init_it,6,
                             [{file,"gen_server.erl"},{line,304}]},
                         {proc_lib,init_p_do_apply,3,
                             [{file,"proc_lib.erl"},{line,227}]}]}
      in function  gen_server:init_it/6 (gen_server.erl, line 328)
    ancestors: [ejabberd_sup,<0.12261.0>]
    messages: []
    links: [<0.12507.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 987
    stack_size: 24
    reductions: 235
  neighbours:

From error.log

2013-10-14 19:46:43.914 [error] <0.12675.0> CRASH REPORT Process <0.12675.0> with 0 neighbours exited with reason: bad argument in call to erlang:binary_to_list("webpresence.@HOST@") in ejabberd_regexp:greplace/3 line 80 in gen_server:init_it/6 line 328

From crash.log

2013-10-14 19:46:43 =CRASH REPORT====
  crasher:
    initial call: mod_webpresence:init/1
    pid: <0.12675.0>
    registered_name: []
    exception exit: {{badarg,[{erlang,binary_to_list,["webpresence.@HOST@"],[]},{ejabberd_regexp,greplace,3,[{file,"src/ejabberd_regexp.erl"},{line,80}]},{mod_webpresence,init,1,[]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,328}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
    ancestors: [ejabberd_sup,<0.12261.0>]
    messages: []
    links: [<0.12507.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 987
    stack_size: 24
    reductions: 235
  neighbours:

From ejabberd.cfg

  {5280, ejabberd_http, [
       {request_handlers,
       [
       {["presence"], mod_webpresence}
       ]},
       captcha,
       http_bind,
       http_poll
      ]},

  {mod_webpresence, [
    {access, local},
    {pixmaps_path, "/opt/ejabberd-13.10/lib/mod_webpresence/data/pixmaps"}
  ]}

[15.03] mod_admin_extra srg_create / srg_get_info inconsistency

Hi again :)

I try to use srg_* through XML-RPC and I got some issues for creating SRG.

Let's say I want to create a SRG from cmd line or python.

I need to provide every fields (except members): ID, name, description and display.

That's fine before I used to do that:

[root@server]# ejabberdctl srg_create test `hostname` test test \"\"
[root@server]# ejabberdctl srg_get_info test `hostname`
name    "test"
displayed_groups        []
description     "test"

and from python XML-RPC call:

{'informations': [{'information': [{'key': 'name'}, {'value': '"test"'}]}, {'information': [{'key': 'displayed_groups'}, {'value': '[]'}]}, {'information': [{'key': 'description'}, {'value': '"test"'}]}]}

With latest it give me this:

root@central-server vagrant]# ejabberdctl srg_create test `hostname` test test \"\"
[root@central-server vagrant]# ejabberdctl srg_get_info test `hostname`
name    test
displayed_groups
description test

and from python XML-RPC call:

{'informations': [{'information': [{'key': 'name'}, {'value': 'test'}]}, {'information': [{'key': 'displayed_groups'}, {'value': ''}]}, {'information': [{'key': 'description'}, {'value': 'test'}]}]}

More interesting:

Before:

[root@server]# ejabberdctl srg_create test `hostname` test test \"one\\ntwo\"
[root@server]# ejabberdctl srg_get_info test `hostname`
name    "test"
displayed_groups        ["one","two"]
description     "test"

Now:

[root@newserver]# ejabberdctl srg_create test `hostname` test test \"one\\ntwo\"
[root@newserver]# ejabberdctl srg_get_info test `hostname`
name    test
displayed_groups    onetwo
description test

The help page didn't change so much and I got the same result using the webUI, no more separator between displayed groups.

Best way to auth with mongodb?

I see there are many modules, is there anything to auth using mongodb?
I also can provide an http-service or write helper scripts if needed.

Don't force me into odbc please :)

buid module error and warnings

I have not experienced in erlang but I have next errors

Erlang R14B04 (erts-5.8.5) [source] [rq:1] [async-threads:0] [kernel-poll:false]
Eshell V5.8.5 (abort with ^G)

Master branch
deploy@wall:~/ejabberd-contrib/mod_webpresence$ ./build.sh
Recompile: ../ejabberd-dev/src/gen_mod
../ejabberd-dev/src/gen_mod.erl:49: bad attribute
../ejabberd-dev/src/gen_mod.erl:50: bad attribute

next I switched to branch 2.1.x
and tried recompile again

deploy@wall:~/ejabberd-contrib/mod_webpresence$ ./build.sh
Recompile: ../ejabberd-dev/src/gen_mod
../ejabberd-dev/src/gen_mod.erl:176: Warning: regexp:gsub/3: the regexp module is deprecated (will be removed in R15A); use the re module instead
../ejabberd-dev/src/gen_mod.erl:180: Warning: regexp:gsub/3: the regexp module is deprecated (will be removed in R15A); use the re module instead
Recompile: src/mod_webpresence
src/mod_webpresence.erl:670: Warning: regexp:gsub/3: the regexp module is deprecated (will be removed in R15A); use the re module instead
src/mod_webpresence.erl:671: Warning: regexp:gsub/3: the regexp module is deprecated (will be removed in R15A); use the re module instead

How it is can be fixed ?

mod_rest wont start on ejabberd 13

Hi, I've tried everything I can think of.. I've even recompiled ejabber, erlang, mod_rest, and doublechekced copied the mod_rest.beam to /lib/ejabberd/ebin to no avail:

when loaded as global module:

22:50:23.595 [critical] Problem starting the module mod_rest for host <<"localhost">>
options: []
error: undef
[{p1_logger,debug_msg,[mod_rest,43,"Starting: ~p ~p",[<<"localhost">>,[]]],[]},
{mod_rest,start,2,[{file,"src/mod_rest.erl"},{line,43}]},
{gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,70}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1323}]},
{ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,67}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,269}]}]
22:50:23.595 [critical] ejabberd initialization was aborted because a module start failed.

I'm running erlang 16b03-1 and ejabberd & ejabberd-contrib from master git

Also, when not loaded on global modules ie. only on vhosts. same thing... wont load + crashes:

23:00:11.051 [info] Application ejabberd started on node ejabberd@localhost
23:00:19.843 info Accepted connection {{ip_omitted},49516} -> {{ip_omitted},5285}
23:00:19.844 [debug] S: [{[<<"rest">>],mod_rest}]
23:00:19.845 [info] started: {gen_tcp,#Port<0.6761>}
23:00:19.845 debug http query: 'POST' /rest/
23:00:19.845 [debug] client data: <<"<message to="fulljid_omitted" from="localhost/rest">World">>
23:00:19.845 [debug] [<<"rest">>] matches [<<"rest">>]
23:00:19.845 [debug] [{'Content-Length',<<"90">>},{'Content-Type',<<"application/x-www-form-urlencoded">>},{'Connection',<<"Keep-Alive">>},{'Host',<<"localhost:5285">>},{'Accept',<<"/">>},{'User-Agent',<<"Wget/1.11.4 Red Hat modified">>}]

=CRASH REPORT==== 1-Mar-2014::23:00:19 ===
crasher:
initial call: ejabberd_http:init/2
pid: <0.661.0>
registered_name: []
exception throw: {module_must_be_started_in_vhost,mod_rest,
<<"localhost">>}
in function mod_rest:try_get_option/3 (src/mod_rest.erl, line 112)
in call from mod_rest:check_member_option/3 (src/mod_rest.erl, line 127)
in call from mod_rest:process/2 (src/mod_rest.erl, line 56)
in call from ejabberd_http:process/2 (src/ejabberd_http.erl, line 356)
in call from ejabberd_http:process_request/1 (src/ejabberd_http.erl, line 462)
in call from ejabberd_http:process_header/2 (src/ejabberd_http.erl, line 288)
in call from ejabberd_http:receive_headers/1 (src/ejabberd_http.erl, line 182)
ancestors: [ejabberd_http_sup,ejabberd_sup,<0.40.0>]
messages: []
links: [<0.339.0>,#Port<0.6761>]
dictionary: []
trap_exit: false
status: running
heap_size: 1598
stack_size: 27
reductions: 3569
neighbours:

No idea how to fix it!

mod_muc_admin: rooms_unused_destroy yields stacktrace

On ejabberd-14.05 and the latest version of mod_muc_admin, the commands rooms_unused_destroy and rooms_unused_list fail and print the following stacktrace:

root@host: ~ $ ejabberdctl rooms_unused_destroy jabber.at 14
Problem 'error {badrecord,config}' occurred executing the command.
Stacktrace: [{mod_muc_admin,decide_room,2,
                            [{file,"src/mod_muc_admin.erl"},{line,581}]},
             {lists,'-filter/2-lc$^0/1-0-',2,[{file,"lists.erl"},{line,1220}]},
             {mod_muc_admin,muc_unused2,4,
                            [{file,"src/mod_muc_admin.erl"},{line,537}]},
             {mod_muc_admin,rooms_unused_report,3,
                            [{file,"src/mod_muc_admin.erl"},{line,524}]},
             {ejabberd_ctl,call_command,3,
                           [{file,"src/ejabberd_ctl.erl"},{line,293}]},
             {ejabberd_ctl,try_call_command,3,
                           [{file,"src/ejabberd_ctl.erl"},{line,269}]},
             {ejabberd_ctl,process2,3,
                           [{file,"src/ejabberd_ctl.erl"},{line,218}]},
             {ejabberd_ctl,process,1,
                           [{file,"src/ejabberd_ctl.erl"},{line,203}]}]

Other commands I tried (get_room_affiliation, get_room_occupants, muc_online_rooms, get_room_occupants_number) seem to work fine.

Fix operator precedence in mod_logxml rotation calculus

calc_div(A, B) when is_integer(A) and is_integer(B) and B =/= 0 ->
A/B;
calc_div(_A, _B) ->
0.5. %% This ensures that no rotation is performed

The calc_div function always gonna give back 0.5 and ensures no rotation is performed :(

The function must be
calc_div(A, B) when is_integer(A) and is_integer(B), B =/= 0 ->
A/B;

[fix] mod_xmlrpc does not compile

Looks there was an include missing

diff --git a/mod_xmlrpc/src/mod_xmlrpc.erl b/mod_xmlrpc/src/mod_xmlrpc.erl
index a469ceb..263144b 100644
--- a/mod_xmlrpc/src/mod_xmlrpc.erl
+++ b/mod_xmlrpc/src/mod_xmlrpc.erl
@@ -19,6 +19,7 @@
 -include("ejabberd.hrl").
 -include("mod_roster.hrl").
 -include("jlib.hrl").
+-include("logger.hrl").

 -define(PROCNAME, ejabberd_mod_xmlrpc).

Cannot compile mod_muc_admin

While trying to install the module 'mod_muc_admin' with ejabberd 15.03, I'm getting the following error:

$ ejabberdctl module_install mod_muc_admin
/opt/ejabberd/lib/ejabberd-15.03/include/mod_muc_room.hrl:31: referring to built-in type queue as a remote type; please take out the module name
/opt/ejabberd/lib/ejabberd-15.03/include/mod_muc_room.hrl:64: referring to built-in type set as a remote type; please take out the module name
/opt/ejabberd/lib/ejabberd-15.03/include/mod_muc_room.hrl:97: referring to built-in type dict as a remote type; please take out the module name
/opt/ejabberd/lib/ejabberd-15.03/include/mod_muc_room.hrl:99: referring to built-in type dict as a remote type; please take out the module name
/opt/ejabberd/lib/ejabberd-15.03/include/mod_muc_room.hrl:100: referring to built-in type dict as a remote type; please take out the module name
/opt/ejabberd/lib/ejabberd-15.03/include/mod_muc_room.hrl:101: referring to built-in type dict as a remote type; please take out the module name
/opt/ejabberd/lib/ejabberd-15.03/include/mod_muc_room.hrl:108: referring to built-in type queue as a remote type; please take out the module name
Error: {compilation_failed,"src/mod_muc_admin.erl"}

I'm running the following version of erlang:

Eshell V5.10.4  (abort with ^G)
1> erlang:system_info(otp_release).
"R16B03-1"

What is wrong here?

message archiving support for ejabberd 14.07?

any module that supports archiving chat history for ejabberd version 14.07?
is there any alternative to mod_archive_odbc and mod_archive2 since both are now deprecated.

Any help?

mod_admin_extra add_rosteritem not working

With a freshly installed ejabberd-13.12 (from binary installer) and the latest mod_admin_extra installed from this git repo, the command add_rosteritem fails:

$ ejabberdctl add_rosteritem user30 localhost user31 localhost user31 friends both
Problem 'error function_clause' occurred executing the command.
Stacktrace: [{jlib,jid_to_string,[error],[{file,"src/jlib.erl"},{line,250}]},
             {mod_admin_extra,build_roster_item,3,
                              [{file,"src/mod_admin_extra.erl"},{line,1207}]},
             {mod_admin_extra,subscribe,8,
                              [{file,"src/mod_admin_extra.erl"},{line,1083}]},
             {mod_admin_extra,add_rosteritem,7,
                              [{file,"src/mod_admin_extra.erl"},{line,1067}]},
             {ejabberd_ctl,call_command,3,
                           [{file,"src/ejabberd_ctl.erl"},{line,294}]},
             {ejabberd_ctl,try_call_command,3,
                           [{file,"src/ejabberd_ctl.erl"},{line,270}]},
             {ejabberd_ctl,process2,3,
                           [{file,"src/ejabberd_ctl.erl"},{line,219}]},
             {ejabberd_ctl,process,1,
                           [{file,"src/ejabberd_ctl.erl"},{line,204}]}]

Both users exist in localhost server, and mod_extra_admin is configured in the config file with this line: {mod_admin_extra, []},

The problem also affects delete_rosteritem.

I think the problem is around the lines 357-373 of the file mod_admin_extra.erl, where strings are used instead of binary. However I tried changing them without success (I am no Erlang expert at all!). Anybody can help?

mod_multicast could not work on ejabberd 2.1.11

I am running ejabberd 2.1.11 on CentOS 5.4. I have compile mod_multicast and create 5 beam files:

mod_muc_room.beam
mod_multicast.beam
ejabberd_c2s.beam
ejabberd_router_multicast.beam
ejabberd_sup.beam

BUT, If I copy ejabberd_c2s.beam to ejabberd's ebin directory, I could never connect server with xmpp client after serverrestarted. The erlang.log show the error:

==> /usr/local/ejabberd-2.1.11/logs/ejabberd.log <==    

=INFO REPORT==== 2013-09-13 14:31:27 ===    
I(<0.470.0>:ejabberd_listener:281) : (#Port<0.4234>) Accepted connection {{36,40,63,157},53449} -> {{42,96,170,200},5222}    

=ERROR REPORT==== 2013-09-13 14:31:28 ===    
** State machine <0.549.0> terminating    
** Last event in was {xmlstreamstart,"stream:stream",    
                                     [{"xmlns","jabber:client"},    
                                      {"xmlns:stream",    
                                       "http://etherx.jabber.org/streams"},    
                                      {"version","1.0"},    
                                      {"to","chatapp.yunhuiju.com"}]}    
** When State == wait_for_stream    
**      Data  == {state,{socket_state,gen_tcp,#Port<0.4234>,<0.548.0>},    
                        ejabberd_socket,#Ref<0.0.0.11421>,"291991729",    
                        undefined,c2s,c2s_shaper,false,true,false,false,    
                        [{certfile,"/usr/local/ejabberd-2.1.11/conf/server.pem"}],    
                        false,undefined,[],"yunxin.yunhuiju.com",[],undefined,    
                        {0,nil},    
                        {0,nil},    
                        {0,nil},    
                        {0,nil},    
                        undefined,undefined,undefined,false,none,    
                        {{36,40,63,157},53449},    
                        undefined}    
** Reason for termination =    
** {'function not exported',[{cyrsasl,server_new,    
                                      ["jabber","chatapp.yunhuiju.com",[],[],    
                                       #Fun<ejabberd_c2s.1.34232338>,    
                                       #Fun<ejabberd_c2s.2.77548378>]},    
                             {ejabberd_c2s,wait_for_stream,2},    
                             {gen_fsm,handle_msg,7},    
                             {proc_lib,init_p_do_apply,3}]}    

==> /usr/local/ejabberd-2.1.11/logs/erlang.log <==    

=CRASH REPORT==== 13-Sep-2013::14:31:28 ===    
  crasher:    
    initial call: ejabberd_c2s:init/1    
    pid: <0.549.0>    
    registered_name: []    
    exception exit: {undef,[{cyrsasl,server_new,    
                                     ["jabber","chatapp.yunhuiju.com",[],[],    
                                      #Fun<ejabberd_c2s.1.34232338>,    
                                      #Fun<ejabberd_c2s.2.77548378>]},    
                            {ejabberd_c2s,wait_for_stream,2},    
                            {gen_fsm,handle_msg,7},    
                            {proc_lib,init_p_do_apply,3}]}    
      in function  gen_fsm:terminate/7    
    ancestors: [ejabberd_c2s_sup,ejabberd_sup,<0.37.0>]    
    messages: [{'$gen_event',closed},    
                  {'DOWN',#Ref<0.0.0.11421>,process,<0.548.0>,normal}]    
    links: [<0.266.0>]    
    dictionary: []    
    trap_exit: false    
    status: running    
    heap_size: 987    
    stack_size: 24    
    reductions: 1119    
  neighbours:    

=SUPERVISOR REPORT==== 13-Sep-2013::14:31:28 ===    
     Supervisor: {local,ejabberd_c2s_sup}    
     Context:    child_terminated    
     Reason:     {undef,[{cyrsasl,server_new,    
                                  ["jabber","chatapp.yunhuiju.com",[],[],    
                                   #Fun<ejabberd_c2s.1.34232338>,    
                                   #Fun<ejabberd_c2s.2.77548378>]},    
                         {ejabberd_c2s,wait_for_stream,2},    
                         {gen_fsm,handle_msg,7},    
                         {proc_lib,init_p_do_apply,3}]}    
     Offender:   [{pid,<0.549.0>},    
                  {name,undefined},    
                  {mfargs,{ejabberd_c2s,start_link,undefined}},    
                  {restart_type,temporary},    
                  {shutdown,brutal_kill},    
                  {child_type,worker}]    


==> /usr/local/ejabberd-2.1.11/logs/ejabberd.log <==    

=INFO REPORT==== 2013-09-13 14:31:29 ===    
I(<0.470.0>:ejabberd_listener:281) : (#Port<0.4236>) Accepted connection {{36,40,63,157},53450} -> {{42,96,170,200},5222}    

=ERROR REPORT==== 2013-09-13 14:31:29 ===    
** State machine <0.551.0> terminating    
** Last event in was {xmlstreamstart,"stream:stream",    
                                     [{"xmlns","jabber:client"},    
                                      {"xmlns:stream",    
                                       "http://etherx.jabber.org/streams"},    
                                      {"version","1.0"},    
                                      {"to","chatapp.yunhuiju.com"}]}    
** When State == wait_for_stream    
**      Data  == {state,{socket_state,gen_tcp,#Port<0.4236>,<0.550.0>},    
                        ejabberd_socket,#Ref<0.0.0.11430>,"1978753236",    
                        undefined,c2s,c2s_shaper,false,true,false,false,    
                        [{certfile,"/usr/local/ejabberd-2.1.11/conf/server.pem"}],    
                        false,undefined,[],"yunxin.yunhuiju.com",[],undefined,    
                        {0,nil},    
                        {0,nil},    
                        {0,nil},    
                        {0,nil},    
                        undefined,undefined,undefined,false,none,    
                        {{36,40,63,157},53450},    
                        undefined}    
** Reason for termination =    
** {'function not exported',[{cyrsasl,server_new,    
                                      ["jabber","chatapp.yunhuiju.com",[],[],    
                                       #Fun<ejabberd_c2s.1.34232338>,    
                                       #Fun<ejabberd_c2s.2.77548378>]},    
                             {ejabberd_c2s,wait_for_stream,2},    
                             {gen_fsm,handle_msg,7},    
                             {proc_lib,init_p_do_apply,3}]}    

==> /usr/local/ejabberd-2.1.11/logs/erlang.log <==    

=CRASH REPORT==== 13-Sep-2013::14:31:29 ===    
  crasher:    
    initial call: ejabberd_c2s:init/1    
    pid: <0.551.0>    
    registered_name: []    
    exception exit: {undef,[{cyrsasl,server_new,    
                                     ["jabber","chatapp.yunhuiju.com",[],[],    
                                      #Fun<ejabberd_c2s.1.34232338>,    
                                      #Fun<ejabberd_c2s.2.77548378>]},    
                            {ejabberd_c2s,wait_for_stream,2},    
                            {gen_fsm,handle_msg,7},    
                            {proc_lib,init_p_do_apply,3}]}    
      in function  gen_fsm:terminate/7    
    ancestors: [ejabberd_c2s_sup,ejabberd_sup,<0.37.0>]    
    messages: [{'$gen_event',closed},    
                  {'DOWN',#Ref<0.0.0.11430>,process,<0.550.0>,normal}]    
    links: [<0.266.0>]    
    dictionary: []    
    trap_exit: false    
    status: running    
    heap_size: 987    
    stack_size: 24    
    reductions: 1133    
  neighbours:    

=SUPERVISOR REPORT==== 13-Sep-2013::14:31:29 ===    
     Supervisor: {local,ejabberd_c2s_sup}    
     Context:    child_terminated    
     Reason:     {undef,[{cyrsasl,server_new,    
                                  ["jabber","chatapp.yunhuiju.com",[],[],    
                                   #Fun<ejabberd_c2s.1.34232338>,    
                                   #Fun<ejabberd_c2s.2.77548378>]},    
                         {ejabberd_c2s,wait_for_stream,2},    
                         {gen_fsm,handle_msg,7},    
                         {proc_lib,init_p_do_apply,3}]}    
     Offender:   [{pid,<0.551.0>},    
                  {name,undefined},    
                  {mfargs,{ejabberd_c2s,start_link,undefined}},    
                  {restart_type,temporary},    
                  {shutdown,brutal_kill},    
                  {child_type,worker}]    

please help me, what's the problem, and how can i make it works?

my mod_multicast is checked out from:
https://github.com/processone/ejabberd-contrib/tree/master/mod_multicast

Thanks!

mod_archive_odbc not working with postgresql

Hi,

I have a setup with ejabberd 2.1.10 and postgresql 9.3. I'm using branch 2.1.x for ejabberd-contrib. I'm getting this error when accessing archive collection over xmpp protocol.

postgresql_1 | ERROR:  date/time field value out of range: "0000-01-01 00:00:00" at character 172
postgresql_1 | STATEMENT:  select count(*) from archive_collections where us = '[email protected]' and deleted = 0 and with_server = 'chat.local' and with_user = 'username' and utc >= '0000-01-01 00:00:00'  and utc < '2038-01-19 00:00:00'
ejabberd_1   |
ejabberd_1   | =ERROR REPORT==== 13-Dec-2014::08:49:48 ===
ejabberd_1   | E(<0.381.0>:mod_archive_odbc:2428) : failed transaction: {aborted,
ejabberd_1   |                                                           {{badmatch,
ejabberd_1   |                                                             {aborted,[]}},
ejabberd_1   |                                                            [{mod_archive_odbc,
ejabberd_1   |                                                              get_collections_links_count_tmpl,
ejabberd_1   |                                                              6},
ejabberd_1   |                                                             {mod_archive_odbc,
ejabberd_1   |                                                              get_collections_links,
ejabberd_1   |                                                              4},
ejabberd_1   |                                                             {mod_archive_odbc,
ejabberd_1   |                                                              '-process_local_iq_list/3-fun-1-',
ejabberd_1   |                                                              4},
ejabberd_1   |                                                             {ejabberd_odbc,
ejabberd_1   |                                                              outer_transaction,
ejabberd_1   |                                                              3},
ejabberd_1   |                                                             {ejabberd_odbc,
ejabberd_1   |                                                              run_sql_cmd,4},
ejabberd_1   |                                                             {p1_fsm,
ejabberd_1   |                                                              handle_msg,10},
ejabberd_1   |                                                             {proc_lib,
ejabberd_1   |                                                              init_p_do_apply,
ejabberd_1   |                                                              3}]}}, stack: {backtrace,
ejabberd_1   |                                                                             <<"Program counter: 0x00007f50fe8261f8 (unknown function)\nCP: 0x00007f50f548ff78 (mod_archive_odbc:run_sql_transaction/2 + 408)\n\n0x00007f50f5a75d90 Return addr 0x00007f50f547b208 (mod_archive_odbc:process_local_iq/3 + 656)\ny(0)     {aborted,{{badmatch,{aborted,[]}},[{mod_archive_odbc,get_collections_links_count_tmpl,6},{mod_archive_odbc,get_collections_links,4},{mod_archive_odbc,'-process_local_iq_list/3-fun-1-',4},{ejabberd_odbc,outer_transaction,3},{ejabberd_odbc,run_sql_cmd,4},{p1_fsm,handle_msg,10},{proc_lib,init_p_do_apply,3}]}}\n\n0x00007f50f5a75da0 Return addr 0x00007f50fe81e660 (gen_iq_handler:process_iq/6 + 144)\ny(0)     []\ny(1)     {iq,\"1:list\",get,\"urn:xmpp:archive\",[],{xmlelement,\"list\",[{\"xmlns\",\"urn:xmpp:archive\"},{\"with\",\"[email protected]\"}],[]}}\ny(2)     []\ny(3)     Catch 0x00007f50f547b208 (mod_archive_odbc:process_local_iq/3 + 656)\ny(4)     {xmlelement,\"list\",[{\"xmlns\",\"urn:xmpp:archive\"},{\"with\",\"[email protected]\"}],[]}\n\n0x00007f50f5a75dd0 Return addr 0x00007f50fe81eac8 (gen_iq_handler:handle_info/2 + 264)\ny(0)     {jid,\"username\",\"chat.local\",[],\"username\",\"chat.local\",[]}\ny(1)     {jid,\"usernmae\",\"chat.local\",\"bosh_3229\",\"username\",\"chat.local\",\"bosh_3229\"}\ny(2)     Catch 0x00007f50fe81e660 (gen_iq_handler:process_iq/6 + 144)\n\n0x00007f50f5a75df0 Return addr 0x00007f50fb5354d0 (gen_server:handle_msg/5 + 1680)\ny(0)     {state,\"chat.local\",mod_archive_odbc,process_iq}\n\n0x00007f50f5a75e00 Return addr 0x00007f50fb4d0350 (proc_lib:init_p_do_apply/3 + 56)\ny(0)     gen_iq_handler\ny(1)     {state,\"chat.local\",mod_archive_odbc,process_iq}\ny(2)     <0.381.0>\ny(3)     <0.208.0>\ny(4)     {process_iq,{jid,\"username\",\"chat.local\",\"bosh_3229\",\"username\",\"chat.local\",\"bosh_3229\"},{jid,\"username\",\"chat.local\",[],\"username\",\"chat.local\",[]},{iq,\"1:list\",get,\"urn:xmpp:archive\",[],{xmlelement,\"list\",[{\"xmlns\",\"urn:xmpp:archive\"},{\"with\",\"[email protected]\"}],[]}}}\ny(5)     Catch 0x00007f50fb5354d0 (gen_server:handle_msg/5 + 1680)\n\n0x00007f50f5a75e38 Return addr 0x000000000082ad68 (<terminate process normally>)\ny(0)     Catch 0x00007f50fb4d0370 (proc_lib:init_p_do_apply/3 + 88)\n">>}

mod_admin_extra get_vcard and set_vcard not working

I just installed mod_admin_extra into a fresh install of ejabberd 13.12.
My modules configuration are:

mod_vcard: {}
mod_admin_extra: {}

When I try to get ou set Vcards I got those erros:

set_vcard admin localhost nickname teste

Problem 'error {badmatch,[]}' occurred executing the command. Stacktrace: [{mod_admin_extra,set_vcard_content,4, [{file,"src/mod_admin_extra.erl"},{line,1019}]}, {ejabberd_ctl,call_command,3, [{file,"src/ejabberd_ctl.erl"},{line,294}]}, {ejabberd_ctl,try_call_command,3, [{file,"src/ejabberd_ctl.erl"},{line,270}]}, {ejabberd_ctl,process2,3, [{file,"src/ejabberd_ctl.erl"},{line,219}]}, {ejabberd_ctl,process,1, [{file,"src/ejabberd_ctl.erl"},{line,204}]}, {rpc,'handle_call_call/6-fun-0',5, [{file,"rpc.erl"},{line,203}]}]

get_vcard admin localhost nickname

Problem 'error {badmatch,[]} ' occurred executing the command. Stacktrace: [{mod_admin_extra,get_vcard_content,3, [ {file,"src/mod_admin_extra.erl"},{line,975}]}, {mod_admin_extra,get_vcard,3, [{file,"src/mod_admin_extra.erl"} , {line,948} ]}, {ejabberd_ctl,call_command,3, [ {file,"src/ejabberd_ctl.erl"},{line,294}]}, {ejabberd_ctl,try_call_command,3, [{file,"src/ejabberd_ctl.erl"} , {line,270} ]}, {ejabberd_ctl,process2,3, [ {file,"src/ejabberd_ctl.erl"},{line,219}]}, {ejabberd_ctl,process,1, [{file,"src/ejabberd_ctl.erl"} , {line,204} ]}, {rpc,'handle_call_call/6-fun-0',5, [ {file,"rpc.erl"} , {line,203} ]}]

I went down to the source Code and the two stacks point to the same line:
[{_, Module, Function, _Opts}] = ets:lookup(sm_iqtable, {?NS_VCARD, Server}),
I don't have any experience with erlang or ejabberd, but it seems something easy to Fix. With someone can point me the away, maybe I can provide provide a path

mod_multicast incompatibility with ejabberd master

CRASH REPORT Process <0.372.0> with 0 neighbours exited with reason: call to undefined function gen_mod:get_module_opt(<<"abc.net">>, mod_muc, max_users, 200) in gen_fsm:init_it/6 line 379
2014-04-24 20:50:42.385 [error] <0.365.0> Supervisor 'ejabberd_mod_muc_sup_abc.net' had child undefined started with {mod_muc_room,start_link,undefined} at <0.372.0> exit with reason call to undefined function gen_mod:get_module_opt(<<"abc.net">>, mod_muc, max_users, 200) in context child_terminated
2014-04-24 20:50:42.388 [error] <0.366.0> CRASH REPORT Process <0.366.0> with 0 neighbours exited with reason: no match of right hand value {error,{undef,[{gen_mod,get_module_opt,[<<"abc.net">>,mod_muc,max_users,200],[]},{mod_muc_room,set_opts,2,[]},{mod_muc_room,init,1,[]},{gen_fsm,init_it,6,[{file,"gen_fsm.erl"},{line,361}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}} in mod_muc:'-load_permanent_rooms/5-fun-0-'/6 line 643 in gen_server:init_it/6 line 328
2014-04-24 20:50:42.444 [error] <0.411.0> CRASH REPORT Process <0.411.0> with 0 neighbours exited with reason: no function clause matching mod_multicast:'-get_from_limitopts/2-lc$^0/1-0-'(undefined, local) in gen_server:init_it/6 line 328
2014-04-24 20:50:44.070 [error] <0.451.0> CRASH REPORT Process <0.451.0> with 0 neighbours exited with reason: call to undefined function ejabberd_config:get_global_option(hosts) in gen_fsm:init_it/6 line 379
2014-04-24 20:50:44.072 [error] <0.331.0> Supervisor ejabberd_c2s_sup had child undefined started with {ejabberd_c2s,start_link,undefined} at <0.451.0> exit with reason call to undefined function ejabberd_config:get_global_option(hosts) in context child_terminated
2014-04-24 20:50:44.224 [error] <0.453.0> CRASH REPORT Process <0.453.0> with 0 neighbours exited with reason: call to undefined function ejabberd_config:get_global_option(hosts) in gen_fsm:init_it/6 line 379
2014-04-24 20:50:44.225 [error] <0.331.0> Supervisor ejabberd_c2s_sup had child undefined started with {ejabberd_c2s,start_link,undefined} at <0.453.0> exit with reason call to undefined function ejabberd_config:get_global_option(hosts) in context child_terminated
2014-04-24 20:50:49.066 [error] <0.458.0> CRASH REPORT Process <0.458.0> with 0 neighbours exited with reason: call to undefined function ejabberd_config:get_global_option(hosts) in gen_fsm:init_it/6 line 379
2014-04-24 20:50:49.067 [error] <0.331.0> Supervisor ejabberd_c2s_sup had child undefined started with {ejabberd_c2s,start_link,undefined} at <0.458.0> exit with reason call to undefined function ejabberd_config:get_global_option(hosts) in context child_terminated
2014-04-24 20:50:49.234 [error] <0.460.0> CRASH REPORT Process <0.460.0> with 0 neighbours exited with reason: call to undefined function ejabberd_config:get_global_option(hosts) in gen_fsm:init_it/6 line 379
2014-04-24 20:50:49.235 [error] <0.331.0> Supervisor ejabberd_c2s_sup had child undefined started with {ejabberd_c2s,start_link,undefined} at <0.460.0> exit with reason call to undefined function ejabberd_config:get_global_option(hosts) in context child_terminated

ABOVE IS MY CRASH LOG...COULD ANY ONE POINT OUT WHATS HAPPENEING .....

my ejab version-13.12
Erlang versin - R16B03
Machine - Linux CentOS
mod_multicast tried version both master and 2.1.x

Badlop could you intervene here ....?

Report problem when mod_rest receives malformed stanza

When i deploy my ejabberd server with mod_rest listening in port 5285 and receive a stanza with characters like '<' or '&', the server crashes.

For example,

POST http://localhost:5285/rest

BODY:

<message
    to='1@localhost'
    from='2@localhost'
    type='chat'
    xml:lang='en'>
  <body><</body>
</message>

Throws an exception in ejabberd:

2015-01-09 15:04:34.929 [error] <0.1523.0> CRASH REPORT Process <0.1523.0> with 0 neighbours crashed with reason: no function clause matching xml:get_tag_attr_s(<<"from">>, {error,{4,<<"not well-formed (invalid token)">>}}) line 362

I guess it has to do with the fact that those characters are XML-reserved ones.

Is there a quick fix to this issue?

Build and run ejabberd_xmlrpc with ejabberd-13

I can build and start ejabberd_xmlrpc with

  1. add
    -include ("logger.hrl").
  2. add function
    get_opt(Opt, Opts, Default) ->
    case lists:keysearch(Opt, 1, Opts) of
    false ->
    Default;
    {value, {_, Val}} ->
    Val
    end.
    3.change function calls
    from
    gen_mod:get_opt (...)
    to
    get_opt(...)

in src/ejabberd_xmlrpc.erl

After that ejabberd_xmlrc can be compiled , deployed and started on ejabberd-server.

But when i try to call xml-rpc (i.e from erl-console ) - module crashed with errors:
on console:
1> xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, echothis, [800]}).
{error,"HTTP/1.1 400 Bad Request\r\n"}
2>

in error.log
2013-11-13 19:43:02.784 [error] <0.4362.0> {xmlrpc_http,137,{xmlrpc_decode,payload,"echothis800",{undef,[{xmerl_scan,string,["echothis800",[{encoding,latin1}]],[]},{xmlrpc_decode,payload,1,[{file,"src/xmlrpc_decode.erl"},{line,34}]},{xmlrpc_http,handle_payload,5,[{file,"src/xmlrpc_http.erl"},{line,131}]},{tcp_serv,start_session,3,[{file,"src/tcp_serv.erl"},{line,135}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}}}

mod_multicast doesn't work with 2.1.13

--- a/mod_multicast/src/ejabberd_c2s.erl
+++ b/mod_multicast/src/ejabberd_c2s.erl
@@ -215,6 +215,10 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
                                          fun(U, P) ->
                                                  ejabberd_auth:check_password(
                                                    U, Server, P)
+                                         end,
+                                         fun(U, P, D, DG) ->
+                                                 ejabberd_auth:check_password(
+                                                   U, Server, P, D, DG)
                                          end),
                                    Mechs = lists:map(
                                              fun(S) ->

Just starting to use it, but it doesn't really work with 2.1.13. Can I ask which version it was built base?

mod_multicast strange error

My multicast service has just stop with a strange error, I can't find how to fix it :'( please help me to point this bug out.
The error message: gen_server 'ejabberd_mod_multicast_unityappstudio.com' terminated with reason: bad record jid in mod_multicast:'-group_dests/1-fun-0-'/2 line 519

fda752d6-d95d-11e4-87a8-6ab15786f9b7

This is copied from processone/ejabberd#506.

Fix display of Top.. statsdx pages in WebAdmin

  1. Module doesn't work correctly in webadmin. In global stats don't work (I have set hook as true):
  2. Top vCard sizes
  3. Sessions: Client
  4. Sessions: Operating System
  5. Sessions: Client/Operating System
  6. Sessions: Connection Type
  7. Sessions: Client/Connection Type
  8. Sessions: Languages
    This same is in each vhost.
  9. When we set hook to true or traffic in /var/log/ejabberd/error.log there are a lot of issues from this module. Problem doesn't exist when hook is set to false.

mod_admin_extra: add_rosteritem ignores "subs" parameter

After the fix of #22, in add_rosteritem, the last parameter (subs) seems to be ignored. E.g, if I execute ejabberdctl add_rosteritem user35 localhost user36 localhost user36 friends both, the roster item is created, but the subscription is set to "none" instead of "both":

$ ejabberdctl add_rosteritem user35 localhost user36 localhost user36 friends both
$ ejabberdctl get_roster user35 localhost
user36@localhost    user36  none    none    friends

Long-living sessions in MUC

Hi, I want to implement a Whatsapp-like multi user chat. To do so, I need to fool ejabberd to never close the user session and therefore prevent the user from leaving the room any time he disconnects.

It would be easy to implement such functionality? My experience in Erlang is basic, but I thing I can handle it. It would be nice if someone could give me a hint on where to start. I'm looking inside mod_muc.erl and mod_muc_room.erl but I didn't find anything yet.

Sorry, I didn't knew where to post this.

Thanks in advance!

mod_admin_extra error on srg_create

ejabberdctl srg_create group_sample localhost GroupSample GroupDescription group_sample
Problem 'error badarg' occurred executing the command.
Stacktrace: [{erlang,binary_to_list,["group_sample"],[]},
{ejabberd_regexp,split,2,
[{file,"src/ejabberd_regexp.erl"},{line,55}]},
{mod_admin_extra,srg_create,5,
[{file,"src/mod_admin_extra.erl"},{line,1319}]},
{ejabberd_ctl,call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,294}]},
{ejabberd_ctl,try_call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,270}]},
{ejabberd_ctl,process2,3,
[{file,"src/ejabberd_ctl.erl"},{line,219}]},
{ejabberd_ctl,process,1,
[{file,"src/ejabberd_ctl.erl"},{line,204}]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,205}]}]

mor_rest compatibility with ejabberd 14.12

Hi,

we have experienced problems while using mod_rest against last version of ejabberd,
it always returns - Try POSTing a stanza. It seems there are some changes between versions,
where new ejabberd uses another data type than current module.

Jaroslav

How to send a basic iq stanza

Hi, I am playing with this module and could be able to send register command and message stanza. However, I can't find a way to send other iq stanza like to get the roster from a user like

<iq from='[email protected]/balcony' type='get' id='roster_1'>
  <query xmlns='jabber:iq:roster'/>
</iq>

Ideas?

set_presence from mod_admin_extra giving issue with ejabber 14

Hi Guys,

I am trying to use set_presence from the ejabber-contrib and its giving me below issue

ejabberdctl set_presence userId localhost 1178385771421150488459725 subscribed dnd Im_away_25_minutes 127
Problem 'error undef' occurred executing the command.
Stacktrace: [{p1_logger,info_msg,
[mod_admin_extra,916,"Message : pn",
[{route_xmlstreamelement,
{xmlel,<<"presence">>,
[{<<"from">>,
"userId@localhost/1178385771421150488459725"},
{<<"to">>,
"userId@localhost"},
{<<"type">>,"subscribed"}],
[{xm=lel,<<"show">>,[],[{xmlcdata,"dnd"}]},
{xmlel,<<"status">>,[],
[{xmlcdata,"Im_away_25_minutes"}]},
{xmlel,<<"priority">>,[],[{xmlcdata,"127"}]}]}}]],
[]},
{mod_admin_extra,set_presence,7,
[{file,"src/mod_admin_extra.erl"},{line,916}]},
{ejabberd_ctl,call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,293}]},
{ejabberd_ctl,try_call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,269}]},
{ejabberd_ctl,process2,3,
[{file,"src/ejabberd_ctl.erl"},{line,218}]},
{ejabberd_ctl,process,1,
[{file,"src/ejabberd_ctl.erl"},{line,203}]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,205}]}]

Update mod_logsession to work with ejabberd master branch

I tried to use mod_logsession with ejabberd 14.05 and it doesn't work - ejabberd doesn't want to start, log:

23:57:14.981 [critical] Problem starting the module mod_logsession for host <<"mydomain.tld">> options: [] error: badarg [{re,replace, [undefined,"@HOST@",<<"mydomain.tld">>,[global,{return,list}]], [{file,"re.erl"},{line,282}]}, {mod_logsession,start,2,[{file,"src/mod_logsession.erl"},{line,61}]}, {gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,69}]}, {lists,foreach,2,[{file,"lists.erl"},{line,1262}]}, {ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,66}]}, {application_master,start_it_old,4, [{file,"application_master.erl"},{line,274}]}] 23:57:14.987 [critical] ejabberd initialization was aborted because a module start failed. Crash dump was written to: /var/log/ejabberd/erl_crash_20140617-235712.dump Problem starting the module mod_logsession for host <<"mydomain.tld">> options: [] error: badarg [{re,replace, [undefined,"@HOST@",<<"mydomain.tld">>,[global,{return,list}]], [{file,"r

Could You repair this module?

multicast crash

[error] <0.369.0> CRASH REPORT Process <0.369.0> with 0 neighbours exited with reason: no function clause matching mod_multicast:'-get_from_limitopts/2-lc$^0/1-0-'(undefined) line 1175 in gen_server:init_it/6 line 328

ejabberd version:14.07 , when start up the ejabberd, mod_multicast modules report the crash.

Some commands not working in mod_admin_extra like change_password

Hi @badlop
I have the latest ejabberd-contrib checkout and included module mod_admin_extra in my ejabberd server setup.
change_password command is not working

$ ./ejabberdctl change_password user 127.0.0.1 pwd

error.log output

[debug] <0.460.0>@ejabberd_commands:execute_command2:320 Executing command mod_admin_extra:set_password with Args=["user","127.0.0.1","pwd"]
[warning] <0.460.0>@ejabberd_config:get_option:621 Option {auth_method,error} has invalid (outdated?) format. This is likely a bug

I have also tried ejabberdctl with auth

$ ./ejabberdctl --auth rahul 127.0.0.1 mypasswd change_password user 127.0.0.1 pwd
still the same error in log.

Here is my ejabberd.cfg
Please take a look and guide me what is wrong here.
btw ejabberd version is 13.12

Thanks @badlop

mod_statsdx error after registering a new user

mod_statsdx still have some bugs. After registering a new user I see an error in log file:

2015-03-09 06:10:06.942 [error] <0.17775.21>@ejabberd_hooks:run1:315 {badarg,[{ets,update_counter,['mod_statsdx_domain.com',{register_user,server},1],[]},{mod_statsdx,register_user,2,[{file,"src/mod_statsdx.erl"},{line,218}]},{ejabberd_hooks,run1,3,[{file,"src/ejabberd_hooks.erl"},{line,311}]},{ejabberd_auth,try_register,3,[{file,"src/ejabberd_auth.erl"},{line,197}]},{mod_register,try_register,5,[{file,"src/mod_register.erl"},{line,385}]},{mod_register,try_register_or_set_password,9,[{file,"src/mod_register.erl"},{line,327}]},{mod_register,unauthenticated_iq_register,4,[{file,"src/mod_register.erl"},{line,82}]},{ejabberd_hooks,run_fold1,4,[{file,"src/ejabberd_hooks.erl"},{line,352}]}]}
running hook: {register_user,[<<"newuser">>,<<"domain.com">>]}

mod_archive (mysql) support in ejabberd v13.x

The current version of mod_archive does not successfully run with ejabberd v13.12.
when I choose mod_archive as a module in config it does not log any error but when I switch the module to support mod_archive_odbc ejabberd server won't start.
Question asked on SO

Is mod_archive does not support v13.x as ndl's mod_archive2 ?

  • If it does support then please provide help how I should do it.
  • If it does not then is there any other module in ur knowledge for archiving messages.

ejabberd-13.10: mod_log_chat not logging chat messages: chat messages from http_bind wont trigger user_send[recieve]_packet events.

Hi
I am using https://github.com/processone/ejabberd-contrib/blob/master/mod_log_chat/src/mod_log_chat.erl
Chat client is strophe.js
And have enabled the mod on config.
{mod_log_chat, []} under the modules sections in ejabberd.cfg

But I am not seeing the event hooks are triggered. So http-bind follow different path?
I thought these 2 events should still be triggered.
mod_http_bind; ejabberd_http_bind both does not seem to trigfer user_send_packet or user_receive_packet events....

send_message no longer stored for offline clients

We have a web registration interface and send a welcome message to new users. The users are of course at the time offline, since this happens directly at registration. We used to use the send_message_chat to send this message, since messages sent via send_message_headline were not stored by mod-offline.

We now updated to the latest ejabberd-contrib (as well as ejabberd 15.02), and the new send_message command introduced in #68 seems to never store messages when the user is offline. I tried the chat, normal and headline command, and the user never gets the message once he goes online. Is it possible to store messages as offline messages?

mod_logxml doesn`t work with 14.07

ejabberd fails to start

[critical] <0.37.0>@gen_mod:start_module:90 Problem starting the module mod_logxml for host <<"domain">>
options: [{stanza,message},
{direction,[internal,vhosts,external]},
{orientation,[send,recv]},
{logdir,<<"/var/log/ejabberd/logs/">>},
{timezone,local},
{show_ip,false},
{rotate_days,1},
{rotate_megs,1},
{rotate_kpackets,no},
{check_rotate_kpackets,1}]
error: badarith
[{mod_logxml,start,2,[{file,"src/mod_logxml.erl"},{line,32}]},
{gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,82}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1323}]},
{ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,67}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,269}]}]
2014-11-11 17:47:13.127 [critical] <0.37.0>@gen_mod:start_module:95 ejabberd initialization was aborted because a module start failed.

mod_admin_extra private_{s,g}et fail with {error,account_unprivileged}

I am using mod_admin_extra together with ejabberd_xmlrpc to perform some tasks on my users. I used to have an old server running ejabberd 2.13 and I switched to a new one where I use the upstream git version.
The new server runs Gentoo, hardened profile, kernel 3.15.10 with grsec and pax.

On my former server, I had no issue at all with private_set or private_get. But now, on the new one, both methods fail. Following is an example output log.

2015-01-21 21:28:32.378 [info] <0.662.0>@ejabberd_listener:accept:309 (#Port<0.6508>) Accepted connection 127.0.0.1:35238 -> 127.0.0.1:4560
2015-01-21 21:28:32.378 [debug] <0.1412.0>@ejabberd_http:init:150 S: [{[],ejabberd_xmlrpc}]
2015-01-21 21:28:32.378 [info] <0.1412.0>@ejabberd_http:init:154 started: {gen_tcp,#Port<0.6508>}
2015-01-21 21:28:32.378 [debug] <0.1412.0>@ejabberd_http:process_header:283 (#Port<0.6508>) http query: 'POST' /RPC2
2015-01-21 21:28:32.379 [debug] <0.1412.0>@ejabberd_http:process_request:448 client data: <<"<?xml version='1.0'?>\n<methodCall>\n<methodName>private_get</methodName>\n<params>\n<param>\n<value><struct>\n<member>\n<name>password</name>\n<value><string>XXX</string></value>\n</member>\n<member>\n<name>user</name>\n<value><string>autobot</string></value>\n</member>\n<member>\n<name>server</name>\n<value><string>m8wtf.eu</string></value>\n</member>\n</struct></value>\n</param>\n<param>\n<value><struct>\n<member>\n<name>host</name>\n<value><string>m8wtf.eu</string></value>\n</member>\n<member>\n<name>ns</name>\n<value><string>storage:bookmarks</string></value>\n</member>\n<member>\n<name>user</name>\n<value><string>stinger</string></value>\n</member>\n<member>\n<name>element</name>\n<value><string>storage</string></value>\n</member>\n</struct></value>\n</param>\n</params>\n</methodCall>\n">>
2015-01-21 21:28:32.379 [debug] <0.1412.0>@ejabberd_http:process:359 [<<"RPC2">>] matches []
2015-01-21 21:28:32.379 [debug] <0.1412.0>@ejabberd_http:process:363 [{'Content-Length',<<"790">>},{'Content-Type',<<"text/xml">>},{'User-Agent',<<"xmlrpclib.py/1.0.1 (by www.pythonware.com)">>},{'Accept-Encoding',<<"gzip">>},{'Host',<<"127.0.0.1:4560">>}]
2015-01-21 21:28:32.380 [debug] <0.1412.0>@ejabberd_xmlrpc:process:226 got XML-RPC request: {call,private_get,[{struct,[{password,<<"XXX">>},{user,<<"autobot">>},{server,<<"m8wtf.eu">>}]},{struct,[{host,<<"m8wtf.eu">>},{ns,<<"storage:bookmarks">>},{user,<<"stinger">>},{element,<<"storage">>}]}]}
2015-01-21 21:28:32.381 [debug] <0.355.0>@extauth:loop:120 extauth call '[<<"auth">>,<<"autobot">>,<<"m8wtf.eu">>,<<"XXX">>]' received data response:
[0,1]
2015-01-21 21:28:32.382 [warning] <0.1412.0>@ejabberd_xmlrpc:build_fault_response:362 Error -118
A problem '{error,account_unprivileged}' occurred executing the command private_get with arguments
[{host,<<"m8wtf.eu">>},
 {ns,<<"storage:bookmarks">>},
 {user,<<"stinger">>},
 {element,<<"storage">>}]

As one can see, I am using an external auth but this is not the problem here: that user has all rights. Here is what I have in my ejabberd.cfg (I know, YAML now is the way...):

{acl, rpc_m8wtf, {user, "autobot", "m8wtf.eu"}}
{access, rpc_m8wtf, [{allow, rpc_m8wtf}]}
{rpc_m8wtf, all, [{host, "m8wtf.eu"}]}

Then, the log from the external auth program is all good:

Jan 21 21:28:32 ns01 [email protected]: [INFO]   data received from ejabberd
Jan 21 21:28:32 ns01 [email protected]: [DEBUG]  Jabber bot trying to authenticate
Jan 21 21:28:32 ns01 [email protected]: [DEBUG]  sending a True value to ejabberd
Jan 21 21:28:32 ns01 [email protected]: [DEBUG]  reading 2 bytes from ejabberd

Furthermore, the same account is used for other processing, such as shared roster edition and works flawlessly.

Here is a minimal code snippet in Python to reproduce the error:

import xmlrpclib
ejab_auth = {'user': 'autobot', 'password': 'XXX', 'server': 'm8wtf.eu'}
ejabberd = xmlrpclib.ServerProxy('http://127.0.0.1:4560')
ejabberd.private_get(ejab_auth, {'user': 'stinger', 'host': 'm8wtf.eu', 'element': 'storage', 'ns': 'storage:bookmarks'})

(I'm not putting the error produced with Python as there is no extra info.)

I think this is related to mod_admin_extra, but it might come from ejabberd itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.