Openfire 4.1.1 - On joining MUC, status code 110 not sent

Hello,

I’ve encountered an issue with Openfire 4.1.1. When I join a MUC room, the presence stanza for “myself” does not include a status code of 110, as required by XEP-0045. This is supposed to have been implemented in Openfire 3.9.x, and I did indeed locate the source code responsible for setting that status code element. However, for whatever reason, it’s not actually setting it. At first glance, this issue appears to be the same as https://issues.igniterealtime.org/browse/OF-860, but that was fixed several years ago in 3.10.0. There’s also this topic from over a year ago with no replies: Openfire doesn't return status 110 when joining MUC

I actually noticed this issue when upgrading my client application from Smack 4.1 to 4.3, since the latter waits specifically for a stanza with that status code and ends up timing out. To verify this while removing my own code from the equation, I tested this using the Swift 4.0.2 XMPP client.

The MUC room is a persistent room with the following settings. (personal info redacted)

In this scenario, the MUC room contains one existing user, who is an owner of the room. My client joins afterwards and is a member. The Permissions for the room have been set accordingly and both users are able to join:

Here is what it looks like when I try to join the MUC room in the Swift client. It does correctly show the “Moderator” and “Participant” usernames.

And here are the incoming and outgoing XMPP stanzas from Swift’s debug console:

Note the last presence stanza (not sure why it’s duplicated) which is missing the element required by XEP-0045.

And here is the stack trace from my application using Smack 4.3. The stanzas were the same - I did receive the presence stanza for “myself”, but it did not contain any status code element, so the stanza filter did not pick it up as a response, and it timed out.

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 15000ms (~15s). Waited for response using: AndFilter: (StanzaTypeFilter: Presence, OrFilter: (AndFilter: (FromMatchesFilter (ignoreResourcepart): tonytestmuc6@conference.MYXMPPDOMAIN.com, MUCUserStatusCodeFilter: status=110), AndFilter: (FromMatchesFilter (full): tonytestmuc6@conference.MYXMPPDOMAIN.com/USERNAME, StanzaIdFilter: id=V3LAz-51, PresenceTypeFilter: type=error))).
at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:111)
at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:98)
at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:265)
at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:376)
at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:740)
(my application’s stack traces, ultimately called from java.util.concurrent.ScheduledThreadPoolExecutor)

My Swift debug console output didn’t get escaped properly. Let’s try again with a manually escaped log:

<!-- OUT 2018-08-13T14:48:47 -->
<presence to="tonytestmuc6@conference.MYXMPPDOMAIN.com/MYUSERNAME@MYXMPPDOMAIN.com"><status></status><x xmlns="vcard-temp:x:update"><photo></photo></x><c hash="sha-1" node="http://swift.im" ver="3ScHZH4hKmksks0e7RG8B4cjaT8=" xmlns="http://jabber.org/protocol/caps"/><x xmlns="http://jabber.org/protocol/muc"><password></password></x></presence>
<!-- IN 2018-08-13T14:48:47 -->
<presence to="MYUSERNAME@MYXMPPDOMAIN.com/1tioimm069" id="j5L6t-386" from="tonytestmuc6@conference.MYXMPPDOMAIN.com/OTHERUSERNAME@MYXMPPDOMAIN.com"><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="E6FpoDPmjMQ3i53V+HWh0YBrS7U="/><x xmlns="http://jabber.org/protocol/muc#user"><item jid="OTHERUSERNAME@MYXMPPDOMAIN.com/LOCAL" affiliation="owner" role="moderator"/></x></presence>
<!-- OUT 2018-08-13T14:48:47 -->
<presence to="tonytestmuc6@conference.MYXMPPDOMAIN.com/MYUSERNAME@MYXMPPDOMAIN.com"><status></status><x xmlns="vcard-temp:x:update"><photo></photo></x><c hash="sha-1" node="http://swift.im" ver="3ScHZH4hKmksks0e7RG8B4cjaT8=" xmlns="http://jabber.org/protocol/caps"/></presence>
<!-- IN 2018-08-13T14:48:47 -->
<presence to="MYUSERNAME@MYXMPPDOMAIN.com/1tioimm069" from="tonytestmuc6@conference.MYXMPPDOMAIN.com/MYUSERNAME@MYXMPPDOMAIN.com"><status/><x xmlns="vcard-temp:x:update"><photo/></x><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://swift.im" ver="3ScHZH4hKmksks0e7RG8B4cjaT8="/><x xmlns="http://jabber.org/protocol/muc#user"><item jid="MYUSERNAME@MYXMPPDOMAIN.com/1tioimm069" affiliation="member" role="participant"/></x></presence>
<!-- IN 2018-08-13T14:48:47 -->
<presence to="MYUSERNAME@MYXMPPDOMAIN.com/1tioimm069" from="tonytestmuc6@conference.MYXMPPDOMAIN.com/MYUSERNAME@MYXMPPDOMAIN.com"><status/><x xmlns="vcard-temp:x:update"><photo/></x><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://swift.im" ver="3ScHZH4hKmksks0e7RG8B4cjaT8="/><x xmlns="http://jabber.org/protocol/muc#user"><item jid="MYUSERNAME@MYXMPPDOMAIN.com/1tioimm069" affiliation="member" role="participant"/></x></presence>
<!-- IN 2018-08-13T14:48:47 -->
<r xmlns='urn:xmpp:sm:2' />
<!-- OUT 2018-08-13T14:48:47 -->
<a h="35" xmlns="urn:xmpp:sm:2"/>
<!-- IN 2018-08-13T14:58:18 -->

As usually we would suggest to first test it against the latest version of Openfire.

I was able to reproduce this on Openfire 4.2.3. The scenario is the same as described above: my client application is joining a MUC room which is already occupied by the owner of the room. Here are the stanzas related to the MUC room (tonytestmuc8):

Sent XMPP stanza: <presence xmlns=‘jabber:client’ to=‘tonytestmuc8@conference.MYXMPPDOMAIN.com/MYUSERNAME’ id=‘uPfQY-235’><x xmlns=‘http://jabber.org/protocol/muc’><history seconds=‘0’/></x><c xmlns=‘http://jabber.org/protocol/caps’ hash=‘sha-1’ node=‘http://www.igniterealtime.org/projects/smack’ ver=‘E6FpoDPmjMQ3i53V+HWh0YBrS7U=’/></presence>

Received XMPP stanza: <presence xmlns=‘jabber:client’ to=‘MYUSERNAME@MYXMPPDOMAIN.com/gateway’ from=‘tonytestmuc8@conference.MYXMPPDOMAIN.com/OTHERUSER@MYXMPPDOMAIN.com’ id=‘wH4z2-7502307’><c xmlns=‘http://jabber.org/protocol/caps’ hash=‘sha-1’ node=‘http://www.igniterealtime.org/projects/smack’ ver=‘E6FpoDPmjMQ3i53V+HWh0YBrS7U=’/><x xmlns=‘http://jabber.org/protocol/muc#user’><item affiliation=‘owner’ jid=‘OTHERUSER@MYXMPPDOMAIN.com/LOCAL’ role=‘moderator’></item></x></presence>

Received XMPP stanza: <presence xmlns=‘jabber:client’ to=‘MYUSERNAME@MYXMPPDOMAIN.com/gateway’ from=‘tonytestmuc8@conference.MYXMPPDOMAIN.com/MYUSERNAME’ id=‘uPfQY-235’><c xmlns=‘http://jabber.org/protocol/caps’ hash=‘sha-1’ node=‘http://www.igniterealtime.org/projects/smack’ ver=‘E6FpoDPmjMQ3i53V+HWh0YBrS7U=’/><x xmlns=‘http://jabber.org/protocol/muc#user’><item affiliation=‘member’ jid=‘MYUSERNAME@MYXMPPDOMAIN.com/gateway’ role=‘participant’></item></x></presence>

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 15000ms (~15s). Waited for response using: AndFilter: (StanzaTypeFilter: Presence, OrFilter: (AndFilter: (FromMatchesFilter (ignoreResourcepart): tonytestmuc8@conference.MYXMPPDOMAIN.com, MUCUserStatusCodeFilter: status=110), AndFilter: (FromMatchesFilter (full): tonytestmuc8@conference.MYXMPPDOMAIN.com/MYUSERNAME, StanzaIdFilter: id=uPfQY-235, PresenceTypeFilter: type=error))).
at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:111)
at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:98)
at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:265)
at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:376)
at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:740)
(stack frames from my client app and from ScheduledThreadPoolExecutor)
at java.lang.Thread.run(Unknown Source)

This is from my client application which is using Smack 4.3.0. The second “received” stanza is the “self-presence” stanza for the client itself joining the room, so according to XEP-0045 it should have a <status code=‘110’/> element, but it does not.

I see that in the time it took for me to get our Openfire server upgraded to 4.2.3, someone else already reported the same exact issue:

https://issues.igniterealtime.org/browse/OF-1598

1 Like