[ejabberd] error 503/service-unavailable in one-to-one messaging

Gaurav Jain monkeyfdude at gmail.com
Sun Jun 12 00:20:27 MSK 2016


Thank you for the response. It helps.

I investigated in detail and I have a reproducible as described below.


* ejabberd_c2s block is configured with resume_timeout: 2

* Stream Management is enabled but stream resumption is disabled from
client side.


**  Two users - Sender and  Receiver.*

**Receiver* loses connection and does not close the stream/tcp connection
properly.


* *Sender* sends a message to *Receiver* but gets 503/Service-Unavailable

* *Sender* retries sending failed message after 5 secs and sends
successfully.

++++++++++++++++++++++++++++++++++++++

Clients sent following request to server:

SEND: <enable xmlns="urn:xmpp:sm:3"/>

Clients received following acks from server.

RECV: <enabled xmlns="urn:xmpp:sm:3"/>

RECV: <enabled xmlns="urn:xmpp:sm:3"/>

++++++++++++++++++++++++++++++++++++++


*Relevant Server logs:*

--------------------------------------------------------------------------------

1) *ejabberd* tries to send message to *Receiver* who lost connection:

<<"<message from='*Sender*' to='*Receiver*' type='chat' id=''><body>I have
to go back</body><thread></thread><active xmlns='
http://jabber.org/protocol/chatstates'/></message>">>

--------------------------------------------------------------------------------

*Then some pubSub/multicast related packets*

016-06-11 20:03:53.698 [debug] <0.489.0>@shaper:update:120 State:
{maxrate,100000,129.30556943548794,1465675433614549}, Size=26

M=0.1300841029950614, I=83.597

2016-06-11 20:03:53.698 [debug] <0.490.0>@ejabberd_c2s:send_text:1823 Send
XML on stream = <<"<a xmlns='urn:xmpp:sm:3' h='26'/>">>

*2016-06-11 20:03:58.587 [info] <0.606.0>@ejabberd_c2s:terminate:1773
({socket_state,fast_tls,{tlssock,#Port<0.13962>,#Port<0.13963>},<0.605.0>})
Close session for Receiver*

2016-06-11 20:03:58.587 [debug] <0.606.0>@mod_pubsub:node_action:4186
node_action <<"pubsub.com">> <<"flat">> get_entity_affiliations [<<"pubsub.
* Receiver*">>,{*Receiver*}]

2016-06-11 20:03:58.587 [debug] <0.606.0>@mod_pubsub:node_call:4167
node_call <<"flat">> get_entity_affiliations [<<"pubsub.com>>,{*Receiver*}]

2016-06-11 20:03:58.587 [debug] <0.606.0>@mod_pubsub:node_action:4186
node_action <<"pubsub.com">> <<"hometree">> get_entity_affiliations [<<"
pubsub.com">>,{*Receiver*}]

2016-06-11 20:03:58.587 [debug] <0.606.0>@mod_pubsub:node_call:4167
node_call <<"hometree">> get_entity_affiliations [<<"pubsub.com">>,{
*Receiver*}]

2016-06-11 20:03:58.587 [debug] <0.606.0>@mod_pubsub:node_action:4186
node_action <<"pubsub.com">> <<"pep">> get_entity_affiliations [<<"
pubsub.com">>,{*Receiver*}]

2016-06-11 20:03:58.588 [debug] <0.606.0>@mod_pubsub:node_call:4167
node_call <<"pep">> get_entity_affiliations [<<"pubsub.com">>,{*Receiver*}]

--------------------------------------------------------------------------------

*Presence related packets*

2016-06-11 20:03:58.588 [debug] <0.606.0>@mod_carboncopy:disable:249
disabling for *Receiver*

2016-06-11 20:03:58.588 [debug]
<0.606.0>@mod_shared_roster:unset_presence:1099 unset_presence for
*Receiver* -> <<>> (0 resources)

2016-06-11 20:03:58.588 [debug]
<0.606.0>@ejabberd_router_multicast:do_route:211 route_multicast

        from *Receiver*

        domain dev.com

        destinations [*Receiver*,*Sender*,User4,User3]

        packet {xmlel,<<"presence">>,[{<<"type">>,<<"unavailable">>}],[]}

--------------------------------------------------------------------------------

*2016-06-11 20:03:58.588 [info]
<0.606.0>@ejabberd_c2s:handle_unacked_stanzas:2849 1 stanzas were not
acknowledged by **Receiver*

2016-06-11 20:03:58.588 [debug] <0.407.0>@ejabberd_router:do_route:351 route

        from {*Receiver*}

        to {*Receiver*}

        packet {xmlel,<<"presence">>,[{<<"type">>,<<"unavailable">>}],[]}

--------------------------------------------------------------------------------

*Finally the error message 503/service-unavailable*

2016-06-11 20:03:58.589 [debug] <0.606.0>@ejabberd_router:do_route:351 route

        from {*Receiver*}

        to {*Sender*}

        packet {xmlel,<<"message">>,[{<<"type">>,<<"error">>},{"to">>,
* Sender*},{<<"from">>,*
Receiver*},{<<"id">>,<<"">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"I
have to go
back">>}]},{xmlel,<<"thread">>,[],[{xmlcdata,<<"">>}]},{xmlel,<<"active">>,[{<<"xmlns">>,<<"
http://jabber.org/protocol/chatstates
">>}],[]},{xmlel,<<"error">>,[{<<"code">>,<<"503">>},{<<"type">>,<<"cancel">>}],[{xmlel,<<"service-unavailable">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],[]}]}]}

On Sat, Jun 11, 2016 at 7:50 AM, Holger Weiß <holger at zedat.fu-berlin.de>
wrote:

> * Gaurav Jain <monkeyfdude at gmail.com> [2016-06-11 01:23]:
> > During testing various network connection use cases, I encounter a
> problem
> > I do not fully understand.
> >
> > * Its a 1 x 1 message (not MUC message)
> >
> > * user1 sends a message to user2
> >
> > * user2 is in the process of connecting to server (not fully connected
> yet)
> >
> > * user1 gets an error message back (503/service-unavailable)
>
> Are you using stream management?  Maybe the previous connection was lost
> and then user2 created a new session (instead of resuming the old one)?
> If so, this behavior is explained here:
>
>         https://www.ejabberd.im/faq/tcp
>
> Holger
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20160611/6f810849/attachment.html>


More information about the ejabberd mailing list