Giter Site home page Giter Site logo

processone / ejabberd Goto Github PK

View Code? Open in Web Editor NEW
5.9K 275.0 1.5K 41.72 MB

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)

Home Page: https://www.process-one.net/en/ejabberd/

License: Other

Shell 1.72% Erlang 94.29% Elixir 1.14% Python 0.03% Batchfile 0.01% Makefile 0.37% M4 0.35% CSS 0.19% JavaScript 0.02% Perl 0.57% Lua 0.01% TSQL 1.06% Dockerfile 0.01% PLpgSQL 0.26%
erlang xmpp jabber chat messaging sip voip iot pubsub broker

ejabberd's People

Contributors

alexeyshch avatar angelhof avatar badlop avatar benlangfeld avatar chaoskid42 avatar comradekingu avatar cromain avatar dependabot[bot] avatar erszcz avatar fotock avatar hamano avatar imax9000 avatar jbruechert avatar joudinet avatar jsautret avatar lemenkov avatar licaon-kter avatar lnjx avatar marcphilipp avatar mremond avatar nosnilmot avatar pouriya avatar prefiks avatar rraptorr avatar scrogson avatar sezuan avatar suchatorg avatar vesvalo avatar weiss 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  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

ejabberd's Issues

Trying to configure with Stun is throwing errors

EDIT:

Never mind, I realized that I was using the master copy from a zip file rather than then actual git clone.

sorry

Hi
I configure the script to compile with stun but make is throwing errors

" ./configure --enable-stun --enable-json"

/opt/erlang/r16/lib/erlang/bin/escript rebar skip_deps=true compile
==> rel (compile)
==> ejabberd-master (compile)
Dependency not available: p1_stun-.* ({git,"git://github.com/processone/stun"})
Dependency not available: jiffy-.* ({git,"git://github.com/davisp/jiffy"})
ERROR: compile failed while processing /media/mhddfs-raid/BUILD/ejabberd-master: rebar_abort
make: *** [src] Error 1

I am using the git master

thanks

external auth not working with master

I'm trying to see if a problem I'm having with shared resource groups and extauth with 2.1.x is fixed in master, but I'm having a hard time getting even the example extauth in the Developers Guide to work with master. The extauth script appears to be getting 0 bytes from ejabberd. This is with current master, erlang R16B01, and Python 2.6.6 on CentOS 6.4.

Here is my extauth script (auth4.py):

#!/usr/bin/python

import sys
import logging
from struct import *

sys.stderr = open('/var/log/ejabberd/extauth_err4.log', 'w')
logging.basicConfig(level=logging.INFO,
                    format='%(asctime)s %(levelname)s %(message)s',
                    filename='/var/log/ejabberd/extauth4.log',
                    filemode='a')

logging.info('extauth script started, waiting for ejabberd requests')

def from_ejabberd():
    input_length = sys.stdin.read(2)
    logging.info("Bytes read: " + str(len(input_length)))
    logging.info("Input Length: " + str(input_length))
    (size,) = unpack('>h', input_length)
    return sys.stdin.read(size).split(':')

def to_ejabberd(bool):
    answer = 0
    if bool:
        answer = 1
    token = pack('>hh', 2, answer)
    sys.stdout.write(token)
    sys.stdout.flush()

def auth(username, server, password):
    return True

def isuser(username, server):
    return True

def setpass(username, server, password):
    return True

while True:
    data = from_ejabberd()
    success = False
    if data[0] == "auth":
        success = auth(data[1], data[2], data[3])
    elif data[0] == "isuser":
        success = isuser(data[1], data[2])
    elif data[0] == "setpass":
        success = setpass(data[1], data[2], data[3])
    to_ejabberd(success)

And this is what I get in extauth4.log:

2013-06-25 13:42:12,974 INFO extauth script started, waiting for ejabberd requests
2013-06-25 13:42:12,977 INFO extauth script started, waiting for ejabberd requests
2013-06-25 13:42:15,205 INFO Bytes read: 0
2013-06-25 13:42:15,205 INFO Input Length: 
2013-06-25 13:42:54,190 INFO Bytes read: 0
2013-06-25 13:42:54,190 INFO Input Length: 

And this is what I get in extauth_err4.log:

Traceback (most recent call last):
  File "/etc/ejabberd/auth4.py", line 40, in <module>
    data = from_ejabberd()
  File "/etc/ejabberd/auth4.py", line 19, in from_ejabberd
    (size,) = unpack('>h', input_length)
struct.error: unpack requires a string argument of length 2

And finally, the two lines in my ejabberd.cfg for extauth:

{auth_method, external}.
{extauth_program, "/etc/ejabberd/auth4.py"}.

I have seen ejabberd apparently launch two instances of auth4.py at the same time, and occasionally I get two running instances of auth4.py, but not always. I am launching it with the ejabberd.init example in master. Is anyone seeing extauth work with recent master? Am I doing something wrong?

Shared Roster Group member presence not available until re-login

I'm having an issue where the presence information of a member in a shared roster group isn't available to its displayed group until the user logs out and logs back in.

For example, let's say both user-A and user-B are online. Now two shared roster groups are created using the web admin-- srg-A and srg-B. srg-A has user-A as its member and srg-B as its displayed group. srg-B has user-B as member and srg-A as displayed group. At this point, user-A cannot see the presence information for user-B and vice versa.

Now if I log out both user-A and user-B and re-login, user-A can see user-B as online and user-B can see user-A as online. Is there a way to send the presence without having to re-login? I see this issue with 2.1.x and current master using either external or internal auth. I'm running erlang R16B01, and Python 2.6.6 on CentOS 6.4. Has anybody else had this issue? I occasionally do get it to work without having to re-login, but it's pretty unreliable.

mod_http_fileserver not updated to work with binaries

In later builds of Ejabberd, the http_fileserver cashes and will not serve files.

I suspect that this is only when SSL39/SSL40 are not defined:

-ifdef(SSL40). -define(STRING2LOWER, string).
-else.
    -ifdef(SSL39). -define(STRING2LOWER, string).
    -else. -define(STRING2LOWER, httpd_util).

As :to_lower is a valid function for strings, not for httpd_utils.

 Extension = ?STRING2LOWER:to_lower(filename:extension(Filename)),

I don't know what SSL39 and 40 are, but I am using a self-signed SSL, and it is not helping at all.

Ejabberd.log:

=ERROR REPORT==== 2013-04-11 09:55:08 ===
** Generic server 'ejabberd_mod_http_fileserver_www.aviezri.org' terminating 
** Last message in was {serve,[<<"candy">>,<<"example">>,<<"index.html">>]}
** When Server state == {state,<<"www.aviezri.org">>,
                           <<"/home/samgoody/ejabberd/www">>,
                           <<"/home/samgoody/ejabberd/logs/access.log">>,
                           <0.668.0>,[],[],<<"application/octet-stream">>,
                           [{<<".css">>,<<"text/css">>},
                            {<<".gif">>,<<"image/gif">>},
                            {<<".html">>,<<"text/html">>},
                            {<<".jar">>,<<"application/java-archive">>},
                            {<<".jpeg">>,<<"image/jpeg">>},
                            {<<".jpg">>,<<"image/jpeg">>},
                            {<<".js">>,<<"text/javascript">>},
                            {<<".png">>,<<"image/png">>},
                            {<<".svg">>,<<"image/svg+xml">>},
                            {<<".txt">>,<<"text/plain">>},
                            {<<".xml">>,<<"application/xml">>},
                            {<<".xpi">>,<<"application/x-xpinstall">>},
                            {<<".xul">>,
                             <<"application/vnd.mozilla.xul+xml">>}]}
** Reason for termination == 
** {function_clause,
   [{string,to_lower,[<<".html">>],[{file,"string.erl"},{line,493}]},
    {mod_http_fileserver,content_type,3,
        [{file,"mod_http_fileserver.erl"},{line,454}]},
    {mod_http_fileserver,serve_file,5,
        [{file,"mod_http_fileserver.erl"},{line,369}]},
    {mod_http_fileserver,handle_call,3,
        [{file,"mod_http_fileserver.erl"},{line,266}]},
    {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,588}]},
    {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}

Erlang.log:

=SUPERVISOR REPORT==== 11-Apr-2013::10:20:15 ===
 Supervisor: {local,ejabberd_http_sup}
 Context:    child_terminated
 Reason:     {{function_clause,
                  [{string,to_lower,
                       [<<".html">>],
                       [{file,"string.erl"},{line,493}]},
                   {mod_http_fileserver,content_type,3,
                       [{file,"mod_http_fileserver.erl"},{line,454}]},
                   {mod_http_fileserver,serve_file,5,
                       [{file,"mod_http_fileserver.erl"},{line,369}]},
                   {mod_http_fileserver,handle_call,3,
                       [{file,"mod_http_fileserver.erl"},{line,266}]},
                   {gen_server,handle_msg,5,
                       [{file,"gen_server.erl"},{line,588}]},
                   {proc_lib,init_p_do_apply,3,
                       [{file,"proc_lib.erl"},{line,239}]}]},
              {gen_server,call,
                  ['ejabberd_mod_http_fileserver_www.aviezri.org',
                   {serve,[<<"candy">>,<<"example">>,<<"index.html">>]}]}}
 Offender:   [{pid,<0.1384.0>},
              {name,undefined},
              {mfargs,{ejabberd_http,start_link,undefined}},
              {restart_type,temporary},
              {shutdown,brutal_kill},
              {child_type,worker}]


=PROGRESS REPORT==== 11-Apr-2013::10:20:15 ===
      supervisor: {local,ejabberd_sup}
         started: [{pid,<0.1385.0>},
                   {name,'ejabberd_mod_http_fileserver_www.aviezri.org'},
                   {mfargs,
                       {mod_http_fileserver,start_link,
                           [<<"www.aviezri.org">>,
                            [{docroot,<<"/home/samgoody/ejabberd/www">>},
                             {accesslog,
                                 <<"/home/samgoody/ejabberd/logs/access.log">>}]]}},
                   {restart_type,transient},
                   {shutdown,1000},
                   {child_type,worker}]

Error in mod_vcard_odbc with PostgreSQL and Unicode

After commit ee968b5 mod_vcard_odbc is broken to use unicode with postgres.
If try to store unicode chars in vcard it's fail with errors like.

=ERROR REPORT==== 2012-02-14 13:04:11 ===
E(<0.232.0>:ejabberd_odbc:395) : SQL transaction restarts exceeded
** Restarts: 10
** Last abort reason: [{severity,'ERROR'},
{code,"22021"},
{message,"invalid byte sequence for encoding "UTF8": 0xf092f0bb"},
{file,"wchar.c"},
{line,1613},
{routine,"report_invalid_encoding"}]
** Stacktrace: [{ejabberd_odbc,sql_query_t,1},
{odbc_queries,update_t,4},
{ejabberd_odbc,outer_transaction,3},
{ejabberd_odbc,run_sql_cmd,4},
{p1_fsm,handle_msg,10},
{proc_lib,init_p_do_apply,3}]
** When State == {state,<0.441.0>,pgsql,30000,"example.ru",1000,{0,{[],[]}}}

Then i take version wich use stringprep, and it's work fine!

p1_fsm: Incorrect handling of system messages sent with sys:get_status/1 and sys:get_status/2 in p1_fsm:format_status/2

Sending system messages with sys:get_status/1 and sys:get_status/2 to processes using p1_fsm behaviour is currently broken.

I think the reason is the fact that in change 72535ee some new fields were added to the call to sys:handle_system_msg/6 in p1_fsm:decode_msg().

The above change breaks the pattern match for StatusData argument in p1_fsm:format_status/2.

Processes using p1_fsm behaviour crash like this when receiving a message from sys:get_status():

(test@some_host)2> sys:get_status(<pid of ejabberd_c2s process>).

** exception exit: {{badmatch,[[{'$internal_queue_len',0},
                                {'$ancestors',[ejabberd_c2s_sup,ejabberd_sup,<0.243.0>]},
                                {'$initial_call',{gen,init_it,6}}],
                               running,<0.316.0>,[],
                               [<0.466.0>,session_established,
                                {state,{socket_state,ejabberd_http_bind,
                                                     {http_bind,<0.465.0>,{"10.0.0.50","59802"}},
                                                     ejabberd_http_bind},
                                       ejabberd_socket,#Ref<0.0.0.13577>,true,"2941527020",
                                       {sasl_state,"jabber","XXX",[],
                                                   #Fun<ejabberd_c2s.1.89226433>,
                                                   #Fun<ejabberd_c2s.2.89226433>,
                                                   #Fun<ejabberd_c2s.3.89226433>,undefined,undefined},
                                       c2s,c2s_shaper,false,false,false,false,
                                       [verify_none],
                                       true,
                                       {jid,[...],...},
                                       "user1",
                                       [...],...},
                                ejabberd_c2s,90000,
                                {limits,1000},
                                {[],[]},
                                0]]},
                    {sys,get_status,[<0.466.0>]}}
     in function  sys:send_system_msg/2 (sys.erl, line 242)
(test@some_host)3> 
=CRASH REPORT==== 7-Aug-2013::16:11:41 ===
  crasher:
    initial call: gen:init_it/6
    pid: <0.466.0>
    registered_name: []
    exception error: no match of right hand side value 
                     [[{'$internal_queue_len',0},
                       {'$ancestors',
                           [ejabberd_c2s_sup,ejabberd_sup,<0.243.0>]},
                       {'$initial_call',{gen,init_it,6}}],
                      running,<0.316.0>,[],
                      [<0.466.0>,session_established,
                       {state,
                           {socket_state,ejabberd_http_bind,
                               {http_bind,<0.465.0>,{"10.0.0.50","59802"}},
                               ejabberd_http_bind},
                           ejabberd_socket,#Ref<0.0.0.13577>,true,
                           "2941527020",
                           {sasl_state,"jabber","?XXX",[],
                               #Fun<ejabberd_c2s.1.89226433>,
                               #Fun<ejabberd_c2s.2.89226433>,
                               #Fun<ejabberd_c2s.3.89226433>,undefined,
                               undefined},
                           c2s,c2s_shaper,false,false,false,false,
                           [verify_none],
                           true,
                           {jid,"user1","XXX","32932893571375881084679369",
                               "user1","XXX","32932893571375881084679369"},
                           "user1","XXX","32932893571375881084679369",
                           {{1375,881084,782805},<0.466.0>},
                           {1,{{"user1","XXX",[]},nil,nil}},
                           {1,{{"user1","XXX",[]},nil,nil}},
                           {1,{{"user1","XXX",[]},nil,nil}},
                           {0,nil},
                           {xmlelement,"presence",[],[]},
                           undefined,
                           {{2013,8,7},{13,11,25}},
                           false,
                           {userlist,"ignore",
                               [{listitem,none,none,allow,0,true,false,false,
                                    false,false}],
                               false},
                           http_bind,ejabberd_auth_internal,
                           {"10.0.0.50","59802"},
                           [{caps_resources,{0,nil}}],
                           []},
                       ejabberd_c2s,90000,
                       {limits,1000},
                       {[],[]},
                       0]]
      in function  p1_fsm:format_status/2 (p1_fsm.erl, line 762)
      in call from sys:get_status/5 (sys.erl, line 384)
      in call from sys:do_cmd/6 (sys.erl, line 366)
      in call from sys:handle_system_msg/8 (sys.erl, line 290)
    ancestors: [ejabberd_c2s_sup,ejabberd_sup,<0.243.0>]
    messages: []
    links: [<0.316.0>]
    dictionary: [{'$internal_queue_len',0}]
    trap_exit: false
    status: running
    heap_size: 2586
    stack_size: 27
    reductions: 221088
  neighbours:

Adding Limits, Queue, and QueueLen fields to the pattern for StatusData in p1_fsm:format_status/2 with a patch like this one fixes the issue:

diff --git a/src/p1_fsm.erl b/src/p1_fsm.erl
index 647ba3b..a2618d4 100644
--- a/src/p1_fsm.erl
+++ b/src/p1_fsm.erl
@@ -758,7 +758,7 @@ get_msg(Msg) -> Msg.
 %% Status information
 %%-----------------------------------------------------------------
 format_status(Opt, StatusData) ->
-    [PDict, SysState, Parent, Debug, [Name, StateName, StateData, Mod, _Time]] =
+    [PDict, SysState, Parent, Debug, [Name, StateName, StateData, Mod, _Time, _Limits, _Queue, _QueueLen]] =
        StatusData,
     NameTag = if is_pid(Name) ->
                      pid_to_list(Name);

Now sending sys:get_status() works for ejabber_c2s processes:

(test@some_host)1> sys:get_status(pid(0,407,0)).
{status,<0.407.0>,
        {module,p1_fsm},
        [[{'$internal_queue_len',0},
          {'$ancestors',[ejabberd_c2s_sup,ejabberd_sup,<0.124.0>]},
          {'$initial_call',{gen,init_it,6}}],
         running,<0.233.0>,[],
         [{header,"Status for state machine <0.407.0>"},
          {data,[{"Status",running},
                 {"Parent",<0.233.0>},
                 {"Logged events",[]},
                 {"StateName",session_established}]},
          {data,[{"StateData",
                  {state,{socket_state,ejabberd_http_bind,
                                       {http_bind,<0.406.0>,{"10.0.0.50","51178"}},
                                       ejabberd_http_bind},
                         ejabberd_socket,#Ref<0.0.0.13669>,true,"3798842421",
                         {sasl_state,"jabber","XXX",[],
                                     #Fun<ejabberd_c2s.1.89226433>,...},
                         c2s,c2s_shaper,false,false,false,...}}]}]]}

The above change on master and 2.1.x branches is working fine as far as I can tell in my fork of ejabberd.

one account login from multi device same time

Hi,

I have setup a simple Ejabberd server, I try to disable one account login from multi device at same time.

I think maybe I can change configure file, then when one account from device A, will kick out this same account login from device B.

I try set allow_multiple_connections to false for my host, but it not work.

thanks in advance.

make install overwrites inetrc

While existing ejabberd.cfg and ejabberdctl.cfg are preserved, inetrc is overwritten. Each time I make install I have to fix my inetrc which has a critical change in the host tuple. (I have to replace hostalias with the jabber hostname.)

The simple fix is to treat inetrc the same as ejabberd.cfg in Makefile.in:

    [ -f $(ETCDIR)/inetrc ] \
        && install -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc-new \
        || install -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc

ERLANG_VERSION_CHECK seems to be missing in configure

./configure --prefix=$EJD_PREFIX --enable-all --enable-tools --disable-pam
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a sed that does not truncate output... /bin/sed
checking for erl... /usr/bin/erl
checking for erlc... /usr/bin/erlc
checking for erl... /usr/bin/erl
checking for erlc... /usr/bin/erlc
./configure: line 2485: syntax error near unexpected token `$REQUIRE_ERLANG_MIN,$REQUIRE_ERLANG_MAX'
./configure: line 2485: `       ERLANG_VERSION_CHECK($REQUIRE_ERLANG_MIN,$REQUIRE_ERLANG_MAX)'

Support SCRAM with odbc auth

I use mysql database as data storage for my ejabberd instances. I'd like not to store plain text passwords in my database. I know that there is method called SCRAM for it.

As I've got from sources it's supported only with internal auth. As I've got from last comment here https://support.process-one.net/browse/EJAB-1196 supporting SCRAM with odbc auth was planned. So can somebody implement it? Please.

how to enable s2s in BOSH

here "s2s" i mean login with account of other service (e.g. @gmail.com)

i created a chatroom on website using ejabberd, it works well, but can only login with my own account, can't login with other service. i have googled but found nothing....

ejabberd_sm: {broadcast messages are not handled

Ejabberd sm fails with:

=ERROR REPORT==== 2013-04-20 12:14:19 ===
E(<0.293.0>:ejabberd_sm:104) : {{badmatch,
                                 {broadcast,
                                  {item,
                                   {<<"a">>,<<"[email protected]">>,<<>>},
                                   none}}},
                                [{ejabberd_sm,do_route,3,
                                  [{file,"ejabberd_sm.erl"},{line,463}]},
                                 {ejabberd_sm,route,3,
                                  [{file,"ejabberd_sm.erl"},{line,102}]},
                                 {mod_roster,push_item,4,
                                  [{file,"mod_roster.erl"},{line,551}]},
                                 {mod_roster,process_item_set,3,
                                  [{file,"mod_roster.erl"},{line,493}]},
                                 {lists,foreach,2,
                                  [{file,"lists.erl"},{line,1313}]},
                                 {mod_roster,process_iq_set,3,
                                  [{file,"mod_roster.erl"},{line,459}]},
                                 {gen_iq_handler,process_iq,6,
                                  [{file,"gen_iq_handler.erl"},{line,114}]},
                                 {gen_iq_handler,handle_info,2,
                                  [{file,"gen_iq_handler.erl"},{line,169}]}]}
when processing: {{jid,<<>>,<<>>,<<>>,<<>>,<<>>,<<>>},
                  {jid,<<"test">>,<<"[email protected]">>,<<>>,<<"test">>,
                       <<"[email protected]">>,<<>>},
                  {broadcast,{item,{<<"a">>,<<"[email protected]">>,<<>>},
                                   none}}}

The fix is easy:

--- a/src/ejabberd_sm.erl
+++ b/src/ejabberd_sm.erl
@@ -454,6 +454,8 @@ recount_session_table(Node) ->

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

+do_route(From, To, {broadcast, _} = Packet) ->
+    route_message(From, To, Packet);
 do_route(From, To, Packet) ->
     ?DEBUG("session manager~n\tfrom ~p~n\tto ~p~n\tpacket "
           "~P~n",

http-bind do not work with tls

Hi,

i am trying trunk version of ejabberd. I initialised tsl for http-bind as:

  -
    port: 5281
    module: ejabberd_http
    request_handlers:
       "http-bind": mod_http_bind
    certfile: "/srv/woc/ssl/keystore.pem"
    tls: true

when i access http://xxx.xxx.xxx:5281/http-bind

it returns no data and crash with this in log:

=CRASH REPORT==== 16-Sep-2013::15:45:33 ===
  crasher:
    initial call: ejabberd_http:init/2
    pid: <0.439.0>
    registered_name: []
    exception error: bad argument
      in function  binary_to_list/1
         called as binary_to_list("keep-alive")
      in call from jlib:tolower/1 (src/jlib.erl, line 293)
      in call from ejabberd_http:process_header/2 (src/ejabberd_http.erl, line 242)
      in call from ejabberd_http:parse_headers/1 (src/ejabberd_http.erl, line 209)
    ancestors: [ejabberd_http_sup,ejabberd_sup,<0.38.0>]
    messages: []
    links: [#Port<0.5193>,<0.330.0>,#Port<0.5190>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 987
    stack_size: 27
    reductions: 1277
  neighbours:

Gracefully restart ejabberd server?

Maybe this is not the right question to ask this question, but, Is there anyway can gracefully restart the ejabberd server?

I am working on a nodejs app that depending on ejabberd. What this app doing is programmatically edit ejabberd.cfg configure file, add/delete virtual hosts.

But everytime after I edit the ejabberd.cfg, I need to restart whole ejabberd serve to make those changes happens. This will cause few seconds of disconnection for all use that connected to this server.

So I wonder is there anyway I can gracefully restart the server that wont effects users? Or even better I dont have to restart the server to enable changes?

Best regards

--kuno

Mysql driver leaking connections

Mysql_conn.erl tries to close a socket

init(Host, Port, User, Password, Database, LogFun, Parent) ->
    case mysql_recv:start_link(Host, Port, LogFun, self()) of
        {ok, RecvPid, Sock} ->
            case mysql_init(Sock, RecvPid, User, Password, LogFun) of
                {ok, Version} ->
                    case do_query(Sock, RecvPid, LogFun, "use " ++ Database,
                                  Version, [{result_type, binary}]) of
                        {error, MySQLRes} ->
                            mysql:log(LogFun, error,
                                      "mysql_conn: Failed changing"
                                      " to database ~p : ~p",
                                      [Database,
                                       mysql:get_result_reason(MySQLRes)]),

                            gen_tcp:close(Sock), % THIS SOCKET BELONGS TO mysql_recv process

                            Parent ! {mysql_conn, self(),
                                      {error, failed_changing_database}};
                        %% ResultType: data | updated

Similarly when the close message is sent the code tries to access this socket:

        close ->
            mysql:log(State#state.log_fun, error, "mysql_conn: "
                      "Received close signal, exiting.", []),
            close_connection(State);
close_connection(State) ->

    Result = gen_tcp:close(State#state.socket), %% THIS SOCKET BELONGS TO mysql_recv

    mysql:log(State#state.log_fun,  normal, "Closing connection ~p: ~p~n",
              [State#state.socket, Result]),
    Result. 

gen_tcp:set_controlling_process or sending the stop signal to mysql_recv are a possible fix.

mod_shared_roster_ldap, user display name query ignores deref setting

Given the following openldap 2.4 tree:

basedn: dc=xenji,dc=io
Users: ou=People
Xmpp Users: aliased via objectClass=alias and the referenced dn in aliasedObjectName, located in ou=Users,ou=Xmpp
Xmpp Groups: groupOfUniqueNames at ou=Groups,ou=Xmpp

I'm using the following config for my ejabberd 2.1.13 on Freebsd 9.1-RELEASE-p5:

{mod_shared_roster_ldap,[
    {ldap_deref_aliases, always},
    {ldap_base, "ou=Xmpp,dc=xenji,dc=io"},
    {ldap_rfilter, "(objectClass=groupOfUniqueNames)"},
    {ldap_gfilter, "(&(objectClass=groupOfUniqueNames)(cn=%g))"},
    {ldap_groupdesc, "description"},
    {ldap_ufilter, "(&(objectClass=inetOrgPerson)(uid=%u))"},
    {ldap_memberattr, "uniqueMember"},
    {ldap_memberattr_format, "uid=%u,ou=User,ou=Xmpp,dc=xenji,dc=io"},
    {ldap_useruid, "uid"},
    {ldap_userdesc, "displayName"}
  ]}

Problem:
The deref for the login works without any problems and so does the member to group resolution. The roster is build correctly, but the name cannot be resolved correctly, as the user query for the user in the group does seem not respect the ldap_deref_aliases setting. The group contains multiple uniqueMember attributes keeping the reference to the alias, not the original dn in ou=People.

Here are some log excerpts, HTH.

Login (with successful deref)

=INFO REPORT==== 2013-08-22 06:43:23 ===
D(<0.2874.0>:eldap:697) : {searchRequest,
                           {'SearchRequest',"ou=User,ou=Xmpp,dc=xenji,dc=io",
                            wholeSubtree,derefAlways,0,0,false,
                            {equalityMatch,
                             {'AttributeValueAssertion',"uid","test"}},
                            ["uid"]}}
=INFO REPORT==== 2013-08-22 06:43:23 ===
D(<0.2874.0>:eldap:767) : {searchResEntry,
                              {'SearchResultEntry',
                                  "uid=test,ou=User,ou=Xmpp,dc=xenji,dc=io",
                                  [{'PartialAttributeList_SEQOF',"uid",
                                       ["test"]}]}}

Don't know if this is relevant, but it also ignores the deref setting.

=INFO REPORT==== 2013-08-22 06:43:23 ===
D(<0.2983.0>:eldap:697) : {searchRequest,
                           {'SearchRequest',"ou=Xmpp,dc=xenji,dc=io",
                            wholeSubtree,neverDerefAliases,0,5,false,
                            {'and',
                             [{equalityMatch,
                               {'AttributeValueAssertion',"objectClass",
                                "groupOfUniqueNames"}},
                              {equalityMatch,
                               {'AttributeValueAssertion',"cn","mygroup"}}]},
                            ["cn","description","uniqueMember"]}}

ejabberd breaks after 13.03 update

Hello,
After the annoucement, i tried to test this version by cloning the master branch, using my current configuration, which uses odbc for some mods. It gave me this error, i don't know excatly what might be, but the 2.1.x branch is working fine, any thoughts?

=INFO REPORT==== 2013-03-22 13:36:43 ===
application: ejabberd
exited: {bad_return,
{{ejabberd_app,start,[normal,[]]},
{'EXIT',
{noproc,
{gen_server,call,
[ejabberd_sup,
{start_child,
{ejabberd_odbc_sup_localhost,
{ejabberd_odbc_sup,start_link,[<<"localhost">>]},
transient,infinity,supervisor,
[ejabberd_odbc_sup]}},
infinity]}}}}}
type: temporary

ejabberd authentication failed randomly

Hi all,

I use eJabberd 2.1.12 in my company for private chat and find that ejabberd authentication can fail randomly on weekly basis.

  • Enable external authentication
  • Log in (PLAIN mode)
  • eJabberd returns:

It occurs in many clients: iPhone client, Android client, Psi desktop client (0.15)

Here is the log message I found

=INFO REPORT==== 2013-04-17 08:07:30 ===
D(<0.8903.0>:ejabberd_receiver:320) : Received XML on stream = "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">AGQ2NGVfODQ5MTYyNzI2ODIAZDdlN2RhZTAtYTczNS0xMWUyLTljMTYtMjIwMDBhYmNhOGUy</auth>"

=INFO REPORT==== 2013-04-17 08:07:30 ===
D(<0.8903.0>:shaper:61) : State: {maxrate,1000,0,1366186050184846}, Size=144
M=72.0, I=306.451


=INFO REPORT==== 2013-04-17 08:07:30 ===
I(<0.8904.0>:ejabberd_c2s:651) : ({socket_state,tls,{tlssock,#Port<0.17715>,#Port<0.17717>},<0.8903.0>}) Failed authentication for [email protected] from IP 118.62.47.203 ({{118,62,47,203},59072})

=INFO REPORT==== 2013-04-17 08:07:30 ===
D(<0.8904.0>:ejabberd_c2s:1556) : Send XML on stream = <<"<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>">>

Digging in the code I find that the error occurs in the following code

ejabberd_c2s:651
---------------
        case cyrsasl:server_start(StateData#state.sasl_state,
                      Mech,
                      ClientIn) of
``
If I change the user name (totally new user name, password) the authentication works again.

What is wrong here? 

Don't announce register feature once user is authenticated

When the server was setup using 'in-band registration XEP0077, the initial feature list should include "register" when asked for authentication methods supported. However once user has already been authenticated. The feature list should NOT include it.

The following was extracted from a xmpp library connecting to ejabberd.

    RECEIVING (features) <stream:features xmlns:stream="http://etherx.jabber.org/streams">
    <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
    <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="yy7di5kE0syuCXOQTXNBTclpNTo="/>
    <register xmlns="http://jabber.org/features/iq-register"/>
    </stream:features>

Where connecting to openfire, register element won't be included by that stage.

The problem here is, as XEP0077 spec states, when user has already been authenticated, a register stanza will automatically become 'change password' stanza. Given this feature list will be received and parsed dynamically by the client, it can cause unwanted 'change password' behaviour.

And when actually sending the register stanza over , ejabberd simply throws a 500 internal error.

Incorrect escape for PostgreSQL

odbc_queries:escape use backslash to escape single quote, but by default postgres don't accept that.
By default postgres want escape single quote with another single quote, like this ''.
I get this error when try to use mod_vcard_odbc with PostgreSQL 9.1
I change odbc_queries:escape clause from
escape($') -> "'";
to
escape($') -> "''";
and now it's work fine with postgresql 9.1

I think odbc_queries must use different escape for different database backends/

PEP notification filtering

PEP notifications shouldn't be filtered out if you subscribe explicitly (via PubSub) to a PEP node.
At the moment (v.2.1.8) you can only implicitly subscribe/unsubscribe with CAPS.

Accident occurring "Error on HTTP put. Reason: bad_key" in mod_http_bind

ejabberd 2.1.10, Debian 6, Javascript+jsJac

This error occurs randomly. It can happen, but maybe not.
For the one of requests ejabberd writes

=INFO REPORT==== 2012-04-10 02:50:59 ===
D(<0.575.0>:ejabberd_http_bind:782) : Error on HTTP put. Reason: bad_key

and closing session:

=INFO REPORT==== 2012-04-10 02:50:59 ===
D(<0.581.0>:ejabberd_http_bind:406) : Closing bind session "3f368b0ded0e90850ac609174d86df7bd199df16" - Reason: {put_error, bad_key}

=INFO REPORT==== 2012-04-10 02:50:59 ===
D(<0.581.0>:ejabberd_http_bind:547) : terminate: Deleting session 3f368b0ded0e90850ac609174d86df7bd199df16

For example, if RID of this request is 486851, ejabberd writes this in logfile before error occurs:

=INFO REPORT==== 2012-04-10 02:50:59 ===
D(<0.581.0>:ejabberd_http_bind:867) : Previous rid / New rid: 486848/486851

It is 3 interval between RID's. And in logs it's possible to see that 486849-request is delayed all the time and never processed:

=INFO REPORT==== 2012-04-10 02:50:54 ===
D(<0.576.0>:ejabberd_http_bind:804) : Looking for session: "3f368b0ded0e90850ac609174d86df7bd199df16"

=INFO REPORT==== 2012-04-10 02:50:54 ===
D(<0.581.0>:ejabberd_http_bind:421) : Shaper timer for RID 486849: {wait,4616}

=INFO REPORT==== 2012-04-10 02:50:54 ===
D(<0.576.0>:ejabberd_http_bind:788) : Trafic Shaper: Delaying request 486849

this is repeated several times.

I think this bug associated with too frequent sending request from client. When client sending request not so fast i never seen this bug.

There is my huge and verbose logfile.

Failed to make source code

After clone the source code, I followed the README to compile and install ejabberd.
First, installed all required libraries. OK.
Second, compile.
In the terminal, ./configure, it is OK. But when I ran make, it failed.
The error messages are:

/usr/bin/erlc -W -DSSL40 -pa . cyrsasl.erl
./cyrsasl.erl:69: syntax error before: ','
./cyrsasl.erl:70: bad attribute
./cyrsasl.erl:51: Warning: type props() is unused
make: *** [cyrsasl.beam] Error 1

Ubuntu 12.04, Erlang R14B04, OpenSSL 1.0.1 14 Mar 2012

ejabberd 3 alpha 5 fail to start

I not sure wether this is the right place to ask this question.

For some reasons, I want to try out the new ejabberd 3, so download the latest alpha release, which is alpha5. I build it successfully with this configure, without exmpp

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-odbc --enable-pam --disable-eldap

After build, I can install it. But when i try to start it by using this command

sudo ejabberdclt start

It was not working properly.

These are the error message I got from the live mode

CRASH REPORT==== 20-Feb-2013::03:29:23 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.39.0>
    registered_name: []
    exception exit: {bad_return,
                        {{ejabberd_app,start,[normal,[]]},
                         {'EXIT',
                             {undef,
                                 [{exmpp_stringprep,nodeprep,["127.0.0.1"]},
                                  {ejabberd_config,normalize_hosts,2},
                                  {ejabberd_config,add_hosts_to_option,2},
                                  {lists,foldl,3},
                                  {ejabberd_config,load_file,1},
                                  {ejabberd_config,start,0},
                                  {ejabberd_app,start,2},
                                  {application_master,start_it_old,4}]}}}}
      in function  application_master:init/4
    ancestors: [<0.38.0>]
    messages: [{'EXIT',<0.40.0>,normal}]
    links: [<0.38.0>,<0.6.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 24
    reductions: 150
  neighbours:

=INFO REPORT==== 20-Feb-2013::03:29:23 ===
    application: ejabberd
    exited: {bad_return,
                {{ejabberd_app,start,[normal,[]]},
                 {'EXIT',
                     {undef,
                         [{exmpp_stringprep,nodeprep,["127.0.0.1"]},
                          {ejabberd_config,normalize_hosts,2},
                          {ejabberd_config,add_hosts_to_option,2},
                          {lists,foldl,3},
                          {ejabberd_config,load_file,1},
                          {ejabberd_config,start,0},
                          {ejabberd_app,start,2},
                          {application_master,start_it_old,4}]}}}}
    type: temporary

Please help me figure this out.

How do I add a base64 BINVAL photo from CLI using ejabberdctl?

I'm trying to figure out how to accomplish this using ejabberdctl. I tried the following command but I'm not sure how to pass the base64 blob to ejabberdctl.

% ejabberdctl set_vcard2 sam chat.server.local PHOTO BINVAL "cat a1.64"

-or-

% cat a1.64 | ejabberdctl set_vcard2 sam chat.lamolabs.org PHOTO BINVAL

Anyone know how to do this?

Massive memory leak

=INFO REPORT==== 2011-10-08 07:17:15 ===
D(<0.403.0>:eldap:767) : {searchResEntry,
                             {'SearchResultEntry',
                                 "uid=rgenthner,ou=People,dc=sendecho,dc=in",
                                 [{'PartialAttributeList_SEQOF',"uid",
                                      ["rgenthner"]},
                                  {'PartialAttributeList_SEQOF',"sn",
                                      ["Genthner"]}]}}

=INFO REPORT==== 2011-10-08 07:17:15 ===
D(<0.403.0>:eldap:767) : {searchResDone,
                             {'LDAPResult',success,[],[],asn1_NOVALUE}}

=INFO REPORT==== 2011-10-08 07:17:15 ===
D(<0.7035.0>:ejabberd_router:313) : route
    from {jid,[],"localhost","watchdog",[],"localhost","watchdog"}
    to {jid,"rgenthner","sendecho.in",[],"rgenthner","sendehco.in",
                []}
    packet {xmlelement,"message",
                   [{"type","chat"}],
                   [{xmlelement,"body",[],
                        [{xmlcdata,
                             "(ejabberd@localhost) The process <0.725.0> is consuming too much memory:\n[{old_heap_block_size,10030440},\n {heap_block_size,8024355},\n {mbuf_size,0},\n {stack_size,39},\n {old_heap_size,129205},\n {heap_size,26041}]\n[{current_function,{mnesia_tm,rec,2}},\n {initial_call,{mod_offline,loop,1}},\n {message_queue_len,2},\n {links,[<0.64.0>]},\n {dictionary,\n     [{mnesia_activity_state,\n          {mnesia,{tid,8138,<0.725.0>},{tidstore,4735096,[],1}}}]},\n {heap_size,8024355},\n {stack_size,42}]"}]}]}

Lost message conversation

HI,
I lost the conversation on page refresh.
how can i get previous message conversations?
how can i clear the message conversations?
Please help me
Thanks

Pokal4u

ejabberd_socket: Timeout on tls:send and auto disconnecting users when logged in

when users login into recently updated 2.1.11 disconect in seconds after login, and into log on server i see Timeout on tls:send

behavior problem:

  • The problem occurs when there are more than 50 users online at the same time

some notes:

  • no network firewall,
  • only one redirection from public ip to internal ip, valid domain certified etc,
  • dedicated server, unmilitarized network,
  • no clients firewalls, clients used psi+, spark or pidgin.
  • the networking are 5222 redirected port of public ip to internally ip
  • jabberd used 2.1.10 erlang 15.b and then later try jabberd 2.1.11, erlang 15.b.1
  • enabled smp and lot of resources into server (delll t110-II 4cores, 4Gram, raid0)

sorry for my english, i have reported also in process one, https://support.process-one.net/browse/EJAB-1617, due there's no info related and documentation are very limited on networking

LOG EJABBERD:


=INFO REPORT==== 2013-02-18 14:15:14 ===
I(<0.404.0>:ejabberd_listener:281) : (#Port<0.5481>) Accepted connection {{200,62,27,27},9580} -> {{37,10,254,10},5222}

=INFO REPORT==== 2013-02-18 14:15:14 ===
I(<0.2107.0>:ejabberd_c2s:767) : ({socket_state,tls,{tlssock,#Port<0.5481>,#Port<0.5483>},<0.2106.0>}) Accepted authentication for 20563522 by ejabberd_auth_odbc

=INFO REPORT==== 2013-02-18 14:15:14 ===
I(<0.2107.0>:ejabberd_c2s:938) : ({socket_state,tls,{tlssock,#Port<0.5481>,#Port<0.5483>},<0.2106.0>}) Opened session for 20563522@syscatalogo/Spark 2.6.3

=INFO REPORT==== 2013-02-18 14:15:22 ===
I(<0.2100.0>:ejabberd_socket:175) : Timeout on tls:send

=INFO REPORT==== 2013-02-18 14:15:22 ===
I(<0.2100.0>:ejabberd_c2s:1502) : ({socket_state,tls,{tlssock,#Port<0.5474>,#Port<0.5476>},<0.2099.0>}) Close session for guacara@syscatalogo/Spark 2.6.3

=INFO REPORT==== 2013-02-18 14:15:30 ===
I(<0.404.0>:ejabberd_listener:281) : (#Port<0.5488>) Accepted connection {{186,93,139,212},2305} -> {{37,10,254,10},5222}

=INFO REPORT==== 2013-02-18 14:15:47 ===
I(<0.641.0>:ejabberd_socket:175) : Timeout on tls:send

=INFO REPORT==== 2013-02-18 14:15:47 ===
I(<0.641.0>:ejabberd_c2s:1502) : ({socket_state,tls,{tlssock,#Port<0.3092>,#Port<0.3094>},<0.640.0>}) Close session for mpastora@syscatalogo/Spark 2.6.3

CONFIG FILE:


{acl, admin, {user, "admin", "syscatalogo"}}.
{hosts, ["syscatalogo"]}.
{loglevel, 4}.

{watchdog_admins, ["piccorodaemon@syscatalogo"]}.


{listen,
 [
  {5222, ejabberd_c2s, [
            {access, c2s},
            {shaper, c2s_shaper},
            {max_stanza_size, 32768000},
            zlib,
            starttls, {certfile, "/etc/ssl/certs/syscatalogo.pem"}
               ]},
  {5269, ejabberd_s2s_in, [
               {shaper, s2s_shaper},
               {max_stanza_size, 32768000}
              ]},
  {5280, ejabberd_http, [
             {request_handlers,
              [
               {["catalogo", "archivos"], mod_http_fileserver}
              ]},
             %%captcha,
             http_bind,
             http_poll,
             web_admin,
             register,
             tls, {certfile, "/etc/ssl/certs/syscatalogo.pem"}
            ]}

 ]}.
{s2s_use_starttls, true}.
{s2s_certfile, "/etc/ssl/certs/syscatalogo.pem"}.

{s2s_default_policy, deny}.
{{s2s_host,"syscatalogo"},allow}.


{auth_method, odbc}.
{odbc_server, "DSN=PSQLejabberdb;UID=ejabberdb;PWD=ejabberdb"}.
{odbc_pool_size, 6}.
{odbc_keepalive_interval, 3600}.

{shaper, normal, {maxrate, 50000}}.
{shaper, fast, {maxrate, 50000}}.


{acl, admin, {user, "admin", "syscatalogo"}}.


{acl, local, {user_regexp, ""}}.
{access, max_user_sessions, [{2, all}]}.
{access, max_user_sessions, [{4, admine@syscatalogo}]}.
{access, max_user_offline_messages, [{10, admin}, {5, all}]}. 
{access, c2s, [{deny, blocked},
           {allow, all}]}.
{access, c2s_shaper, [{none, admin},
              {normal, all}]}.
{access, s2s_shaper, [{fast, all}]}.
{access, announce, [{deny, all},{allow, admin}]}.
{access, configure, [{allow, admin}]}.
{access, muc_admin, [{allow, admin}]}.
{access, muc, [{allow, admin},{allow, gerencia}]}.
{access, register, [{deny, all}]}.

{registration_timeout, 6000}.

{access, pubsub_createnode, [{deny, all}]}.
{access, pubsub_createnode, [{allow, admin}]}.

{language, "es"}.

{modules,
 [
  {mod_adhoc,    []},
  {mod_announce, [{access, announce}]}, % requires mod_adhoc
  {mod_caps,     []},
  {mod_configure,[]}, % requires mod_adhoc
  {mod_admin_extra, []},
  {mod_disco,    []},
  {mod_echo,   [{host, "echo.syscatalogo"}]},
  {mod_http_bind,    []},
  {mod_http_fileserver, [
                         {docroot, "/var/www/catalogo/archivos/"}, 
                         {accesslog, "/var/log/ejabberd/access.log"},
                         {custom_headers, [{"X-Powered-By", "VNXDE Ejabberd"},{"X-Fry", "www.venenux.org"}]},
                         {content_types, [{".pdf","application/pdf"},
                                          {".odt","application/vnd.oasis.opendocument.text"},
                                          {".ods","application/vnd.oasis.opendocument.spreadsheet"},
                                          {".ogv","video/ogv"},
                                          {".mpeg","video/mpeg"},
                                          {".html","text/html"},
                                          {".kate","text/plain"},
                                          {".sql","text/plain"},
                                          {".7z","application/x-7z-compresed"},
                                          {".gz","application/x-gtar"},
                                          {".tar","application/x-tar"}
                         ]}
                        ]},
  {mod_last_odbc,     []},
  {mod_muc,      [
          {access, muc_admin},
          {access_create, muc_admin},
          {access_persistent, muc_admin},
          {access_admin, muc_admin},
          {max_users, 10},
          {max_user_conferences, 4}
         ]},
  {mod_muc_log,[]},
  {mod_offline,  [{access_max_user_messages, max_user_offline_messages}]},
  {mod_privacy_odbc,  []},
  {mod_private_odbc,  []},
  {mod_proxy65,  [
          {access, all},
          {shaper, c2s_shaper}
         ]},
  {mod_register, [
          {welcome_message, {"Welcome!",
                     "Para informacion vistie http://syscatalogo "}},
          {registration_watchers, ["admin@syscatalogo"]},
          {access, register}
         ]},
  {mod_register_web, []}, %% must enabled into http 5280 port http access
  {mod_roster_odbc,   []},
  {mod_service_log,[]},
  {mod_shared_roster,[]},
  {mod_stats,    []},
  {mod_time,     []},
  {mod_vcard,    [{search, true}, {matches, infinity}, {allow_return_all, true}, {search_all_host, true}]},
  {mod_vcard_xupdate, []},
  {mod_version,  []}
 ]}.

%%% Local Variables:
%%% mode: erlang
%%% End:
%%% vim: set filetype=erlang tabstop=8:

PUBSUB client receive bad "tag" during subscription and smack API crash.

Hi,

after trying upgrade from 2.1.12 to MASTER BRANCH [04.06.2013] we used our PUBSUB testing java client and all "instances" crashed with the same error :

java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen ...<subscriptions/></pubsub></iq>... @1:1152
        at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035)
        at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
        at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)
        at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
        at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:325)
        at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
        at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: No response from server.: 
        at org.jivesoftware.smackx.pubsub.packet.SyncPacketSend.getReply(SyncPacketSend.java:50)
        at org.jivesoftware.smackx.pubsub.packet.SyncPacketSend.getReply(SyncPacketSend.java:61)
        at org.jivesoftware.smackx.pubsub.PubSubManager.getNode(PubSubManager.java:163)
        at appli.gestAbonnement.nodeSouscrire(gestAbonnement.java:24)
        at appli.appliClient.main(appliClient.java:87)
        ... 5 more

Note that :

  • this client works perfectly with EJ 2.1.11, EJ 2.1.12, OPENFIRE 3.7, OPENFIRE 3.8.
  • we have the same issue with one unique node and with a two nodes cluster.

We can give java source and the final JAR if you want to test...

unable to load driver '/lib/ejabberd/priv/lib/sha_drv.so' on Lion 10.7

When start ejabberd V2.1.11 by sudo ejabberdctl live :

=ERROR REPORT==== 9-Jan-2013::20:25:07 ===
C(<0.39.0>:sha:53) : unable to load driver '/lib/ejabberd/priv/lib/sha_drv.so': dlopen(//lib/ejabberd/priv/lib/sha_drv.so, 2): no suitable image found.  Did find:
        //lib/ejabberd/priv/lib/sha_drv.so: mach-o, but wrong architecture

=CRASH REPORT==== 9-Jan-2013::20:25:07 ===
  crasher:
    initial call: stringprep:init/1
    pid: <0.107.0>
    registered_name: []
    exception exit: {{case_clause,{error,{open_error,-11}}},
                     [{stringprep,init,1},
                      {gen_server,init_it,6},
                      {proc_lib,init_p_do_apply,3}]}
      in function  gen_server:init_it/6
    ancestors: [stringprep_sup,<0.39.0>]
    messages: []
    links: [<0.106.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 377
    stack_size: 24
    reductions: 110
  neighbours:

I can find the so

ls /lib/ejabberd/priv/lib/
ejabberd_zlib_drv.so    expat_erl.so        iconv_erl.so        sha_drv.so      stringprep_drv.so   tls_drv.so

I want to know how to make the so for the correct architecture ?

name conflict on tls.erl (as of OTP_R16B01)

Erlang OTP_R16B01 adds lib/ssl/src/tls.erl in erlang/otp@e7f8deb

This caused trouble for me with mod_shared_roster_ldap using tls, but I suspect that isn't the only module using tls that would have trouble.

The error report below seems to come from ssl calling into ejabberd's (p1_tls) tls module instead of the new OTP module of the same name.

=ERROR REPORT==== 2013-06-19 13:42:00 ===
** State machine 'eldap_#Ref<0.0.0.11230>' terminating 
** Last event in was timeout
** When State == connecting
**      Data  == {eldap,3,
                        [<<"ldap.tagged.com">>],
                        undefined,636,gen_tcp,tls,[],undefined,<<>>,<<>>,0,
                        #Ref<0.0.0.11231>,
                        {dict,0,16,16,8,80,48,
                              {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                               []},
                              {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                []}}},
                        {[],[]}}
** Reason for termination = 
** {'function not exported',
       [{tls,connect,
            ["ldap.tagged.com",636,
             [{packet,asn1},{active,true},{keepalive,true},binary]],
            []},
        {eldap,connect_bind,1,[{file,"src/eldap.erl"},{line,1119}]},
        {eldap,connecting,2,[{file,"src/eldap.erl"},{line,643}]},
        {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]},
        {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}

Can not get the members of a shared roster group?

I want to do some tests with shared roster on ejabberd 2.1.10.

It seem you can successfully create a new shared roster group, add member to it. But can not get members list after that. For example:

  ejabberdctl srg_create group host name description display   <-- success, can create srg
  ejabberdctl srg_get_info group host           <-- success, can read the details of the srg
  ejabberdctl srg_list host      <-- success, effectively list all the srg within a host
  ejabberdctl srg_user_add user host group grouphost  <-- success, effectively add users in the srg
  ejabberdctl srg_get_members group host    <-- fail, it remain alway empty

First, I suspect that the data is not in mnesia db, but after dump the db, I can actually see the member in the dumped file.

Second, I modified the source code of mod_shared_roster, compiled it, load it to ejabberd. It seems for some wired causes, ejabberd can not be aware the existing of those members in mesia db internally. For example, if we want to list all the member in a group, in internal functions mnesia:dirty_index_read will always return a empty list, regardless member exists or not.

get_group_explicit_users(Host, Group, mnesia) ->
    Read = (catch mnesia:dirty_index_read(
            sr_user,
            {Group, Host},
            #sr_user.group_host)),
    case Read of
    Rs when is_list(Rs) ->   % Alwasy go here
        [R#sr_user.us || R <- Rs];  % Seems Rs alwasy be a empty list
    _ ->
        []
    end;

For now, this is more like a bug in ejabberd ?

Problem when start Ejabberd on Lion 10.7 with r14b01

=ERROR REPORT==== 2012-09-18 23:44:32 ===
Error in process <0.2102.0> on node 'ejabberd@localhost' with exit value: {{case_clause,{error,{open_error,-16}}},[{ejabberd_app,init,0,[]}]}


=INFO REPORT==== 2012-09-18 23:44:32 ===
    application: ejabberd
    exited: {bad_return,
                {{ejabberd_app,start,[normal,[]]},
                 {'EXIT',
                     {badarg,
                         [{erlang,port_control,
                              [stringprep_port,2,"localhost"],
                              []},
                          {stringprep,control,2,[]},
                          {jlib,nodeprep,1,[]},
                          {ejabberd_config,normalize_hosts,2,[]},
                          {ejabberd_config,add_hosts_to_option,2,[]},
                          {lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
                          {ejabberd_config,load_file,1,[]},
                          {ejabberd_config,start,0,[]}]}}}}
    type: temporary

Add support for X-Real-IP in http_bind module

We're using http_bind module behind nginx server and see only '127.0.0.1' IPs in ejabberd log. It'll be much better, if http_bind module can make lookup for X-Real-IP request header and determine client real IP address.

vCard photo URI don't work.

I'm trying to set the PHOTO URI in a vcard with ejabberdctl & latest mod_admin_extra.
I'm running Archlinux, Pidgin 2.10.6 (libpurple 2.10.6) & ejabberd 2.1.11

I tried the following commands without success in the client (value is correctly saved in database), according to the xep-0054

<!-- Photograph property. Value is either a BASE64 encoded
binary value or a URI to the external content. -->
<!ELEMENT PHOTO ((TYPE, BINVAL) | EXTVAL)>
ejabberdctl set_vcard foo chat.myjabber.com PHOTO http://link_to_image.jpg
ejabberdctl set_vcard2 foo chat.myjabber.com PHOTO EXTVAL http://link_to_image.jpg

I want to use if possible only URI based avatars to get advantage of our CDN and because the ejabberd server is synchronized with our web application, I don't want to maintain extra data on ejabberd.

Someone can give some light on that ?

contrib modules in ejabberd13

Hi,
i tried to use contrib mod_rest from master branch against ejabberd13, but it do not even start. Compiled directly to ejabberd it started but crashed because some api changes.

Could you please modify contribs to be usable with new ejabberd? Would need mod_admin_extra and mod_rest. Thanx;)

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.