When creating a room, users are allowed to add “/” forward slash sign. Although there is a clear java exception error, the entry still makes it to the database. This impacts the following:
When users try to edit the room settings they are faced with an error, and they are not able to make any changes
Chat clients are not able to view any of the rooms
The fix currently is to go to the dbo.MUCRoom and edit the room details and restart the openfire service.
To avoid this issue, logic should be added to validate the entry and throw an exception when user attempts to create the room, prior to processing the entry further.
Hi! Thanks for reporting this! Something smells fishy, but I can’t immediately explain what’s causing this. To figure out how that row got there, could you share:
The exact steps you take to create the room. Is it in the admin console (Group Chat → Create New Room) or in a chat client, and if so, which client and version?
Which field you put the / in: Room ID or Room Name?
The full Java exception / stack trace you see. The openfire.log from around that time would be ideal.
The values of the name and naturalName columns for the affected row in ofMucRoom.
Which plugins you have installed, for example the REST API plugin, Pàdé/Meetings or Fastpath, or any custom integration that creates rooms.
With that we should be able to pin down where it comes from.
A bit more information this morning. The / alone works just fine (the exception is caught and user is notified). A unique scenario is when users are using something Room.Test/Crash. Not sure why adding the “.” “dot” allows the entry to be processed.
We are using the Web Gui to create rooms (Group Chat, Room Administration, Create New Room). Users tend to use same info in all three locations.
java.lang.NullPointerException: Cannot invoke "org.jivesoftware.openfire.muc.MultiUserChatService.getChatRoom(String)" because the return value of "org.jivesoftware.openfire.muc.MultiUserChatManager.getMultiUserChatService(org.xmpp.packet.JID)" is null
at org.jivesoftware.openfire.admin.muc_002droom_002dedit_002dform_jsp._jspService(muc_002droom_002dedit_002dform_jsp.java:306)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
at org.eclipse.jetty.ee8.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1164)
at org.eclipse.jetty.ee8.servlet.ServletHolder.handle(ServletHolder.java:653)
at org.eclipse.jetty.ee8.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1377)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:182)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:85)
at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1351)
at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:73)
at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1351)
at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:38)
at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1351)
at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:170)
at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1351)
at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:290)
at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1351)
at org.jivesoftware.admin.CacheControlFilter.doFilter(CacheControlFilter.java:87)
at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:177)
at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1351)
at org.jivesoftware.admin.ContentSecurityPolicyFilter.doFilter(ContentSecurityPolicyFilter.java:53)
at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1351)
at org.eclipse.jetty.ee8.servlet.ServletHandler.doHandle(ServletHandler.java:454)
at org.eclipse.jetty.ee8.nested.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.ee8.security.SecurityHandler.handle(SecurityHandler.java:497)
at org.eclipse.jetty.ee8.nested.HandlerWrapper.handle(HandlerWrapper.java:108)
at org.eclipse.jetty.ee8.nested.ScopedHandler.nextHandle(ScopedHandler.java:183)
at org.eclipse.jetty.ee8.nested.SessionHandler.doHandle(SessionHandler.java:519)
at org.eclipse.jetty.ee8.nested.ScopedHandler.nextHandle(ScopedHandler.java:181)
at org.eclipse.jetty.ee8.nested.ContextHandler.doHandle(ContextHandler.java:891)
at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:152)
at org.eclipse.jetty.ee8.servlet.ServletHandler.doScope(ServletHandler.java:423)
at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:150)
at org.eclipse.jetty.ee8.nested.SessionHandler.doScope(SessionHandler.java:503)
at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:150)
at org.eclipse.jetty.ee8.nested.ContextHandler.doScope(ContextHandler.java:830)
at org.eclipse.jetty.ee8.nested.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.ee8.nested.ContextHandler.handle(ContextHandler.java:1451)
at org.eclipse.jetty.ee8.nested.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1294)
at org.eclipse.jetty.ee8.nested.HttpChannel.dispatch(HttpChannel.java:620)
at org.eclipse.jetty.ee8.nested.HttpChannel.handle(HttpChannel.java:460)
at org.eclipse.jetty.ee8.nested.ContextHandler$CoreContextHandler$CoreToNestedHandler.handle(ContextHandler.java:2523)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1102)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:151)
at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
at org.eclipse.jetty.server.Server.handle(Server.java:182)
at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:762)
at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:414)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:323)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ssl.SslConnection$SslEndPoint.onFillable(SslConnection.java:612)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:413)
at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:155)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:492)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.epcRunTask(AdaptiveExecutionStrategy.java:428)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:401)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:255)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:204)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:981)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1212)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1166)
at java.base/java.lang.Thread.run(Unknown Source
Thanks, that tip about the dot was instrumental in finding the cause! Pulling on that thread opened quite a can of worms, though. The cause turned out to be a bug in a third-party library that Openfire uses to check room names. A slash on its own is processed correctly, but in some combinations (such as with a dot in the name) it slips through.
One thing led to another, and that library has now received almost 40 changes. Somewhere along the way I accidentally volunteered as its new maintainer. We’re now working on getting the fix into Openfire. We are tracking this work in https://igniterealtime.atlassian.net/browse/OF-3401
Until then, ask your users to keep the Room ID simple: letters, digits, dots and hyphens, without a slash. They can put the friendly title, slashes and all, in the Room Name field, which has no such
restrictions.
Your fix of editing the room in the database and restarting is the right one for rooms that already exist. Just make a backup first.
Thanks for reporting this, and for keeping me busy this weekend!
The forward slash may be getting interpreted as a special character in the room name or JID. Try creating the room with a simple name without slashes first to see if it works. If you need the slash as part of the name, check whether Openfire supports escaping or encoding it in that field, since not every character is valid in a room identifier.