Openfire shows sessions connected and online or away, but Spark shows users offline

Occasionally, the Openfire server will crash or go offline or the database server hosting its database will go offline or crash. The crashing almost never happens, but what does usually happen is these servers will go offline (mostly for updates) and come back online.

When this happens, many of our uses have Spark configured to automatically reconnect. It seems when this happens some of the users rosters don’t update properly. As such, after an update cycle on the servers, we’ll often have a lot of users showing connected and online or away from the servers perspective (sessions tab in Openfire), but those users show as offline in other users rosters.

The only fix for this is to have the users that are showing offline in the Spark roster, but connected in Openfire, to logout and reconnect.

An example would be USER1 and USER2 auto-reconnect to the Openfire server after being disconnected due to either the Openfire server or DB server restarting from updates or a crash. Both users show online and connected in the sessions tab of Openfire, but USER2 appears offline to USER1. Both users are able to message. USER1 logging out and back in to his client makes no difference. However, USER2 logging out and back in resolves the issue and USER1 now shows USER2’s proper presence in his roster.

This is strange, because I would expect the sessions tab in Openfire to be the controlling authority as to who is online and not. And I would also expect, as in the previous example, that USER1 logging out and back in to resolve the issue. But, this is not the case.

Any insight to this problem would be great. I am posting this here, because all of our clients are Spark, but I feel like this might actually be an Openfire issue.

  • Openfire is version 4.4.1 on Windows Server 2019 Standard with Active Directory enabled for client authentication.
  • Openfire database is hosted on Microsoft SQL Server Standard 2014 on Windows Server 2016 Standard.
  • Spark is version 2.8.3 on Windows 10 1809. All clients use this Spark version on this Windows version.

Do you see the same picture on the users page when this happens? I think Sessions page is not an exact representation of online state. Although it replicates online and away icons. But there are cases when it can be showing a user as online on the users page (and in the clients, because this is governed by presence state), but not as online on the sessions page. This is how Stream Management works to keep user virtually online when his connection is poor and dropping very often. This is the opposite case to yours, but maybe there is a chance it also is affecting you. So, you can try disabling SM and restarting the server. Add this system property:
stream.management.active with a value false

You can also check Openfire logs and provide here (openfire/logs/all.log). Although this seems more like Openfire issue, you can also check Spark logs on both user1 and user2 machines

Error Logs:
C:\Users\User\AppData\Roaming\Spark\logs
There is a bunch of files, look through all of them and select events that correlate with the time of your issue.

wroot,

The users page in Openfire reflects what I see on the sessions page. So, it appears to be giving me the same info.

We are currently experiencing this issue with a handful of people, so I have something to test with. Additionally, when I click on users from the sessions page, I do see “Stream Management: Disabled” for everyone. Am I assuming correctly that Stream Management is already disabled? I checked the properties and don’t see that property “stream.management.active” set anywhere. So I assume its the defaults.

I’ll look through the client logs for some of these users.

ETA: The client and server logs were of no help. Most client logs of those clients that are experiencing the issue contained nothing. Others had warnings or errors related to the Openfire server/service going down. Which is expected.

Ah, Spark 2.8.3 doesn’t support Stream Management. Though it is enabled by default in Openfire. This system property is not shown by default. You have to create it to set it to false. Now it is even less chance that it is a culprit, but as you are not using SM in Spark anyway, you can still try to disable it. No need to restart Openfire. Only client update is necessary to pick up the new setting.

Other than that i have no other suggestions or ideas. Well, maybe you can install some other client for a few users that are affected most often, to rule out either Spark or Openfire issue. You can even try the latest test build of Spark (2.9.0), but it has some annoying bugs, so only for someone willing to do testing (and it is better to wipe out plugins folder in the current Spark profile before using 2.9.0). http://www.igniterealtime.org/downloads/nightly_spark.jsp