Project

General

Profile

When try to resume always get unexpected-request error

Mauro Carrio
Added almost 5 years ago

Hi team,

After the last fix on Stream Management I'm always getting this error when the app tries to resume after an unexpected disconnection.

Client log:

2014-02-24 21:42:41.897  SEND: <?xml version='1.0'?>
2014-02-24 21:42:41.898  SEND: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='app.com'>
2014-02-24 21:42:43.117  RECV RAW: <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='app.com' id='fdb2778e-16f5-46b7-9106-e56d4be27748' version='1.0' xml:lang='en'>
2014-02-24 21:42:43.467  RECV RAW: <stream:features><sm xmlns="urn:xmpp:sm:3"/><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>
2014-02-24 21:42:43.474  SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">ADU1NTM2NDEyMDcAa2FiZXph</auth>
2014-02-24 21:42:43.997  RECV RAW: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
2014-02-24 21:42:44.000  SEND: <?xml version='1.0'?>
2014-02-24 21:42:44.002  SEND: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='app.com'>
2014-02-24 21:42:44.518  RECV RAW: <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='app.com' id='fdb2778e-16f5-46b7-9106-e56d4be27748' version='1.0' xml:lang='en'>
2014-02-24 21:42:45.225  RECV RAW: <stream:features><sm xmlns="urn:xmpp:sm:3"/><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/><register xmlns="http://jabber.org/features/iq-register"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/></stream:features>
2014-02-24 21:42:45.229  Send resume:
<resume xmlns="urn:xmpp:sm:3" h="6" previd="b9c7cef8-de96-49cf-b997-14542430e407"></resume>
2014-02-24 21:42:45.230  SEND: <resume xmlns="urn:xmpp:sm:3" h="6" previd="b9c7cef8-de96-49cf-b997-14542430e407"/>
2014-02-24 21:42:45.443  RECV RAW: <failed xmlns='urn:xmpp:sm:3'><unexpected-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></failed>
2014-02-24 21:42:45.446  XMPP: State Resuming - element = <failed xmlns="urn:xmpp:sm:3"><unexpected-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></unexpected-request></failed>

StreamManagementIOProcessor.java:

// if stream has resource binded then we should not resume
if (service.getUserJid() != null) {
    service.writeRawData("<failed xmlns='" + XMLNS + "'>"
    + "<unexpected-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"
    + "</failed>");
    return;
}

Looking at the client logs, when the app tries to resume is not binding the resource again.

So what are the clients doing wrong?

Thanks.


Replies (1)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 5 years ago

Hi,

I just analysed code once again and I found out that user jid of service may be set during this check but it must be null or set to bare jid to ensure that resource was not binded. I applied fix for this issue to master branch as well as to fixes-for-5.2 branch so this fix will be available in newly generated snapshot build of Tigase XMPP Server as well as will be part of 5.2.1 release.

    (1-1/1)