Tigase XMPP Server Board

API and development: RE: Network disconnection detection

Fri, 07/15/2016 - 12:30

Hi Mohammed,
Is the server detecting them at all?
I would have a look at the debug logs for xmpp to see where those packets go.

If you are using the nightly builds, you can set a connection watchdog that will disconnect inactive connections
details here: http://docs.tigase.org/tigase-server/snapshot/Administration_Guide/html/#watchdog
You can set some tighter tolerances and that will disconnect them.

Categories: Tigase Forums

Installation and maintenance: Missing initial presence packets

Wed, 07/13/2016 - 11:20

Hi,

While troubleshooting a problem i stumbled upon a scenario where presence packets(in response to initial presence packet) were not being sent.

While diagnostic that below configurations were missing in the application which restricts presence packet to be sent to offline users:

sess-man/plugins-conf/presence/skip-offline=false
sess-man/plugins-conf/presence/skip-offline-sys=false

Upon some more troubleshooting it seems all the contacts in roster are present but the RosterElement.lastSeen is set to default value(10000) for some of the roster members.

Because this value is set to default the presence packets are not sent for these roster memebers as per the code below in RosterFlat.java

public Element getCustomChild(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException {
RosterElement rel = getRosterElement(session, buddy);
if (rel != null && rel.getLastSeen() > RosterElement.INITIAL_LAST_SEEN_VAL) {
String stamp;
synchronized (formatter) {
stamp = formatter.format(new Date(rel.getLastSeen()));
}
return new Element("delay", new String[]{"stamp", "xmlns"}, new String[]{stamp, "urn:xmpp:delay"});
}
return null;
}

Please help me understand when the roster value is set to default and why it is not being assigned proper value though the user in the roster element has logged in to the application in past? Also if there is any workaround the problem?

Categories: Tigase Forums

API and development: Network disconnection detection

Mon, 07/11/2016 - 05:42

hi all,

I am using the tigase 7.0.4. I am facing a problem with the server not able to detect a connection loss from a user once his network is disconnected...he will be shown as online for other users...and the messages sent to this user during this time is also not saved as an offline message.is this the normal behavior or am i doing something wrong.

Please help
Thank you

Categories: Tigase Forums

API and development: RE: Some questions about DrupalWPAuth.

Mon, 07/04/2016 - 18:45

Thank you very much.

Categories: Tigase Forums

API and development: RE: Some questions about DrupalWPAuth.

Mon, 07/04/2016 - 07:10

Kelly Kuang wrote:

2. In Drupal 7.43, it is no longer use MD5 to generate the password digest. Although the input password is correct, the (1) value never equal the (2) value in DrupalWPAuth#plainAuth().
What can I do to solve value not equal problem? Do I need to implement my own password function according to Drupal password encode function and replace to DrupalWPAuth?

Unfortunately DrupalWPAuth supports only older versions of Drupal (or those with the new hashing disabled). You can either change the hashing used in Drupal or implement appropriate hashing in DrupalWPAuth.

Categories: Tigase Forums

API and development: RE: Too long resource

Mon, 07/04/2016 - 07:07

Thank you, I've commit a fix to the repository.

Categories: Tigase Forums

API and development: RE: Too long resource

Sun, 07/03/2016 - 19:17

sorry for reply so late!

Meothed init(Map<String, Object> settings) in BindResource.java called when component added or removed via web console(xx:8090/ui/, "Manage active server components"),
@Override public void init(Map<String, Object> settings) throws TigaseDBException { int hostnameHash = Math.abs( DNSResolver.getDefaultHostname().hashCode() ); // Init plugin configuration if (settings.get(DEF_RESOURCE_PREFIX_PROP_KEY) != null) { resourceDefPrefix = hostnameHash + "-" + settings.get(DEF_RESOURCE_PREFIX_PROP_KEY).toString(); } else { resourceDefPrefix = hostnameHash + "-" + resourceDefPrefix; } }

resourceDefPrefix accumulate every time when comp changed , It makes resource longer.

Categories: Tigase Forums

API and development: Some questions about DrupalWPAuth.

Sat, 07/02/2016 - 00:06

I want to change AuthRepository implement from TigaseCustomAuth to DrupalWPAuth.
But DrupalWPAuth#plainAuth() return false.

I confirm that DrupalWPAuth connect to Drupal DB successfully. And DrupalWPAuth can get the user info from Drupal DB.

In DrupalWPAuth#plainAuth() I find that:
(1) calculate the input password MD5 hex digest.
(2) get the user password digest(not plain text) from Drupal DB.
(3) verify above two values.

My questions:
1. The DrupalWPAuth#plainAuth() is deprecated. The otherAuth() is preferred. But in AuthRepoPlainCallbackHandler#handleVerifyPasswordCallback(), it is hardcode to use "PROTOCOL_VAL_NONSASL" not "PROTOCOL_VAL_SASL".

This property will control the AuthRepository use plainAuth.
I know that it call repo.otherAuth() in AuthRepoPlainCallbackHandler#handleVerifyPasswordCallback(). But inside the repo.otherAuth(), it still call plainAuth() according to the AuthRepository.PROTOCOL_VAL_NONSASL. (I have checked the code both in TigaseCustomAuth and DrupalWPAuth.)

Is there any configs to control the property in handleVerifyPasswordCallback()?
Is the DrupalWPAuth#saslAuth never be called?

2. In Drupal 7.43, it is no longer use MD5 to generate the password digest. Although the input password is correct, the (1) value never equal the (2) value in DrupalWPAuth#plainAuth().
What can I do to solve value not equal problem? Do I need to implement my own password function according to Drupal password encode function and replace to DrupalWPAuth?

Categories: Tigase Forums

API and development: RE: Too long resource

Tue, 06/28/2016 - 03:44

Hic cup wrote:

when comp(eg:http) add,edit and remove via web console,this mothed will be called, and resourceDefPrefix longer (eg:100@domain/1752483901-1752483901-1752483901-1752483901-tigase-279)

Can you rephrase it to make it more clear? Ideally with steps to reproduce and both expected result and (what you consider) wrong result?

Categories: Tigase Forums

API and development: Too long resource

Mon, 06/27/2016 - 23:59

hi!guys.
My client login and resource create by server.

In BindResource.java Mothed init(Map<String, Object> settings)
resourceDefPrefix = hostnameHash + "-" + resourceDefPrefix;

when comp(eg:http) add,edit and remove via web console,this mothed will be called, and resourceDefPrefix longer (eg:100@domain/1752483901-1752483901-1752483901-1752483901-tigase-279)

Categories: Tigase Forums

Installation and maintenance: RE: Pending SM messages lost during shutdown

Mon, 06/27/2016 - 12:00

Thanks for the insightful info! Looking forward to an even better shutdown handling.

Categories: Tigase Forums

Installation and maintenance: RE: Pending SM messages lost during shutdown

Mon, 06/27/2016 - 08:03

Messages which are in processing queue and in session management queues may be lost during server shutdown. This is caused by the fact that currently shutdown is initiated termination signal being sent to server. This all is done by design to allow fast shutdown and later fast startup which is needed during server restart.

Yes, message loss can be caused by that, however message processing and delivery should be fast so it is rather hard to loss message due to that.

StreamManagement is responsible for queuing packets sent to client until they are confirmed as delivered. Right now this messages are kept in memory until connection is dropped, stream is resumed or packets are confirmed as delivered. So server shutdown may cause drop of this messages as well.

We will work on improvements to message delivery and graceful server shutdown in version 7.2.0. We already started by sending stream termination to clients when server will be stopped which will trigger message redelivery from stream resumption queue.

Categories: Tigase Forums

API and development: RE: Invalid presence found: for presence probe.

Mon, 06/27/2016 - 05:27

fahad tasleem wrote:

Hi,

A user (A) is logged in form multiple devices. As he logs out from one device, a connection user (B) gets a presence packet with type "unavailable".

This is correct and done according to specification.

But the user (A) is online from another device.

Yes, because it send unavailable only for the resource B (i.e. user@server/B).

To get the latest status of the user, we are sending a probe packet from client.

In general specification Presence Probes says:

Presence probes SHOULD NOT be sent by a client, because in general a client will not need to send them since the task of gathering presence from a user's contacts is managed by the user's server. However, if a user's client generates an outbound presence probe then the user's server SHOULD route the probe (if the contact is at another server) or process the probe (if the contact is at the same server) and MUST NOT use its receipt of the presence probe from a connected client as the sole cause for returning a stanza or stream error to the client.

In principle - your client application should track all presence received from server for particular contact to track current status of the given contact and all it's resources.

However, following should not happen!

[...]

On tigase server we are seeing this error in logs.

[...]

Can you please let me know, why am I getting this error? How can I get latest status of user.

  • Which Tigase version do you use?
  • In which user session is the error thrown in the session of the from user (b@domain) or in the destination user (a@domain)?
  • Are you sure you are addressing correctly the packet to/from (i.e.: not swapping those fields making the request comming on the wrong connection)? Can you share bigger excerpt from the logs?
Categories: Tigase Forums

Installation and maintenance: RE: How to change JID's domain in Tigase database

Mon, 06/27/2016 - 04:01

Currently there is no easy way to achieve that - it requires changing each item in user_id column in the database and in addition to that re-calculating sha1 value for each row.
In addition - if you are using PubSub or Message Archiving component same process should be applied to it's tables.

Categories: Tigase Forums

API and development: Invalid presence found: for presence probe.

Wed, 06/22/2016 - 23:54

Hi,

A user (A) is logged in form multiple devices. As he logs out from one device, a connection user (B) gets a presence packet with type "unavailable". But the user (A) is online from another device. To get the latest status of the user, we are sending a probe packet from client.

<presence to="a@domain" from="b@domain/resource" id='ze5lV-36' type='probe'></presence>

On tigase server we are seeing this error in logs.

2016-06-23 06:14:37.256 [presence Queue Worker 1] Presence.process() INFO: Invalid presence found: from=c2s@domain, to=sess-man@domain, DATA=<presence from="b@domain/resource" to="a@domain" xmlns="jabber:client" id='ze5lV-36' type="probe"/>, SIZE=126, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=probe

Can you please let me know, why am I getting this error? How can I get latest status of user.

Thanks,
Fahad

Categories: Tigase Forums

Installation and maintenance: How to change JID's domain in Tigase database

Tue, 06/21/2016 - 06:11

Hi,
We would like to change our xmpp domain from let say test.com to test.net. Supposing that, thousands of users have been registered in Tigase database with test.com. Is there any way, for instance an Ad-hoc command, to convert Tigase database full JID domains from test.com to test.net?

Categories: Tigase Forums

API and development: RE: Reducing packet payload

Mon, 06/20/2016 - 08:13

hi Mauro Carrio, Could you share the new authentication method to me? My email account is , Thanks in advance!

Categories: Tigase Forums

API and development: RE: Offline message count

Mon, 06/20/2016 - 07:08

Tigase implements XEP-0013: Flexible Offline Message Retrieval which allows both retrieval of unread messages count as well as selective retrieval of such.

Categories: Tigase Forums

API and development: RE: Reducing packet payload

Mon, 06/20/2016 - 06:56

Mauro Carrio wrote:

So, I started thinking about the possibility of reducing the the in/out packets payload by replacing the most common words like: "message, presence, from, type, xmlns, body, chat, stream, auth... etc" into codes of 1 or 2 bytes.
Tigase should format the original stanza into this conversion before sending the message to the socket, and the client apps must traduce the codes once the packet arrives.

This somewhat feels like FunXMPP modification that (supposedly) whatsapp is using.

In your opinion:
Do you think this is more efficient than compressing with zlib?

We haven't made any tests so it's hard to answer this question. However, XEP-0286: Mobile Considerations states:

While this may mitigate some of the benefits of compression by raising compression ratios, in a large, real world deployment at HipChat, network traffic was still observed to decrease by a factor of 0.58 when enabling Stream Compression (XEP-0138) [4] with ZLIB compression!

Considering XEP-0229: Stream Compression with LZW could prove even better results as LZW usually offers better compression.

How big would be the impact for the Tigase Server Core?
Which would be the steps to achieve this?

This could be approached from the ConnectionManager perspective which could translates such packets before writing to socket. This would obviously incur additional performance decrease on the server.

Categories: Tigase Forums

API and development: RE: Offline message count

Sun, 06/19/2016 - 20:24

Thanks for the reply

Categories: Tigase Forums

Pages

Get in touch

We provide software products, consulting and custom development services

Tigase, Inc.
100 Pine Street, Suite 1250
San Francisco, CA 94111, USA
Phone: (415) 315 9771

Follow us on:

Twitter

Back to Top