Hello,
I came across a strange issue involving random disconnections. We currently have Openfire 4.6.1 installed on a Windows 2019 Server with the clients running Spark 2.9.4 on Windows 10 Pro. There are only 6 users in a small office. It is an AD environment and Openfire is configured to use LDAPS and an embedded database.
The problem is that clients seem to get disconnected at random times. Sometimes 3 clients get disconnected one after the other while the others remain connected. At other times, all 6 can get disconnected within a few seconds of the other. This occurs once in a couple of weeks or days.
It actually started in previous versions of the server and client. But upgrading to the latest versions did not seem to help and the issue still exists. After a client is forcibly disconnected from the server, the Spark client is no longer running on those computers and Spark has to be re-started to re-connect. I tried setting the client idle timeout (xmpp.client.idle) as well as disabling stream management (stream.management.active) but those settings did not make any difference.
The client log files show no entries for these disconnects. The server log entries are as follows for each client that is dropped:
2021.01.11 11:06:05 org.jivesoftware.openfire.archive.ArchiveIndexer[MUCSEARCH] - Updating (not creating) an index since 'EPOCH'. This is suspicious, as it suggests that an existing, but empty index is being operated on. If the index is non-empty, index duplication might occur.
2021.01.11 11:11:05 org.jivesoftware.openfire.archive.ArchiveIndexer[MUCSEARCH] - Updating (not creating) an index since 'EPOCH'. This is suspicious, as it suggests that an existing, but empty index is being operated on. If the index is non-empty, index duplication might occur.
2021.01.11 11:16:05 org.jivesoftware.openfire.archive.ArchiveIndexer[MUCSEARCH] - Updating (not creating) an index since 'EPOCH'. This is suspicious, as it suggests that an existing, but empty index is being operated on. If the index is non-empty, index duplication might occur.
2021.01.11 11:17:21 org.jivesoftware.openfire.nio.ConnectionHandler - Closing connection due to exception in session: (0x00000004: nio socket, server, /192.168.0.101:51469 => /192.168.0.10:5222)
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_271]
at sun.nio.ch.SocketDispatcher.read(Unknown Source) ~[?:1.8.0_271]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) ~[?:1.8.0_271]
at sun.nio.ch.IOUtil.read(Unknown Source) ~[?:1.8.0_271]
at sun.nio.ch.SocketChannelImpl.read(Unknown Source) ~[?:1.8.0_271]
at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:378) ~[mina-core-2.1.3.jar:?]
at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:47) ~[mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:519) ~[mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$1200(AbstractPollingIoProcessor.java:68) ~[mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.process(AbstractPollingIoProcessor.java:1222) ~[mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.process(AbstractPollingIoProcessor.java:1211) ~[mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:683) ~[mina-core-2.1.3.jar:?]
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) ~[mina-core-2.1.3.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:1.8.0_271]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_271]
See the attached warn.log file where these strange errors are recorded. Iâm not certain what those MUCSEARCH errors mean or whether they even relate to this issue, but we donât use conference rooms or Multi-User Chat rooms at all.
warn.log (625.1 KB)
I would appreciate any help that anyone can offer. Thank you so much!
UPDATE 2/02/21:
I uninstalled the monitoring plugin and the messages about MUCSEARCH have vanished. But the random client drops still occur. So I guess one had nothing to do with the other.
I enabled the debug log in hopes of getting more details about those disconnects. Here is a sample block that I extracted from the debug.log showing the messages as 3 client connections are dropped one after the other just seconds apart:
2021.02.02 18:14:48 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event SESSION_IDLE to session 17
Queue : [SESSION_IDLE, ]
2021.02.02 18:14:48 org.jivesoftware.openfire.nio.ClientConnectionHandler - ConnectionHandler: Pinging connection that has been idle: org.jivesoftware.openfire.nio.NIOConnection@78d2c2e3 MINA Session: (0x00000011: nio socket, server, /192.168.0.102:62866 => /192.168.0.10:5222)
2021.02.02 18:14:48 org.apache.mina.filter.ssl.SslFilter - Session Server[17](SSL): Writing Message : WriteRequest: HeapBuffer[pos=0 lim=137 cap=4096: 3C 69 71 20 74 79 70 65 3D 22 67 65 74 22 20 69...]
2021.02.02 18:14:48 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event MESSAGE_SENT to session 17
Queue : [MESSAGE_SENT, ]
2021.02.02 18:14:48 org.apache.mina.filter.ssl.SslFilter - Session Server[17](SSL): Message received : HeapBuffer[pos=0 lim=133 cap=256: 17 03 03 00 80 55 7A FF 92 88 93 0E 7D 8D AF 95...]
2021.02.02 18:14:48 org.apache.mina.filter.ssl.SslHandler - Session Server[17](SSL) Processing the received message
2021.02.02 18:14:48 org.apache.mina.filter.ssl.SslFilter - Session Server[17](SSL): Processing the SSL Data
2021.02.02 18:14:48 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event MESSAGE_RECEIVED to session 17
Queue : [MESSAGE_RECEIVED, ]
2021.02.02 18:14:48 org.apache.mina.filter.codec.ProtocolCodecFilter - Processing a MESSAGE_RECEIVED for session 17
2021.02.02 18:14:50 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event EXCEPTION_CAUGHT to session 17
Queue : [EXCEPTION_CAUGHT, ]
2021.02.02 18:14:50 org.apache.mina.filter.ssl.SslHandler - Unexpected exception from SSLEngine.closeInbound().
javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
at sun.security.ssl.Alert.createSSLException(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.Alert.createSSLException(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.SSLEngineImpl.closeInbound(Unknown Source) ~[?:1.8.0_271]
at org.apache.mina.filter.ssl.SslHandler.destroy(SslHandler.java:209) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.ssl.SslFilter.sessionClosed(SslFilter.java:485) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:606) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:1092) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:98) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:606) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:599) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:251) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.removeNow(AbstractPollingIoProcessor.java:1142) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.removeSessions(AbstractPollingIoProcessor.java:864) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:694) [mina-core-2.1.3.jar:?]
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.1.3.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_271]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_271]
2021.02.02 18:14:50 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event SESSION_CLOSED to session 17
Queue : [SESSION_CLOSED, ]
2021.02.02 18:14:50 org.jivesoftware.openfire.SessionManager - Closing session with address user1@ourdomain.com/Spark 2.9.4 and streamID 9nwwokfj9q does not have SM enabled.
2021.02.02 18:14:50 org.jivesoftware.openfire.spi.RoutingTableImpl - Removing client route user1@ourdomain.com/Spark 2.9.4
::
::
::
::
2021.02.02 18:15:06 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event EXCEPTION_CAUGHT to session 18
Queue : [EXCEPTION_CAUGHT, ]
2021.02.02 18:15:06 org.apache.mina.filter.ssl.SslHandler - Unexpected exception from SSLEngine.closeInbound().
javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
at sun.security.ssl.Alert.createSSLException(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.Alert.createSSLException(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.SSLEngineImpl.closeInbound(Unknown Source) ~[?:1.8.0_271]
at org.apache.mina.filter.ssl.SslHandler.destroy(SslHandler.java:209) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.ssl.SslFilter.sessionClosed(SslFilter.java:485) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:606) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:1092) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:98) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:606) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:599) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:251) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.removeNow(AbstractPollingIoProcessor.java:1142) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.removeSessions(AbstractPollingIoProcessor.java:864) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:694) [mina-core-2.1.3.jar:?]
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.1.3.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_271]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_271]
2021.02.02 18:15:06 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event SESSION_CLOSED to session 18
Queue : [SESSION_CLOSED, ]
2021.02.02 18:15:06 org.jivesoftware.openfire.SessionManager - Closing session with address user2@ourdomain.com/Spark 2.9.4 and streamID 4gbu9b43tf does not have SM enabled.
2021.02.02 18:15:06 org.jivesoftware.openfire.spi.RoutingTableImpl - Removing client route user2@ourdomain.com/Spark 2.9.4
::
::
::
::
2021.02.02 18:15:55 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event EXCEPTION_CAUGHT to session 19
Queue : [EXCEPTION_CAUGHT, ]
2021.02.02 18:15:55 org.apache.mina.filter.ssl.SslHandler - Unexpected exception from SSLEngine.closeInbound().
javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
at sun.security.ssl.Alert.createSSLException(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.Alert.createSSLException(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.TransportContext.fatal(Unknown Source) ~[?:1.8.0_271]
at sun.security.ssl.SSLEngineImpl.closeInbound(Unknown Source) ~[?:1.8.0_271]
at org.apache.mina.filter.ssl.SslHandler.destroy(SslHandler.java:209) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.ssl.SslFilter.sessionClosed(SslFilter.java:485) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:606) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:1092) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:98) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:606) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:599) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:251) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.removeNow(AbstractPollingIoProcessor.java:1142) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.removeSessions(AbstractPollingIoProcessor.java:864) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:694) [mina-core-2.1.3.jar:?]
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.1.3.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_271]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_271]
2021.02.02 18:15:55 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event SESSION_CLOSED to session 19
Queue : [SESSION_CLOSED, ]
2021.02.02 18:15:55 org.jivesoftware.openfire.SessionManager - Closing session with address user3@ourdomain.com/Spark 2.9.4 and streamID 1uxxh5fk8b does not have SM enabled.
2021.02.02 18:15:55 org.jivesoftware.openfire.spi.RoutingTableImpl - Removing client route user3@ourdomain.com/Spark 2.9.4
debug.log (10.7 KB)
Anyone have any ideas how to proceed from here? Thank you!
UPDATE 3/02/21:
Iâve been monitoring both sites and so far it seems that the random drops may be caused by the enterprise endpoint AV software. This is surprising since weâve been using this software (Bitdefender GravityZone Business Security) for several years along with Spark/OF without issues.
I tracked it down to itâs âAdvanced Anti-Exploitâ module which seems to be enabled by default and kills running processes. So to test this theory, I disabled the module on one site and left it enabled on the other. Every 3 or 4 days, the drops are occurring on the site where itâs enabled. The other site has no drops at all.
I believe this module was updated automatically a year ago without my knowledge which is also around the time when the drops started to occur. Anyway, I will continue to monitor for another 2 weeks or so just to verify my suspicions and report back. If it turns out that this was the culprit, I will correct the title of this post accordingly and ask the mods to move it to the Spark forum.
Thanks to Speedy for getting me to take another closer look at the AV software!
UPDATE 3/15/21:
So after much testing, I concluded that it was indeed Bitdefenderâs newly introduced âAdvanced Anti-Exploitâ module that was causing all the client disconnections. Merely disabling the module had no effect - I had to actually remove the module from every workstation. Just the very presence of that module on a workstation, even when disabled, would still cause the drops.
Thank you everyone for your input and efforts especially, Guus, Wroot and Speedy!
Mods: Please move this post to the Spark Support forum. It turns out that Openfire had nothing to do with this issue after all. I renamed the title accordingly.