Project

General

Profile

Tigase, converse web client and MUC, wrong response?

Rubem Silva
Added over 3 years ago

Hi there.

I'm having an issue with converse and tigase xmpp server with MUC module.

For my understanding, i think i'm receiving a wrong response from the server, or maybe missed some configuration...

So my setup is:

Virtual machine (512mb RAM) 
tigase 7.0.0-b3802/263c8851 (2015-02-23/17:26:17)
apache 
converse js xmpp client

I am able to login successfully and chat with other users as well, the problem happens when i try to create a room. The room creation request/response is the following:

Request:
<body xmlns="http://jabber.org/protocol/httpbind" rid="6912400219" sid="a1dffbba-db82-4df8-a84b-71fbb317eb10">
   <presence xmlns="jabber:client" from="user1@chat.server.com" to="testroom@muc.chat.server.com/user1">
      <x xmlns="http://jabber.org/protocol/muc" />
   </presence>
</body>

Response:
<body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" xmlns:xmpp="urn:xmpp:xbosh" from="chat.server.com" host="b2bdv-node" xmpp:version="1.0" secure="true" ack="6912400219">
   <message xmlns="jabber:client" from="testroom@muc.chat.server.com" type="groupchat" to="user1@chat.server.com">
      <body>Welcome! You created new Multi User Chat Room.</body>
   </message>
</body>

From [[[http://xmpp.org/extensions/xep-0045.html#createroom-general]]] Example 153 and 154, you can see that the response is different and should be:

<presence
    from='coven@chat.shakespeare.lit/firstwitch'
    to='crone1@shakespeare.lit/desktop'>
  <x xmlns='http://jabber.org/protocol/muc#user'>
    <item affiliation='owner'
          role='moderator'/>
    <status code='110'/>
    <status code='201'/>
  </x>
</presence>

I attached log files from tigase (room creating) that show whats happening, and init_properties

Hope that someone can help me with this

Thank you


Replies (13)

Avatar?id=6098&size=32x32

Added by Bartosz Malkowski TigaseTeam over 3 years ago

MUC created all required stanzas:

2015-04-24 10:03:40.349 [in_2-message-router]  MessageRouter.processPacket()  FINEST:   Processing packet: from=null, to=null, DATA=<presence from="testroom@muc.chat.server.com/user1" to="user1@chat.server.com" xmlns="jabber:client"><x xmlns="http://jabber.org/protocol/muc#user"><item nick="user1" role="moderator" affiliation="owner" jid="user1@chat.server.com"/><status code="110"/><status code="201"/></x></presence>, SIZE=310, XMLNS=jabber:client, PRIORITY=HIGH, PERMISSION=NONE, TYPE=null

Don't know why it dissapeared.

%Wojtek, would you like to look at it?

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Please share your init.properties as well as (clear) logs with more verbose debugging, i.e.: --debug=server,xmpp.impl,net,io

Added by Rubem Silva over 3 years ago

Hi there

As requested, here you have more verbose log files.

I logged a fresh tigase restart and then i login with "admin" user. After that i tried to create a room called "adminroom".

Thanks

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Could you enforce your client to send the entering presence to either omit the from attribute or send it from the fullJID?

Have you made any modifications to either server or MUC component?

Added by Rubem Silva over 3 years ago

What do you mean?

No, I did not modify any component or tigase tigase server itself.

I noted that the resource ID is missing from the JID in the presence stanza, could this be problematic?

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

It may be, as the MUC component responds to the exact same JID that has sent the enter presence. However, Tigase should and do replace such from addresses to FullJID hence my question about any modifications.

(1)

Added by Rubem Silva over 3 years ago

Well i'm using xmpp prebind [[[https://github.com/candy-chat/xmpp-prebind-php/blob/master/lib/XmppPrebind.php]]], and there seems to be a problem with resource bind.

In fact that php script is sending resource bind request, however isnt concatenating the resource ID generated from tigase server to the JID. So when my client is attaching to session, the jid it uses isnt the full one with the resource, so when trying to use muc, tigase seems to not handle it right.

Also, that script tries to authenticate with complete JID, including the resource identifier. Im not xmpp expert but i think that its wrong.

Its strange however why this only affects muc.

Thanks for your help

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Rubem Silva wrote:

Well i'm using xmpp prebind [[[https://github.com/candy-chat/xmpp-prebind-php/blob/master/lib/XmppPrebind.php]]], and there seems to be a problem with resource bind.

Hm, it's curious because pre-bind in general should create/use anonymous session, however it looks like you are authenticating the user (or using authenticated session): authState=AUTHORIZED, isAnon=false, isTmp=false (from one of the user packets). Can you share the full XMPP stanza exchange with the server from the client?

In fact that php script is sending resource bind request, however isnt concatenating the resource ID generated from tigase server to the JID. So when my client is attaching to session, the jid it uses isnt the full one with the resource, so when trying to use muc, tigase seems to not handle it right.

As I've said - Tigase should replace incomming stanza from to user FullJID, but it's not in your case hence my earlier question.

Also, that script tries to authenticate with complete JID, including the resource identifier. Im not xmpp expert but i think that its wrong.

Again - full xml log would be helpful, as the library indicates it's for prebinding, yet it seems to have regular SASL implemented and... while Tigase allows attaching to already pre-binded session you need to create it externally.

Its strange however why this only affects muc.

Because in case of MUC having FullJID is essential to have responses directed to proper resource.

Added by Rubem Silva over 3 years ago

Do you want prebind log?

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Yes, complete connection log.

Added by Rubem Silva over 3 years ago

Hi

As requested, prebind log file without resource option.

Thank you

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Actually it turned out that Tigase wasn't correcting the from attribute in all cases (v. #2003) which resulted in broken MUC when you send BareJID in presence. Fix will be included in next nightly.

(1)

Added by Rubem Silva over 3 years ago

Thank you

    (1-13/13)