powered by Jive Software

Smack-4.2.3 - Unexplained Exceptions thrown by smack on various conditions

android

#1

Received the following unexplained smack exceptions log. Not sure why case #1 occurs when aTalk is exited. It happens on Note 3 and can be repeated with the same result.

case #2 happens on Note-8 when trying to remove earlier subscribed contact (aaa123). Not sure why the exception is not thrown upon receiving the <\present> stanza but only when contact is removed @26 mins later. then callConnectionClosedOnErrorListener.

case #3:
on Note-8, it receives both the returned subscribe and subscribed stanza from aaa123. However smack does not trigger upper level to take action on the the 2 returned subscribed and subscribe request. Next ping from Note-8 triggers the exception.

The problem occurs while performing Presence Subscription test as described in
https://github.com/processone/ejabberd/issues/2352#issuecomment-377146175 (last comment)

Appreciate some assistance on what can be the causes.

case #1:

04-03 11:26:35.401 14322-14491/org.atalk.android D/SMACK: SENT (0): <presence id='ksckH-85'><status></status><priority>30</priority><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://android.atalk.org' ver='+2gTKKtAURCQpAYqIsV3IgTmQRU='/><x xmlns='vcard-temp:x:update'></x></presence>
04-03 11:26:36.391 14322-14492/org.atalk.android D/SMACK: RECV (0): <presence xml:lang='en' to='aaa123@atalk.org/atalk' from='aaa123@atalk.org/atalk' id='ksckH-85'><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://android.atalk.org' ver='+2gTKKtAURCQpAYqIsV3IgTmQRU='/><x xmlns='vcard-temp:x:update'/><priority>30</priority><status/></presence>
04-03 11:26:36.781 14322-14492/org.atalk.android D/SMACK: RECV (0): <r xmlns='urn:xmpp:sm:3'/>
04-03 11:27:08.531 14322-14491/org.atalk.android D/SMACK: SENT (0): <presence id='ksckH-89' type='unavailable'><x xmlns='vcard-temp:x:update'></x></presence>
    SENT (0): <r xmlns='urn:xmpp:sm:3'/><a xmlns='urn:xmpp:sm:3' h='22'/>
    SENT (0): </stream:stream>
04-03 11:27:08.561 14322-14492/org.atalk.android D/SMACK: RECV (0): <a h='25' xmlns='urn:xmpp:sm:3'/>
    RECV (0): <r xmlns='urn:xmpp:sm:3'/>
    RECV (0): </stream>
04-03 11:27:08.561 14322-14492/org.atalk.android W/aTalk: [10] org.jivesoftware.smack.util.PacketParserUtils.parsePresence() Failed to parse extension element in Presence stanza: "org.xmlpull.v1.XmlPullParserException: expected: /stream:stream read: stream (position:END_TAG </stream>@1:19523 in org.jivesoftware.smack.util.ObservableReader@ab07425) " from: 'aaa123@atalk.org/atalk id: 'ksckH-85'
04-03 11:27:18.541 14322-14341/org.atalk.android I/aTalk: [0] org.jivesoftware.smack.tcp.XMPPTCPConnection.shutdown() Exception while waiting for closing stream element from the server XMPPTCPConnection[aaa123@atalk.org/atalk] (0)
    org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). While waiting for stream closing element received
        at org.jivesoftware.smack.SynchronizationPoint.checkForResponse(SynchronizationPoint.java:272)

case #2:

04-03 12:11:31.882 11602-12932/org.atalk.android D/SMACK: RECV (0): <presence xml:lang='en' to='swordfish@atalk.org/atalk' from='aaa123@atalk.org/atalk' id='Iz26w-83'><x xmlns='vcard-temp:x:update'/><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://android.atalk.org' ver='+2gTKKtAURCQpAYqIsV3IgTmQRU='/><priority>30</priority><status/></presence>
04-03 12:37:17.836 11602-12931/org.atalk.android D/SMACK: SENT (0): <iq id='Zucpd-129' type='set'><query xmlns='jabber:iq:roster'><item jid='aaa123@atalk.org' name='aaa123@atalk.org' subscription='remove'></item></query></iq>
04-03 12:37:17.838 11602-12932/org.atalk.android W/aTalk: [19641] org.jivesoftware.smack.util.PacketParserUtils.parsePresence() Failed to parse extension element in Presence stanza: "java.net.SocketException: socket is closed" from: 'aaa123@atalk.org/atalk id: 'Iz26w-83'
04-03 12:37:17.841 11602-12931/org.atalk.android W/aTalk: [19640] org.jivesoftware.smack.AbstractXMPPConnection.callConnectionClosedOnErrorListener() Connection XMPPTCPConnection[swordfish@atalk.org/atalk] (0) closed with error
    javax.net.ssl.SSLException: Write error: ssl=0xcd0a2d80: I/O error during system call, Broken pipe
        at com.android.org.conscrypt.NativeCrypto.SSL_write(Native Method)
04-03 12:37:26.878 11602-2482/org.atalk.android D/SMACK: XMPPConnection (XMPPTCPConnection[swordfish@atalk.org/atalk] (0)) will reconnect in 4
04-03 12:37:27.845 11602-2481/org.atalk.android W/System.err: org.jivesoftware.smack.SmackException$NotConnectedException: The connection XMPPTCPConnection[swordfish@atalk.org/atalk] (0) is no longer connected while waiting for response with IQReplyFilter: iqAndIdFilter (AndFilter: (OrFilter: (IQTypeFilter: type=error, IQTypeFilter: type=result), StanzaIdFilter: id=Zucpd-129)), : fromFilter (OrFilter: (FromMatchesFilter (full): null, FromMatchesFilter (ignoreResourcepart): swordfish@atalk.org, FromMatchesFilter (full): atalk.org))
04-03 12:37:27.846 11602-2481/org.atalk.android W/System.err:     at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:258)
04-03 12:37:27.847 11602-2481/org.atalk.android W/System.err:     at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:214)
04-03 12:37:27.848 11602-2481/org.atalk.android W/System.err:     at org.jivesoftware.smack.roster.Roster.removeEntry(Roster.java:766)
04-03 12:37:27.849 11602-2481/org.atalk.android W/System.err:     at net.java.sip.communicator.impl.protocol.jabber.ServerStoredContactLi

case #3:

04-03 14:20:39.033 886-1033/org.atalk.android D/SMACK: RECV (0): <presence xml:lang='en' to='swordfish@atalk.org/atalk' from='aaa123@atalk.org' type='subscribe' id='l8RoZ-168'><x xmlns='vcard-temp:x:update'/></presence>
04-03 14:50:39.533 886-1032/org.atalk.android D/SMACK: SENT (0): <iq to='atalk.org' id='WKAuo-162' type='get'><ping xmlns='urn:xmpp:ping'/></iq>
04-03 14:50:39.539 886-1033/org.atalk.android W/aTalk: [19842] org.jivesoftware.smack.util.PacketParserUtils.parsePresence() Failed to parse extension element in Presence stanza: "java.net.SocketException: socket is closed" from: 'aaa123@atalk.org id: 'l8RoZ-168'
04-03 14:50:39.544 886-1032/org.atalk.android W/aTalk: [19841] org.jivesoftware.smack.AbstractXMPPConnection.callConnectionClosedOnErrorListener() Connection XMPPTCPConnection[swordfish@atalk.org/atalk] (0) closed with error

#2

The problems described here seem to be related to the reported problem which has been fixed. All <presence/> stanza problems are now OK.