Projects tigase _server server-core Issues #194
disabling roster breaks BOSH connections (#194)
Closed
tom quas opened 1 decade ago

goal: disable roster for all users the easy way by adding -jabber:iq:roster to the list of sm-plugins

platform: tigase 5.1.4

actual behavior: BOSH clients cannot connect, they seem to fail with this message:

2013-03-02 08:54:05 BoshConnectionManager.processSocketData() INFO: There is no session with given SID. Closing invalid connection

note: regular TCP connections on 5222/5223 work flawlessly. as expected: iq stanzas return feature-not-implemented. correctBOSH clients

Artur Hefczyc commented 1 decade ago

Hi, my guess is that the Bosh client does not react properly on the roster error response. From the XMPP protocol point of view there is no difference between standard XMPP and Bosh connection, so the stanza flow should be exactly the same in both cases, at least from the sever point of view.

What Bosh client/library do you use? Do you have any communication dump between the Bosh client and the server?

tom quas commented 1 decade ago

you may be right: i checked my custom BOSH client, based on strophe.js, and it actually never sends the roster query. but it hangs. connecting to the same server via BOSH using pidgin actually works. need to investigate further...

Artur Hefczyc commented 1 decade ago

Ok, thank you for update, let me know if you find something.

tom quas commented 1 decade ago

in fact, it not only breaks BOSH connections, it somehow seems to cause the server to block after receiving the initial presence stanza.

setup:

  1. two pidgin accounts connected to tigase via 5222: joe@example.net/pidgin, blah@example.net/pidgin. buddy list: empty

  2. SendMsgBot command line client from http://sleekxmpp.com/getting_started/sendlogout.html

start SendMsgBot via

$ python ./send_client.py -d -p xxx -j joe@example.net -t blah@example.net -m "This is a message"

configuration: jabber:iq:roster disabled

  1. edit SendMsgBot

  2. comment out self.get_roster()

  3. run. the client happily reports that all messages have been sent (presence, message) but the server never received the message stanza; verified via pidgin

configuration: jabber:iq:roster enabled

  1. take the same SendMsgBot client

  2. comment out self.get_roster()

  3. run. the client happily reports that all messages have been sent (presence, message) but the server never received the message stanza; verified via pidgin

configuration: jabber:iq:roster enabled

  1. take the same SendMsgBot client

  2. leave the call to self.get_roster()

  3. run. everything works as expected, the message appears in pidgin

summary: without asking for the roster, things seem to get confused.

any idea what's going on?

tigase version from the logs: Tigase ver. 5.2.0-SNAPSHOT build 81879d5a (Feb 27, 2013 5:28:59 PM)

$ wajig list openjdk-7-*

ii openjdk-7-jdk:amd64 7u15-2.3.7-0ubuntu1~12.10.1 amd64 OpenJDK Development Kit (JDK)

ii openjdk-7-jre:amd64 7u15-2.3.7-0ubuntu1~12.10.1 amd64 OpenJDK Java runtime, using Hotspot JIT

ii openjdk-7-jre-headless:amd64 7u15-2.3.7-0ubuntu1~12.10.1 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)

ii openjdk-7-jre-lib 7u15-2.3.7-0ubuntu1~12.10.1 all OpenJDK Java runtime (architecture independent libraries)

tom quas commented 1 decade ago

attached is the log of a session

Artur Hefczyc commented 1 decade ago

There is no specific dependency on the roster inside the Tigase and requesting a roster or not by a client does not have any effect on Tigase internal states or communication. I would rather suspect a client side dependency on the roster retrieving rather than the server side issue.

Especially, that you said for yourself that the server never received the message stanza. If the server never received it, then it could not deliver it. This really means a client side issue not the server side. Of course a definite answer would give us server logs as we could see what has been received from the client, how it processed the stanza and what has been sent to the client.

I have just run a very basic test with extremely simple XMPP client ;-) which is telnet, to check how the server behaves when the roster is not requested and to make sure it does not affect the server stanza processing. I am attaching the full session below. As you can see, the roster was never requested and the message stanza sent in the last request has been delivered correctly. The roster plugin was disabled on the server.

$ telnet localhost 5222
Trying ::1...
Connected to localhost.
Escape character is '^]'.
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" version="1.0" xmlns="jabber:client" to="devel.tigase.org" xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace">

<?xml version='1.0'?>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='devel.tigase.org' id='4071b1a2-23d5-4a42-9ae0-25bfc3596b77' version='1.0' xml:lang='en'>
<stream:features>
<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>

<auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">XXXXXXXXXX</auth>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>

<stream:stream xmlns:stream="http://etherx.jabber.org/streams" version="1.0" xmlns="jabber:client" to="devel.tigase.org" xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace">

<?xml version='1.0'?>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='devel.tigase.org' id='4071b1a2-23d5-4a42-9ae0-25bfc3596b77' version='1.0' xml:lang='en'>
<stream:features>
<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>

<iq type="set" id="bind_1">
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
<resource>devel</resource>
</bind>
</iq>
<iq to="XXXX@XXXXXXXXX/devel" xmlns="jabber:client" type="result" id="bind_1"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>XXXXX@XXXXXXXX/devel</jid></bind></iq>

<message to="AAAAA@xxxxxxxxx" id="aac0a">
<subject>ytest</subject>
<body>test sdasfdfsdf</body>
<nick xmlns="http://jabber.org/protocol/nick">test1</nick>
</message>
         
^CConnection closed by foreign host.
tom quas commented 1 decade ago

not seeing this anymore. ticket can be closed. thx.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
1091
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#194
Please wait...
Page is in error, reload to recover