BOSH connection is strangly terminated - presense information inconsistent

We are seeing issues with XMPP clients using BOSH that think they are still online, but the ejabberd server does not show presense information for these clients. By restarting the client and reestablishing an XMPP/BOSH connection, the issue tends to be resolved.

One thing to note is that our XMPP client is based on the gloox SDK. Also, we have recently switched from HTTP 1.1 w/ Pipelining (multiple parallel HTTP requests on the same socket) to HTTP 1.1 with keep-alives but w/o Pipelinig (only a single HTTP requests at a time on a socket, but re-use the socket for subsequent requests). This change seems to have surfaced the issue.

When this situation occurs, the client does not get any response from the server for over 60 seconds. Since the BOSH timeouts are set for 30 seconds, the client assumes something has gone wrong, closes the connection, and re-establishes a new BOSH connection. The ejabberd log file shows the following error message. Any help with what this error mesasge is indicating, or what could be going wrong with the BOSH communication after this error occurs would be greatly appreciated:

=ERROR REPORT==== 2011-03-21 12:45:50 ===
** State machine <0.4841.44> terminating
** Last event in was {xmlstreamstart,"stream:stream",
                                     [{"to","iqservices1v.fiberlink.com"},
                                      {"xmlns","jabber:client"},
                                      {"version","1.0"},
                                      {"xmlns:stream",
                                       "http://etherx.jabber.org/streams"}]}
** When State == session_established
**      Data  == {state,
                     {socket_state,ejabberd_http_bind,
                         {http_bind,<0.4840.44>,{{10,104,23,113},42426}},
                         ejabberd_http_bind},
                     ejabberd_socket,#Ref<0.0.21.126731>,true,"572905574",
                     {sasl_state,"jabber","iqservices1v.fiberlink.com",[],
                         #Fun<ejabberd_c2s.1.30334249>,
                         #Fun<ejabberd_c2s.2.32721014>,
                         #Fun<ejabberd_c2s.3.7052687>,cyrsasl_digest,
                         {state,5,"661491814","2014923_2qlsp_v",[],
                             #Fun<ejabberd_c2s.1.30334249>,
                             #Fun<ejabberd_c2s.3.7052687>,
                             ejabberd_auth_internal,
                             "iqservices1v.fiberlink.com"}},
                     c2s,c2s_shaper,false,false,false,false,
                     [verify_none],
                     true,
                     {jid,"2014923_2qlsp_v","iqservices1v.fiberlink.com",
                         "vagent","2014923_2qlsp_v",
                         "iqservices1v.fiberlink.com","vagent"},
                     "2014923_2qlsp_v","iqservices1v.fiberlink.com","vagent",
                     {{1300,711544,172891},<0.4841.44>},
                     {pres_t,3},
                     {pres_f,3},
                     {pres_a,3},
                     {pres_i,0},
                     {xmlelement,"presence",
                         [{"from",
                           "2014923_2qlsp_v@iqservices1v.fiberlink.com/vagent"}],
                         [{xmlelement,"priority",[],[{xmlcdata,<<"0">>}]},
                          {xmlelement,"c",
                              [{"xmlns","http://jabber.org/protocol/caps"},
                               {"hash","sha-1"},
                               {"node","http://camaya.net/gloox"},
                               {"ver","zsoys9rxg2OP+fAEehSJ9Ewmkhg="}],
                              []}]},
                     undefined,
                     {{2011,3,21},{12,45,48}},
                     false,
                     {userlist,none,[],false},
                     http_bind,ejabberd_auth_internal,
                     {{10,104,23,113},42426},
                     []}
** Reason for termination =
** {function_clause,
       [{ejabberd_c2s,session_established,
            [{xmlstreamstart,"stream:stream",
                 [{"to","iqservices1v.fiberlink.com"},
                  {"xmlns","jabber:client"},
                  {"version","1.0"},
                  {"xmlns:stream","http://etherx.jabber.org/streams"}]},
             {state,
                 {socket_state,ejabberd_http_bind,
                     {http_bind,<0.4840.44>,{{10,104,23,113},42426}},
                     ejabberd_http_bind},
                 ejabberd_socket,#Ref<0.0.21.126731>,true,"572905574",
                 {sasl_state,"jabber","iqservices1v.fiberlink.com",[],
                     #Fun<ejabberd_c2s.1.30334249>,
                     #Fun<ejabberd_c2s.2.32721014>,
                     #Fun<ejabberd_c2s.3.7052687>,cyrsasl_digest,
                     {state,5,"661491814","2014923_2qlsp_v",[],
                         #Fun<ejabberd_c2s.1.30334249>,
                         #Fun<ejabberd_c2s.3.7052687>,ejabberd_auth_internal,
                         "iqservices1v.fiberlink.com"}},
                 c2s,c2s_shaper,false,false,false,false,
                 [verify_none],
                 true,
                 {jid,"2014923_2qlsp_v","iqservices1v.fiberlink.com",
                     "vagent","2014923_2qlsp_v","iqservices1v.fiberlink.com",
                     "vagent"},
                 "2014923_2qlsp_v","iqservices1v.fiberlink.com","vagent",
                 {{1300,711544,172891},<0.4841.44>},
                 {3,
                  {{"qa_rec","iqservices1v.fiberlink.com",[]},
                   {{"2014923_2qlsp_v","iqservices1v.fiberlink.com",[]},
                    nil,nil},
                   {{"qa_sender","iqservices1v.fiberlink.com",[]},nil,nil}}},
                 {3,
                  {{"qa_rec","iqservices1v.fiberlink.com",[]},
                   {{"2014923_2qlsp_v","iqservices1v.fiberlink.com",[]},
                    nil,nil},
                   {{"qa_sender","iqservices1v.fiberlink.com",[]},nil,nil}}},
                 {3,
                  {{"2014923_2qlsp_v","iqservices1v.fiberlink.com",[]},
                   nil,
                   {{"qa_rec","iqservices1v.fiberlink.com",[]},
                    nil,
                    {{"qa_sender","iqservices1v.fiberlink.com",[]},nil,nil}}}},
                 {0,nil},
                 {xmlelement,"presence",
                     [{"from",
                       "2014923_2qlsp_v@iqservices1v.fiberlink.com/vagent"}],
                     [{xmlelement,"priority",[],[{xmlcdata,<<"0">>}]},
                      {xmlelement,"c",
                          [{"xmlns","http://jabber.org/protocol/caps"},
                           {"hash","sha-1"},
                           {"node","http://camaya.net/gloox"},
                           {"ver","zsoys9rxg2OP+fAEehSJ9Ewmkhg="}],
                          []}]},
                 undefined,
                 {{2011,3,21},{12,45,48}},
                 false,
                 {userlist,none,[],false},
                 http_bind,ejabberd_auth_internal,
                 {{10,104,23,113},42426},
                 []}]},
        {p1_fsm,handle_msg,10},
        {proc_lib,init_p_do_apply,3}]}

The problem is in the

The problem is in the MOD_PROXY of the APACHE when you use CANDY-MOD_REWRRITE.

We have the same problem than you.... So .... We are researching about it

and we discovered that you need to put this in apache2.conf

ProxyTimeout 70

/etc/apache2# tail -n 2 /etc/apache2/apache2.conf
ProxyTimeout 70

Or the other solution is reducing timeout BOSH of Ejabberd putting for example 10 seconds.

But is more better the first solution.

Syndicate content