AnsweredAssumed Answered

Bug in Stream Managament?

Question asked by andrejvanderzee on Jan 29, 2015
Latest reply on Feb 2, 2015 by andrejvanderzee

Hi,

 

I am having a problem with Stream Management in the beta1 version. It looks like the handleCount is not initialised at the right time and therefor I keep getting a "h attribute too big" error from the server. It looks like the <presence> packets that are sent in between mess up the counting. As a result, the connection is taken down, re-established, taken down, etc. Smack becomes unusable.

 

A possible solution might be for Smack to send <enable> first and then <session>. So basically enable Stream Management before opening a session (since the session is opened all messages are possible to route to the client’s TCP socket).

 

Thanks,
Andrej

 

 

SEND (0): <stream:stream xmlns='jabber:client' to='localhost' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

RECV (0): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1738634034' from='localhost' version='1.0' xml:lang='en'>

RECV (0): <stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mech anism>SCRAM-SHA-1</mechanism><mechanism>PLAIN</mechanism></mechanisms><register xmlns='http://jabber.org/features/iq-register'/><sm xmlns='urn:xmpp:sm:3'/></stream:features>

XMPPConnection connected (0)

SENT (0): <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1'>biwsbj0zOGQwYzBlOGNmZDI0NTIyODM1ZGI3MDAyZTY1YTk1OSxyPWB TXTUmO0dOYFhTSj5uS01EYn5cMFx3cXFfXWNuZE12</auth>

RECV (0): <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cj1gU101JjtHTmBYU0o+bktNRGJ+XDBcd3FxX1 1jbmRNdmFINm9UdzNQTU5UQVgxUTRRcDdYamc9PSxzPUN2RWpiWkQ1dUIwOVpPMVExbVVXZVE9PSxpPT QwOTY=</challenge>

SENT (0): <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>Yz1iaXdzLHI9YFNdNSY7R05gWFNKPm5LTURifl wwXHdxcV9dY25kTXZhSDZvVHczUE1OVEFYMVE0UXA3WGpnPT0scD04aUp1bXd1Ris4NWRhejRKSURqTz Q4dm9FR2c9</response>

RECV (0): <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>dj10MmhJRmoxQk14bHB5RDhDVFU4aFVRaWJjdT Q9</success>

SENT (0): <stream:stream xmlns='jabber:client' to='localhost' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

SENT (0): <resume xmlns='urn:xmpp:sm:3' h='4' previd='H0QLuwKXuyVhMVQBev8flsa7Fa4u'/>

RECV (0): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='164996246' from='localhost' version='1.0' xml:lang='en'><stream:features><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/><register xmlns='http://jabber.org/features/iq-register'/><sm xmlns='urn:xmpp:sm:3'/></stream:features>

RECV (0): <failed xmlns='urn:xmpp:sm:3'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></failed>

SENT (0): <iq id='jKjL8-13' type='set'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>android/38a332ee3de6e61a</re source></bind></iq>

RECV (0): <iq id='jKjL8-13' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>38d0c0e8cfd24522835db7002e65a959@ localhost/android/38a332ee3de6e61a</jid></bind></iq>

SENT (0): <iq id='jKjL8-15' type='set'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>

RECV (0): <iq type='result' id='jKjL8-15'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>

SENT (0): <enable xmlns='urn:xmpp:sm:3' resume='true'/>

RECV (0): <enabled xmlns='urn:xmpp:sm:3' id='SNotjaGyWKTOsCver4EEfApyU35x' resume='true'/>

SENT (0): <presence id='jKjL8-7'></presence>

User logged (0): 38d0c0e8cfd24522835db7002e65a959@localhost:5222/android/38a332ee3de6e61a

SENT (0): <iq id='jKjL8-8' type='get'><query xmlns='jabber:iq:roster'></query></iq>

SENT (0): <presence id='jKjL8-17'></presence>

XMPPConnection authenticated (0)

XMPPConnection reconnected (0)

SENT (0): <r xmlns='urn:xmpp:sm:3'/>

SENT (0): <iq id='jKjL8-18' type='get'><query xmlns='jabber:iq:roster'></query></iq>

RECV (0): <a xmlns='urn:xmpp:sm:3' h='3'/>

RECV (0): <presence from='38d0c0e8cfd24522835db7002e65a959@localhost/android/38a332ee3de6e61a' to='38d0c0e8cfd24522835db7002e65a959@localhost/android/38a332ee3de6e61a' xml:lang='' id='jKjL8-7'/><r xmlns='urn:xmpp:sm:3'/>

SENT (0): <a xmlns='urn:xmpp:sm:3' h='2'/>

RECV (0): <presence from='7154a5d8af3e4221976d374b2f05e4c1@localhost/android/16d8ca6d93b4223f' to='38d0c0e8cfd24522835db7002e65a959@localhost/android/38a332ee3de6e61a' xml:lang='' id='6k7YX-5'><delay xmlns='urn:xmpp:delay' from='7154a5d8af3e4221976d374b2f05e4c1@localhost/android/16d8ca6d93b4223f' stamp='2015-01-29T08:26:32Z'></delay><x xmlns='jabber:x:delay' stamp='20150129T08:26:32'/></presence>

RECV (0): <r xmlns='urn:xmpp:sm:3'/><presence from='38d0c0e8cfd24522835db7002e65a959@localhost/android/38a332ee3de6e61a' to='38d0c0e8cfd24522835db7002e65a959@localhost/android/38a332ee3de6e61a' xml:lang='' id='jKjL8-17'/><r xmlns='urn:xmpp:sm:3'/>

SENT (0): <a xmlns='urn:xmpp:sm:3' h='3'/>

SENT (0): <a xmlns='urn:xmpp:sm:3' h='4'/>

RECV (0): <iq from='38d0c0e8cfd24522835db7002e65a959@localhost' to='38d0c0e8cfd24522835db7002e65a959@localhost/android/38a332ee3de6e61a' id='jKjL8-8' type='result'><query xmlns='jabber:iq:roster'><item subscription='both' name='friendx' jid='7154a5d8af3e4221976d374b2f05e4c1@localhost'/></query></iq><r xmlns='urn:xmpp:sm:3'/>

SENT (0): <a xmlns='urn:xmpp:sm:3' h='5'/>

RECV (0): <iq from='38d0c0e8cfd24522835db7002e65a959@localhost' to='38d0c0e8cfd24522835db7002e65a959@localhost/android/38a332ee3de6e61a' id='jKjL8-18' type='result'><query xmlns='jabber:iq:roster'><item subscription='both' name='friendx' jid='7154a5d8af3e4221976d374b2f05e4c1@localhost'/></query></iq><r xmlns='urn:xmpp:sm:3'/>

SENT (0): <a xmlns='urn:xmpp:sm:3' h='6'/>

RECV (0): <stream:error><policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>h attribute too big</text></stream:error></stream:stream>

01-29 08:25:31.527    1362-1422/com.fansz W/AbstractXMPPConnection﹕ Connection closed with error

    <stream:error><policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang=''>h attribute too big</text></stream:error>

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:968)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:902)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:921)

01-29 08:25:31.527    1362-1422/com.fansz I/ImManager﹕ connectionClosedOnError(Exception e)

Outcomes