Coder Social home page Coder Social logo

openfire-monitoring-plugin's People

Contributors

aixigo-skonieczek avatar akrherz avatar annovanvliet avatar crayon2000 avatar deleolajide avatar dependabot[bot] avatar dwd avatar fishbowler avatar flowdalic avatar gregdthomas avatar guusdk avatar ishmakov avatar ivan4537 avatar jonnyheavey avatar leonroy avatar liamgregory avatar linuschien avatar mattskala avatar mightymop avatar nielskr avatar pgoski avatar promiselaoliu avatar richmidwinter avatar sco0ter avatar smu-cns avatar snyk-bot avatar thanosz avatar transifex-integration[bot] avatar wrooot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openfire-monitoring-plugin's Issues

SQL Server incompatibility

I've found that Exception in the logs with Version 1.8.0
(Openfire 4.4 on SQL Server)
SQL Server does not know "LIMIT" ... it uses "TOP" or "OFFSET"

2019.07.10 08:21:45 ERROR [message-archive-handler-93]: com.reucon.openfire.plugin.archive.impl.MucMamPersistenceManager - SQL failure during MAM-MUC:
java.sql.SQLException: Incorrect syntax near 'LIMIT'.
        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) ~[jtds-1.3.1.jar:1.3.1]
        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988) ~[jtds-1.3.1.jar:1.3.1]
        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) ~[jtds-1.3.1.jar:1.3.1]
        at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671) ~[jtds-1.3.1.jar:1.3.1]
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505) ~[jtds-1.3.1.jar:1.3.1]
        at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029) ~[jtds-1.3.1.jar:1.3.1]
        at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122) ~[commons-dbcp2-2.6.0.jar:2.6.0]
        at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122) ~[commons-dbcp2-2.6.0.jar:2.6.0]
        at com.reucon.openfire.plugin.archive.impl.MucMamPersistenceManager.getArchivedMessages(MucMamPersistenceManager.java:143) ~[?:?]
        at com.reucon.openfire.plugin.archive.impl.MucMamPersistenceManager.findMessages(MucMamPersistenceManager.java:103) ~[?:?]
        at com.reucon.openfire.plugin.archive.xep0313.IQQueryHandler.retrieveMessages(IQQueryHandler.java:326) ~[?:?]
        at com.reucon.openfire.plugin.archive.xep0313.IQQueryHandler.lambda$handleIQ$0(IQQueryHandler.java:205) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_202]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_202]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_202]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_202]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]

Recent MUC messages missing in archive result

The response to a (MAM) query for a chatroom should, but does not always, include all messages that were exchanged in the MUC at the time that the query was issued.

The MUC persistence manager writes message archives periodically (in batches), while the MAM implementation expects all archived messages to be in the database immediately. This can lead to situations where "the last few" messages in a MUC are not included in the response for a message archive.

This issue is closely related to https://issues.igniterealtime.org/browse/OF-1200, which resolved a similar issue. In OF-1200, the mechanism in which the Monitoring plugin writes data to the database was changed. When the Monitoring plugin is constructing a MAM response, it uses data written to the database by itself, but also by the MUC persistence manager. The latter was unaffected by OF-1200 (which likely was an oversight at the the time).

Monitoring Service plugin Search Archive by Participants helper text confusing

...Migrated from Ignite Jira OF-1032...

As per screenshot, helper text for the Participant(s) search field suggests a user can 'Browse' to select a user. It's not clear how this is possible in the Admin Console.

Also, to return results matching a user, the input must be that of the users JID, not their Full Name, which is returned in results. I found this a bit confusing too; wondered if the helper text could be more clear on this?

Feel free to downgrade to Trivial if appropriate, just wanted to highlight these observations from a test session.

participants

java.sql.BatchUpdateException: Invalid column name ‘messageID’

Hi Experts,

I found an unexpected error message in our embedded Openfire, after upgrading to 4.3.1.
The error is about the ConversationManager in the monitoring plugin 1.7.0.
[2019.03.06 10:34:33 org.jivesoftware.openfire.archive.ConversationManager - Unable to archive message data!

java.sql.BatchUpdateException: Invalid column name ‘messageID’.

at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:1069) ~[jtds-1.3.1.jar:1.3.1]

]

Root cause:
The two columns (messageID, sentDate) are there when creating the table ofMessageArchive, but are not there when upgrading it.

Solution:
In src\database\upgrade\4*.sql, alter table to add these two columns.
For example, in SQL Server add the below statement as the first line,
ALTER TABLE ofMessageArchive ADD
messageID BIGINT,
stanza NVARCHAR(MAX);

Thanks,

Message not retrieving after update to 1.8.0 or 1.8.1 from 1.7.0

Hello Team,

I am using OpenFire with version 4.4.4. And recently I update monitoring plugin to 1.8.1 from 1.7.0. but I found some issues after this, I tried with 1.8.0 but still have same issue.

I am unable to retrieve the archived messages, everything was working fine on 1.7.0 version and I was using following code to get list and collection of archived messages:

Getting List by this:
<iq from="fromJID" id="89c356e4-5f34-408c-9254-55b536b2028b:sendIQ" to="toJID" type="get" xmlns="jabber:client"><list xmlns="urn:xmpp:archive"/></iq>
And after I was getting collection by this:
<iq from="fromJID" id="c928e47d-c72f-43a7-814c-acdff7bf3a41:sendIQ" to="toJID" type="get" xmlns="jabber:client"><retrieve start="2020-01-06T05:54:29.187Z" with="fromJID" xmlns="urn:xmpp:archive"/></iq>
In earlier version of monitoring plugin(1.7.0) we were getting chat message data, but in new version we are getting empty children for chat.

can anyone help on it please..

Specific messages do not show up in retrieved message history

I've observed that with the plugin v1.8.0, specific messages that I know were added to a MUC room didn't show up in the message history as retrieved through MAM2. These messages didn't show up in both Converse (4.2.0) and Conversations.

One of the messages that was missing, was this one:

Something like this: Spark.exe username=bart&password=test&domain=push04.goodbytes.im

(That domain nor that account exists any longer, so there's no point in trying to abuse those credentials :-) )

I'm guessing that the monitoring plugin tries to parse the &password text as some kind of entity reference, as I've noticed that the following was logged to the log of Openfire. Openfire should either escape text like that, or not parse entities.

org.dom4j.DocumentException: Error on line 3 of document  : The reference to entity "password" must end with the ';' delimiter.
        at org.dom4j.io.SAXReader.read(SAXReader.java:462) ~[dom4j-2.1.1.jar:?]
        at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:286) ~[dom4j-2.1.1.jar:?]
        at com.reucon.openfire.plugin.archive.xep0313.IQQueryHandler.sendMessageResult(IQQueryHandler.java:376) ~[?:?]
        at com.reucon.openfire.plugin.archive.xep0313.IQQueryHandler.lambda$handleIQ$0(IQQueryHandler.java:207) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
Caused by: org.xml.sax.SAXParseException: The reference to entity "password" must end with the ';' delimiter.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(XMLDocumentFragmentScannerImpl.java:1850) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3061) ~[?:1.8.0
_201]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) ~[?:1.8.0_201]
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) ~[?:1.8.0_201]
        at org.dom4j.io.SAXReader.read(SAXReader.java:445) ~[dom4j-2.1.1.jar:?]
        ... 8 more

1.4.4 failure with XEP-136 and MSQL Database

...Migrated from Ignite Jira OF-1078...

Ignite Forum Post

Thank you. Unfortunately, 1.4.4 has the same issue I've been dealing with. XEP 136 does not work when using Microsoft SQL Server as the external database. It looks like the plugin has had issues with MS SQL Server in the past (issue OF-755 resolved by Daryl Herzmann). Can anyone add this to JIRA?

Here's the error log (using Openfire 4.0.1 and Monitoring Service 1.4.4):

``` 2016.02.01 10:31:29 org.jivesoftware.util.Log - Error selecting conversations java.sql.SQLException: An expression of non-boolean type specified in a context where a condition is expected, near 'RowNum'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatem ent.java:1029) at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at $java.lang.AutoCloseable$$EnhancerByProxool$$416dbe86.executeQuery() at com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager.findConversation s(JdbcPersistenceManager.java:234) at com.reucon.openfire.plugin.archive.xep0136.IQListHandler.list(IQListHandler.jav a:49) at com.reucon.openfire.plugin.archive.xep0136.IQListHandler.handleIQ(IQListHandler .java:34) at com.reucon.openfire.plugin.archive.xep0136.Xep0136Support$1.handleIQ(Xep0136Sup port.java:48) at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:66) at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:372) at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:115) at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:78) at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:342) at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler .java:99) at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:307) at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:199) at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:181) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceive d(DefaultIoFilterChain.java:690) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(D efaultIoFilterChain.java:417) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilt erChain.java:47) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceiv ed(DefaultIoFilterChain.java:765) at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapte r.java:109) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(D efaultIoFilterChain.java:417) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilt erChain.java:47) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceiv ed(DefaultIoFilterChain.java:765) at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flus h(ProtocolCodecFilter.java:407) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:236) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(D efaultIoFilterChain.java:417) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilt erChain.java:47) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceiv ed(DefaultIoFilterChain.java:765) at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74) at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63) at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(Ordere dThreadPoolExecutor.java:769) at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(Order edThreadPoolExecutor.java:761) at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThr eadPoolExecutor.java:703) at java.lang.Thread.run(Unknown Source) ```

MAM trouble on clients with version 1.7

When connect to openfire with monitoring plugin enabled i receive messages, but gajim fail on parsing
last packages with
And there is mam:1 instead mam:2, and therefor swift im does not fetch messages from MAM service

xml console output provided as file
log.txt

Fix addressing when original request has no 'to' attribute.

User reports that Gajim client can't retrieve new history messages from the archive since 4.3.0 update. As reported it was the same with 4.3.0 and 1.6.2 version of plugin. And it was working ok with 4.2.3.

1.7.0 update of the plugin fixed issues in Conversations and this client can retrieve new messages, but Gajim can't.

Java11 ClassNotFoundException when deploying

Hello,
When I try to use monitoring-plugin with Java11, I have the following stacktrace (at deployment):

SEVERE: Implementation of JAXB-API has not been found on module path or classpath.
javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
 - with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:177)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:364)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:508)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:465)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:366)
        at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:107)
        at com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:100)
        at com.sun.jersey.server.impl.application.RootResourceUriRules.initWadl(RootResourceUriRules.java:169)
        at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:106)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1359)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180)
        at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799)
        at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795)
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790)
        at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509)
        at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339)
        at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
        at javax.servlet.GenericServlet.init(GenericServlet.java:244)
        at org.jivesoftware.openfire.plugin.JerseyWrapper.init(JerseyWrapper.java:54)
        at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:180)
        at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:629)
        at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:374)
        at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:362)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at javax.xml.bind.ServiceLoaderUtil.nullSafeLoadClass(ServiceLoaderUtil.java:122)
        at javax.xml.bind.ServiceLoaderUtil.safeLoadClass(ServiceLoaderUtil.java:155)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:174)
        ... 31 more

Successfully loaded plugin 'monitoring'.

Following this SO thread, I updated the pom.xml of the plugin and generated a new jar. It's working on my local and prevent this stacktrace.
I tried to run the new JAR with both java8 and java11 and I had no error.
Do you want to create a JIRA issue before I submit my MR ?

Monitoring / Archive plugin fails to reconstruct archived stanza

...Migrated from Ignite Jira OF-1498...

When an archived message does not contain a stanza, but does contain body data, the monitoring plugin attempts to reconstruct the stanza. A string formatter is used here, but uses invalid parameters. This results in a stanza that contains placeholders, rather than actual data.

@guusdk wrote

Fixed in monitoring plugin version 1.6.0.

another user responded with

The bug is still present in case of cluster configuration.

When a junior member submits a message to the senior member, as event of type "chatMessageReceived", the ConversationEvent run method passes an empty string to the conversationManager.processMessage method.

 public void run(ConversationManager conversationManager) {
        if (Type.chatMessageReceived == type) {
            conversationManager.processMessage(sender, receiver, body, "", date);
        }
        else if (Type.roomDestroyed == type) {
            conversationManager.roomConversationEnded(roomJID, date);
        }
        else if (Type.occupantJoined == type) {
            conversationManager.joinedGroupConversation(roomJID, user, nickname, date);
        }
        else if (Type.occupantLeft == type) {
            conversationManager.leftGroupConversation(roomJID, user, date);
            // If there are no more occupants then consider the group conversarion over
            MUCRoom mucRoom = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(roomJID).getChatRoom(roomJID.getNode());
            if (mucRoom != null &&  mucRoom.getOccupantsCount() == 0) {
                conversationManager.roomConversationEnded(roomJID, date);
            }
        }
        else if (Type.nicknameChanged == type) {
            conversationManager.leftGroupConversation(roomJID, user, date);
            conversationManager.joinedGroupConversation(roomJID, user, nickname, new Date(date.getTime() + 1));
        }
        else if (Type.roomMessageReceived == type) {
            conversationManager.processRoomMessage(roomJID, user, nickname, body, stanza, date);
        }
    }

another user responded with

Regarding Momone's comment about the bug in a cluster, I found this code in ArchiveInterceptor.java: if the message comes from a senior member it gets processed and stored correctly, but if it is a junior member it gets sent to a queue with no stanza and hence is not saved correctly.

Maybe this is the cause?

```java
// Process this event in the senior cluster member or local JVM when not in a cluster
if (ClusterManager.isSeniorClusterMember()) {
	conversationManager.processMessage(message.getFrom(), message.getTo(), message.getBody(), message.toXML(), new Date());
}
else {
	JID sender = message.getFrom();
	JID receiver = message.getTo();
	ConversationEventsQueue eventsQueue = conversationManager.getConversationEventsQueue();
	eventsQueue.addChatEvent(conversationManager.getConversationKey(sender, receiver),
			ConversationEvent.chatMessageReceived(sender, receiver,
					conversationManager.isMessageArchivingEnabled() ? message.getBody() : null,
					new Date()));
}

Monitoring Service plugin FileNotFound thrown when Searching Archive by Keywords

...Migrated from Ignite Jira OF-1031...

When testing Openfire 4.0.0 with the latest Monitoring Service 1.5.0 plugin, noticed that searching the archive by keywords doesn't return results (in the admin console) and throws a FileNotFound exception in the error logs.

Replication Steps:

As per screenshot, attempt to Search Archive by Keywords.
Observe Openfire error logs after clicking Search.

Stack Trace:

2016.01.06 19:37:51 ERROR [Jetty-QTP-AdminConsole-1087]: org.jivesoftware.openfire.archive.ArchiveSearch - no segments* file found in org.apache.lucene.store.SimpleFSDirectory@/usr/share/openfire/monitoring/search lockFactory=org.apache.lucene.store.SimpleFSLockFactory@711a45d2: files: indexprops.xml
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.SimpleFSDirectory@/usr/share/openfire/monitoring/search lockFactory=org.apache.lucene.store.SimpleFSLockFactory@711a45d2: files: indexprops.xml
	at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:634)
	at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:73)
	at org.apache.lucene.index.IndexReader.open(IndexReader.java:476)
	at org.apache.lucene.index.IndexReader.open(IndexReader.java:300)
	at org.apache.lucene.search.IndexSearcher.<init>(IndexSearcher.java:87)
	at org.jivesoftware.openfire.archive.ArchiveIndexer.getSearcher(ArchiveIndexer.java:581)
	at org.jivesoftware.openfire.archive.ArchiveSearcher.luceneSearch(ArchiveSearcher.java:119)
	at org.jivesoftware.openfire.archive.ArchiveSearcher.search(ArchiveSearcher.java:104)
	at org.jivesoftware.openfire.plugin.monitoring.archive_002dsearch_jsp._jspService(archive_002dsearch_jsp.java:239)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.jivesoftware.openfire.container.PluginServlet.handleJSP(PluginServlet.java:296)
	at org.jivesoftware.openfire.container.PluginServlet.service(PluginServlet.java:107)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
	at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:80)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:162)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:76)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:53)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:80)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:162)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:497)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)

@akrherz wrote

Attempting to reproduce and see this error, which may be related / same problem?

2016.12.19 10:39:55 ERROR [Jetty-QTP-AdminConsole-106]: org.jivesoftware.openfire.archive.ArchiveSearch - /home/akrherz/projects/igniterealtime/Openfire/target/openfire/monitoring/search/segments (No such file or directory)
java.io.FileNotFoundException: /home/akrherz/projects/igniterealtime/Openfire/target/openfire/monitoring/search/segments (No such file or directory)
	at java.io.RandomAccessFile.open0(Native Method)
	at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
	at org.apache.lucene.store.FSIndexInput$Descriptor.<init>(FSDirectory.java:430)
	at org.apache.lucene.store.FSIndexInput.<init>(FSDirectory.java:439)
	at org.apache.lucene.store.FSDirectory.openInput(FSDirectory.java:329)
	at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:45)
	at org.apache.lucene.index.IndexReader$1.doBody(IndexReader.java:146)
	at org.apache.lucene.store.Lock$With.run(Lock.java:99)
	at org.apache.lucene.index.IndexReader.open(IndexReader.java:141)
	at org.apache.lucene.index.IndexReader.open(IndexReader.java:136)
	at org.apache.lucene.search.IndexSearcher.<init>(IndexSearcher.java:47)
	at org.jivesoftware.openfire.archive.ArchiveIndexer.getSearcher(ArchiveIndexer.java:581)
	at org.jivesoftware.openfire.archive.ArchiveSearcher.luceneSearch(ArchiveSearcher.java:119)
	at org.jivesoftware.openfire.archive.ArchiveSearcher.search(ArchiveSearcher.java:104)
	at org.jivesoftware.openfire.plugin.monitoring.archive_002dsearch_jsp._jspService(archive_002dsearch_jsp.java:239)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.jivesoftware.openfire.container.PluginServlet.handleJSP(PluginServlet.java:388)
	at org.jivesoftware.openfire.container.PluginServlet.service(PluginServlet.java:103)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
	at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:226)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:165)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:76)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:53)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:226)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:165)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:499)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)

of4 0 0-mon1 5 0-kw

Sub-optimal performance

...Migrated from Ignite Jira OF-1622...

Reported in the Forums

Monitoring plugin have a very strange code, that inserts messages into database.

It select count of all messages from database with query: SELECT COUNT FROM ofMessageArchive

Next, this number increased by 1, and inserted into database as “messageID” field.

This code generates heavy load on database with huge number of archived messages and online users.

For example - for me, query executes 3-4 seconds (SSD, MSSQL, 75 millions messages stored).

Database can have autoincrement field, that works much faster.

Though I don't know how easy it would be to retrofit an auto-increment field to all supported databases. It may be more practical to use a JiveID, for example.

The column ‘startDate’ was specified multiple times for 'ofConversation'

Hi Experts,

I have found unexpected error messages in our embedded Openfire, after upgrading it to 4.3.1.
The exception is about JdbcPersistenceManager in the monitoring plugin 1.7.0:
[
2019.03.11 09:58:32 com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager - Error selecting conversations

java.sql.SQLException: The column ‘startDate’ was specified multiple times for ‘ofConversation’.

at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) ~[jtds-1.3.1.jar:1.3.1]

at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988) ~[jtds-1.3.1.jar:1.3.1]

at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) ~[jtds-1.3.1.jar:1.3.1]

at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671) ~[jtds-1.3.1.jar:1.3.1]

at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505) ~[jtds-1.3.1.jar:1.3.1]

at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029) ~[jtds-1.3.1.jar:1.3.1]

at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122) ~[commons-dbcp2-2.5.0.jar:2.5.0]

at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122) ~[commons-dbcp2-2.5.0.jar:2.5.0]

at com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager.findConversations(JdbcPersistenceManager.java:319) [monitoring-1.7.0.jar!/:?]

]

Root cause:
In JdbcPersistenceManager, the constant SELECT_CONVERSATIONS contains two duplicate columns for “startDate”, one is “ofConversation.startDate” and the other one is “min(ofConParticipant.joinedDate) AS startDate”.

As a solution in our product, we removed the latter.

Thanks,

XSS in Monitoring Plugin's Archiving Settings page

... migrated from OF-1875

Archiving Settings in the Monitoring Service plugin (/plugins/monitoring/archiving-settings.jsp) is vulnerable to Stored XSS.

In the only text field, labelled "Only archive conversations of the following room names", entering a value of </textarea><script>... sees the script executed on the next visit to the page.

Separate parameters for discussion history / archives

User should be able to specify different parameters for room or discussion history / archives (how much day to keep the messages):

From a user point of view it would make sense to have 2 parameters. 1 for room and 1 for private chat.
For example for me chat room history as less importance than discussion with someone where some important information may be needed later.

Unable to resume rebuilding Lucene index

If a Lucene index build is requested, but not executed because message archiving is disabled, the current code does not allow the index to be done again after message archiving is enabled again.

Monitoring plugin is not using main language set in Admin Console

...Migrated from Ignite Jira OF-1564...

Ignite Forum Thread

Users report that Monitoring plugin is not using the main language set in Admin Console and instead looks into system's locale and tries to use an according language file. E.g. if a user has set English as his main Admin Console language, but has Russian as his region in OS, then Monitoring plugin shows Russian translation for menus. This is not consistent with how other plugins operate.

This is especially problematic for Russian users as Russian translation file is bad and shows garbled text, but one can't work around it by using English as a main language, as it still shows garbled Russian menus as Russian region is set in OS. (already fixed in 1.7.0).

When logging is disabled, queries should not go unanswered.

When logging is disabled, a request for log entries goes unexpectedly unanswered (an empty response, or an error, is expected).

The cause for this is a nullpointerexception, from referencing a 'null' collection of retrieved archived messages, instead of an empty one.

OMEMO encrypted messages are not stored by the monitoring plugin

OMEMO encrypted messages are not stored by the monitoring plugin, because those type of messages use <payload> instead of <body> tag. If a dummy body is set, the message is saved, but the client then will receive not the encrypted payload, but the dummy body.

Empty page and NPE logged when opening stats-dashboard.jsp

When trying to open the Statistics dashboard, an empty page is shown, and a NullPointerException is logged:

2019.12.02 15:08:38 ERROR [Jetty-QTP-AdminConsole-80]: org.jivesoftware.openfire.container.PluginServlet - null
java.lang.NullPointerException: null
        at org.jivesoftware.openfire.reporting.stats.RrdSqlBackend.read(RrdSqlBackend.java:151) ~[?:?]
        at org.jrobin.core.RrdBackend.readString(RrdBackend.java:258) ~[?:?]
        at org.jrobin.core.RrdPrimitive.readString(RrdPrimitive.java:107) ~[?:?]
        at org.jrobin.core.RrdString.get(RrdString.java:53) ~[?:?]
        at org.jrobin.core.Header.isJRobinHeader(Header.java:199) ~[?:?]
        at org.jrobin.core.Header.validateHeader(Header.java:203) ~[?:?]
        at org.jrobin.core.RrdDb.<init>(RrdDb.java:233) ~[?:?]
        at org.jrobin.core.RrdDb.<init>(RrdDb.java:203) ~[?:?]
        at org.jivesoftware.openfire.reporting.stats.StatsEngine$DefaultStatDefinition.fetchData(StatsEngine.java:495) ~[?:?]
        at org.jivesoftware.openfire.reporting.stats.StatsEngine$DefaultStatDefinition.getMin(StatsEngine.java:537) ~[?:?]
        at org.jivesoftware.openfire.reporting.stats.DefaultStatsViewer.getMin(DefaultStatsViewer.java:112) ~[?:?]
        at org.jivesoftware.openfire.reporting.stats.StatsAction.getLowAndHigh(StatsAction.java:171) ~[?:?]
        at org.jivesoftware.openfire.plugin.monitoring.stats_002ddashboard_jsp._jspService(stats_002ddashboard_jsp.java:248) ~[?:?]
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[apache-jsp-8.5.40.jar:8.5.40]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0]
        at org.jivesoftware.openfire.container.PluginServlet.handleJSP(PluginServlet.java:397) ~[xmppserver-4.5.0-SNAPSHOT.jar:4.5.0-SNAPSHOT]
        at org.jivesoftware.openfire.container.PluginServlet.service(PluginServlet.java:109) [xmppserver-4.5.0-SNAPSHOT.jar:4.5.0-SNAPSHOT]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:226) [xmppserver-4.5.0-SNAPSHOT.jar:4.5.0-SNAPSHOT]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:234) [xmppserver-4.5.0-SNAPSHOT.jar:4.5.0-SNAPSHOT]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129) [sitemesh-2.4.2.jar:?]
        at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77) [sitemesh-2.4.2.jar:?]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:73) [xmppserver-4.5.0-SNAPSHOT.jar:4.5.0-SNAPSHOT]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:49) [xmppserver-4.5.0-SNAPSHOT.jar:4.5.0-SNAPSHOT]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:226) [xmppserver-4.5.0-SNAPSHOT.jar:4.5.0-SNAPSHOT]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:234) [xmppserver-4.5.0-SNAPSHOT.jar:4.5.0-SNAPSHOT]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [jetty-security-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) [jetty-servlet-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.Server.handle(Server.java:505) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267) [jetty-server-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) [jetty-io-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [jetty-io-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:427) [jetty-io-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:321) [jetty-io-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:159) [jetty-io-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [jetty-io-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [jetty-io-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [jetty-util-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [jetty-util-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [jetty-util-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [jetty-util-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [jetty-util-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698) [jetty-util-9.4.18.v20190429.jar:9.4.18.v20190429]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804) [jetty-util-9.4.18.v20190429.jar:9.4.18.v20190429]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]

Empty history in monitoring

2019.07.16 11:38:36 com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager - Error selecting conversation
java.sql.SQLException: Column 'stanza' not found.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.12.jar:8.0.12]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.12.jar:8.0.12]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[mysql-connector-java-8.0.12.jar:8.0.12]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[mysql-connector-java-8.0.12.jar:8.0.12]
at com.mysql.cj.jdbc.result.ResultSetImpl.findColumn(ResultSetImpl.java:580) ~[mysql-connector-java-8.0.12.jar:8.0.12]
at com.mysql.cj.jdbc.result.ResultSetImpl.getString(ResultSetImpl.java:966) ~[mysql-connector-java-8.0.12.jar:8.0.12]
at org.apache.commons.dbcp2.DelegatingResultSet.getString(DelegatingResultSet.java:898) ~[commons-dbcp2-2.6.0.jar:2.6.0]
at org.apache.commons.dbcp2.DelegatingResultSet.getString(DelegatingResultSet.java:898) ~[commons-dbcp2-2.6.0.jar:2.6.0]
at com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager.extractMessage(JdbcPersistenceManager.java:976) ~[monitoring-1.8.0.jar!/:?]
at com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager.getConversation(JdbcPersistenceManager.java:876) [monitoring-1.8.0.jar!/:?]
at com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager.getConversation(JdbcPersistenceManager.java:791) [monitoring-1.8.0.jar!/:?]
at com.reucon.openfire.plugin.archive.xep0136.IQRetrieveHandler.retrieve(IQRetrieveHandler.java:107) [monitoring-1.8.0.jar!/:?]
at com.reucon.openfire.plugin.archive.xep0136.IQRetrieveHandler.handleIQ(IQRetrieveHandler.java:39) [monitoring-1.8.0.jar!/:?]
at com.reucon.openfire.plugin.archive.xep.AbstractXepSupport$1.handleIQ(AbstractXepSupport.java:43) [monitoring-1.8.0.jar!/:?]
at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:62) [xmppserver-4.4.0.jar:4.4.0]
at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:369) [xmppserver-4.4.0.jar:4.4.0]
at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:112) [xmppserver-4.4.0.jar:4.4.0]
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:74) [xmppserver-4.4.0.jar:4.4.0]
at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:360) [xmppserver-4.4.0.jar:4.4.0]
at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler.java:95) [xmppserver-4.4.0.jar:4.4.0]
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:314) [xmppserver-4.4.0.jar:4.4.0]
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:201) [xmppserver-4.4.0.jar:4.4.0]
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:183) [xmppserver-4.4.0.jar:4.4.0]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:1015) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:122) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:413) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:257) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:106) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:89) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:766) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:758) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:697) [mina-core-2.1.3.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]

MAM does not work for federated users

...Migrated from Ignite Jira OF-1546...

The MAM implementation ties things to the local client session, which obviously won't work for users that join a muc via s2s.

Either we should not advertise MAM to them, or we should make things work properly.

The monitoring plugin removes carriage returns (\n) in text body

When a message is formatted as a multi-line string with carriage return "\n" characters, it is saved correctly in the DB, but monitoring plugin removes the "\u000a" in the body of the archived message stanza created.

<message from="[email protected]/Dele Olajide" id="e0678c1b-fa3d-421b-a5b3-5b39d4a8b149" to="dele@desktop-545pc5b/pade-converse-v4.2.0-Chrome73Win10.64-26059867" type="groupchat">
  <body>Your heading goes here ======================</body>
  <active xmlns="http://jabber.org/protocol/chatstates"></active>
  <origin-id xmlns="urn:xmpp:sid:0" id="e0678c1b-fa3d-421b-a5b3-5b39d4a8b149"></origin-id>
  <stanza-id xmlns="urn:xmpp:sid:0" id="e0678c1b-fa3d-421b-a5b3-5b39d4a8b149" by="[email protected]"/>
</message>

This causes markdown text to be formatted incorrectly

MAM Result IQ has wrong from attr when requesting MUCs

...Migrated from Ignite Jira OF-1651

<!-- Outgoing 08.12.2018 00:08:22 -->
<iq xmlns="jabber:client" to="[email protected]" type="set" id="1a8cfada-d7b3-411f-814e-9c2a2eff01ea" from="[email protected]/gajim.G20T95J5">
<query xmlns="urn:xmpp:mam:2" queryid="ce9d95ce-0413-4a07-aa87-958e8a804a69">
<x xmlns="jabber:x:data" type="submit">
<field var="FORM_TYPE" type="hidden">
<value>urn:xmpp:mam:2</value>
</field>
<field var="start" type="text-single">
<value>2018-12-06T23:08:22Z</value>
</field>
</x>
<set xmlns="http://jabber.org/protocol/rsm">
<max>70</max>
</set>
</query>
</iq>
 
<!-- Incoming 08.12.2018 00:08:23 -->
<iq xmlns="jabber:client" type="result" id="1a8cfada-d7b3-411f-814e-9c2a2eff01ea" from="wikisuite.net" to="[email protected]/gajim.G20T95J5">
<fin xmlns="urn:xmpp:mam:2" queryid="ce9d95ce-0413-4a07-aa87-958e8a804a69" complete="true">
<set xmlns="http://jabber.org/protocol/rsm">
<count>0</count>
</set>
</fin>
</iq>

Testable with the testaccount of https://trunk.wikisuite.net/HomePage

Monitoring plugin stopped archiving messages

...Migrated from Ignite Jira OF-1144...

Ignite Forum Post

A few users report that after updating to Openfire 4.0.2 and monitoring service 1.5.1 it has stopped archiving messages. Can't confirm or deny as i don't use it.

Maybe

2016.08.31 12:29:24 ERROR [Jetty-QTP-AdminConsole-1327]: org.jivesoftware.openfire.archive.Conversation - ERROR: column "fromjidresource" does not exist Position: 17 org.postgresql.util.PSQLException: ERROR: column "fromjidresource" does not exist Position: 17 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2310) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2023) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:217) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:421) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:166) at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at $java.sql.Statement$$EnhancerByProxool$$290960da.executeQuery() at org.jivesoftware.openfire.archive.Conversation.getMessages(Conversation.java:308) at org.jivesoftware.openfire.archive.ConversationUtils.toConversationInfo(ConversationUtils.java:352) at org.jivesoftware.openfire.archive.ConversationUtils.getConversationInfo(ConversationUtils.java:107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:239) at uk.ltd.getahead.dwr.impl.DefaultExecProcessor.handle(DefaultExecProcessor.java:48) at uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:81) at uk.ltd.getahead.dwr.AbstractDWRServlet.doPost(AbstractDWRServlet.java:162) at org.jivesoftware.openfire.reporting.MonitoringDWR.doPost(MonitoringDWR.java:116) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.jivesoftware.openfire.container.PluginServlet.handleServlet(PluginServlet.java:318) at org.jivesoftware.openfire.container.PluginServlet.service(PluginServlet.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:80) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:162) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) at java.lang.Thread.run(Thread.java:745)

So I found that with my test install, database upgrade scripts 1, 2 and 3 had not been applied. But script 4 had been. Looking at the plugin loader now to see if it is skipping things.

attribute 'complete' is always set to true

Copied from https://discourse.igniterealtime.org/t/monitoring-archive-attribute-complete-is-always-set-to-true

A defect is that the attribute ‘complete’ always is set to “true”, although there are more messages found then returned and the number of messages has been limited by the maximum size of the result page.

<query xmlns='urn:xmpp:mam:2' >
	<x xmlns='jabber:x:data' type='submit'>
		<field var='FORM_TYPE' type='hidden'>
			<value>urn:xmpp:mam:2</value>
		</field>
		<field var='start'>
			<value>2019-09-29T11:11:40.928+00:00</value>
		</field>
		<field var='end'>
			<value>2019-11-29T11:11:40.929+00:00</value>
		</field>
	</x>
	<set xmlns='http://jabber.org/protocol/rsm'>
		<max>2</max>
	</set>
</query>

Return two messages and a ‘fin’ result:

<fin xmlns="urn:xmpp:mam:2" complete="true" stable="true">
  <set xmlns="http://jabber.org/protocol/rsm">
    <count>616</count>
    <first>309e4431-c95d-46e8-8e59-9d3bab4f694c</first>
   <last>d1576b86-30e1-4c44-a486-87ab3fc24b60</last>
  </set>
 </fin>

there are 616 messages which fit in the criteria, but only the first two are returned.

My assumption is that the following line is incorrect:

com.reucon.openfire.plugin.archive.impl.MucMamPersistenceManager.findMessages(Date, Date, String, String, XmppResultSet, boolean)

xmppResultSet.setComplete( msgs.size() <= maxResults );

should be

xmppResultSet.setComplete( totalCount <= maxResults );

Monitoring Service plugin should export unicode characters in PDF

...Migrated from Ignite Jira OF-404...

you must change souce and build plugin to get russian pdf.
on my freebsd it is:
/usr/ports/net-im/openfire/work/openfire_src/src/plugins/monitoring/src/java/org /jivesoftware/openfire/archive/ConversationUtils.java

  1. add two imports:
    import com.lowagie.text.pdf.BaseFont;
    import java.io.IOException;

  2. add throws to definition of methods:
    public ByteArrayOutputStream getConversationPDF(Conversation conversation) throws DocumentException, IOException {
    private ByteArrayOutputStream buildPDFContent(Conversation conversation,Map<String, Font> colorMap) throws DocumentException, IOException {

  3. change font definitions in both those methods

add this line as first to both methods:
BaseFont bf = BaseFont.createFont("/path/to/unicode-font.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

and replace all "FontFactory.getFont(FontFactory.HELVETICA" to "new Font(bf" (10 entries)

  1. just build plugins:
    #cd /usr/ports/net-im/openfire/work/openfire_src/build
    #ant plugins

if build is successfull, you can delete original plugin in admin console and upload your plugin from
/usr/ports/net-im/openfire/work/openfire_src/work/plugins

based on:
http://blog.eveel.ru/2008/04/pdf-itext.html (russian)
http://www.mail-archive.com/[email protected]/msg07137.html

Monitoring plugin 1.3.0 is not updating IDs of older archived messages

...Migrated from Ignite Jira OF-611...

Ignite Forum Thread

After looking over things a bit further, it seems the new plugin uses a diffrent Id in the table ofID to store the last used conversationID. The old plugin used ID 50, the new plugin uses Id 600. This pretty much means that anyone upgrading the plugin from 1.2.0 to 1.3.0 will break their archiving if they have messages previously archived by the old plugin. All you need to do is get the value of the old conversationId marker like so:

select id from ofID where idType=50;

and then insert that into the new Id Type like so:

update ofID set id=6205 where idType=600;

This worked for my installation, you should verify that the numbers match up for yours. the DB upgrade script should do this for you, but does not.

MUC messages retrieval performance

When retrieving archived messages from a chatroom, the plugin should not retrieve all archived messages for that room from the database, if the request didn't ask for all messages.

Poor performance when adding messages to the database on large databases.

The plugin uses the result of org.jivesoftware.openfire.archive.ConversationManager.getArchivedMessageCount() to determine the next ID for a new row. This methods implementation is based on this database query: SELECT COUNT(*) FROM ofMessageArchive.

On Ignite (which has a very large table), this query takes 71 seconds.

"archive-service-worker-4" #56 prio=5 running in native
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
	- locked java.lang.Object@50ec9fa3
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:933)
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
	- locked sun.security.ssl.AppInputStream@7532abe8
	at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:140)
	at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:109)
	at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:67)
	at org.postgresql.core.PGStream.receiveChar(PGStream.java:306)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1952)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
	- locked org.postgresql.core.v3.QueryExecutorImpl@66451861
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)
	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106)
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
	at org.jivesoftware.database.ProfiledConnection$TimedPreparedStatement.executeQuery(ProfiledConnection.java:780)
	at org.jivesoftware.openfire.archive.ConversationManager.getArchivedMessageCount(ConversationManager.java:594)
	at org.jivesoftware.openfire.archive.ConversationManager$MessageArchivingRunnable.store(ConversationManager.java:1165)
	at org.jivesoftware.openfire.archive.Archiver.run(Archiver.java:141)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Poor performance when updating the Archive index

On Ignite (that has a very large message archive database), this query takes more than 60 seconds:
SELECT DISTINCT conversationID FROM ofMessageArchive WHERE sentDate > ?

Currently, this query seems to be used only when updating the search index (org.jivesoftware.openfire.archive.ArchiveIndexer#updateIndex).

MAM implementation should include urn:xmpp:mam:2

...Migrated from Ignite Jira OF-1576...

https://xmpp.org/extensions/xep-0313.html#support defines:

If a server or other entity hosts archives and supports MAM queries, it MUST advertise the 'urn:xmpp:mam:2' feature in response to Service Discovery (XEP-0030) [15 requests made to archiving JIDs (i.e. JIDs hosting an archive, such as users' bare JIDs)

The monitoring plugin should add the MAM feature to the response of such requests made against user JIDs.

@deleolajide wrote

Add support for urn:xmpp:mam:2.
Only urn:xmpp:mam:0 and urn:xmpp:mam:1 namespaces are actually currently supported. The requirement for :2 support is that openfire guarantees that all live messages are tagged with a stanza ID. This is already been implemented in Openfire for Message Carbons.
We only need to bump the namespace.

@guusdk wrote

And add support for https://xmpp.org/extensions/xep-0359.html

no support for filter on text or 'with' criteria when using mam:2

Copied from https://discourse.igniterealtime.org/t/monitoring-no-support-for-filter-on-text-or-with-criteria-when-using-mam-2

It seems that Openfire 4.4.4 in combination with monitoring plugin 1.8.1 does not have support for searching in MUC history using ‘search’ or ‘with’ criteria. These two are ignored and all messages are returned.

a query :

<query xmlns='urn:xmpp:mam:2' queryid='ed117397-bf94-41f4-a21d-1f2b0fa205f6'>
	<x xmlns='jabber:x:data' type='submit'>
		<field var='FORM_TYPE' type='hidden'>
			<value>urn:xmpp:mam:2</value>
		</field>
		<field var='start'>
			<value>2019-09-29T11:11:40.928+00:00</value>
		</field>
		<field var='with'>
			<value>[email protected]</value>
		</field>
		<field var='end'>
			<value>2019-11-29T11:11:40.929+00:00</value>
		</field>
		<field var='search'>
			<value>unkown TEXT</value>
		</field>
	</x>
</query>

returns the same set of results as a query:

<query xmlns='urn:xmpp:mam:2' queryid='ed117397-bf94-41f4-a21d-1f2b0fa205f6'>
	<x xmlns='jabber:x:data' type='submit'>
		<field var='FORM_TYPE' type='hidden'>
			<value>urn:xmpp:mam:2</value>
		</field>
		<field var='start'>
			<value>2019-09-29T11:11:40.928+00:00</value>
		</field>
		<field var='end'>
			<value>2019-11-29T11:11:40.929+00:00</value>
		</field>
	</x>
</query>

Monitoring plugin not showing actual messages in search

...Migrated from Ignite Jira OF-1655...

When you do a search for a keyword it shows conversations list, but when you press on one of them it doesn't show actual conversations on the right side. It says "Select a conversation to the left to view details." Rebuilding index doesn't help.

Issue started with 4.3.0 update.

Update pt_BR translation

...Migrated from Ignite Jira OF-672...

The properties below have been added to monitoring_i18n.properties.

Can someone post translations for CS, ES, FR, PT, ZH locales please:
archive.settings.max.age = Max Message Age
archive.settings.max.age.description = The maximum number of days to keep messages before purging them from the database.
archive.settings.max.age.warning = NOTE: Setting this value above 0 will PERMANENTLY DELETE any messages older than the specified number of days.
archive.settings.max.retrievable = Retrievable Messages
archive.settings.max.retrievable.description = The number of days worth of messages a user is allowed to retrieve.

Some private chat history is better than none.

Private chat history via MAM is not working. My investigation found that the following code is failing. It returns feature not implemented to XMPP client (conversejs)

        this.iqDispatcher = new AbstractIQHandler(iqDispatcherName, null, iqDispatcherNamespace) {
            public IQ handleIQ(IQ packet) throws UnauthorizedException {
                if (!MonitoringPlugin.getInstance().isEnabled()) {
                    return error(packet,
                            PacketError.Condition.feature_not_implemented);
                }

                final IQHandler iqHandler = element2Handlers.get(packet
                        .getChildElement().getName());
                if (iqHandler != null) {
                    return iqHandler.handleIQ(packet);
                } else {
                    return error(packet,
                            PacketError.Condition.feature_not_implemented);
                }
            }
        };

I found that I can replace this with the following hack to get at least MAM:2 private chat

        this.iqDispatcher = new IQQueryHandler2();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.