No module is handling this query While querying roster

I am trying to create a chat app using Ionic 2 and ejabberd. I am using strophejs to connect to the server using bosh

var iq = $iq({to : "xxx.xxx.xxx", type: 'get'}).c('query', { xmlns: Strophe.NS.ROSTER });
this.connection.sendIQ(iq,this.oncallback,this.errorcallback); 

The above code returns below error message. I am able to login to the server and I can see the user as online as well. I am trying to get the friends list of the particular user.

<iq xmlns="jabber:client" to="xxx@xxx.xxx.xxx/880788340237136043431" from="xxx.xxx.xxx" type="error" id="7a05bbb6-7a14-4eac-94f2-49a5a2bd9f79:sendIQ">
<query xmlns="jabber:iq:roster"/>
<error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">No module is handling this query</text>
</error>
</iq>

ejabberd version 17.01

I am new to ejabberd. Advance thanks to any one who can shed some light on this.

Try to login with a typical

Try to login with a typical Jabber client, like Psi, Gajim... Does it receive the roster properly? If so, then maybe the problem is in your library, or in your code, or maybe ejabberd and that library do not communicate correctly.

You can debug a little more the client-server communication using a network sniffer. The purpose is that you compare what Psi sends that works correctly, and what does your query send that works incorrectly.

I use this one, but any other can help (or you can set ejabberd loglevel to 5):

$ sudo tcpflow -i lo -Cg port 5222
tcpflow: listening on lo
...
<iq id='332:993826' xml:lang='es' type='get'><query xmlns='jabber:iq:roster'/></iq>
<iq xml:lang='es' to='user1@localhost/tka1' from='user1@localhost' type='result' id='332:993826'><query xmlns='jabber:iq:roster'/></iq>
...

Thanks for the reply. The

Thanks for the reply. The issue was with query code

var iq = $iq({to : "xxx.xxx.xxx", type: 'get'}).c('query', { xmlns: Strophe.NS.ROSTER });

the to : "xxx.xxx.xxx" was not needed.

Syndicate content