Server: Openfire 5.0.4 (upgrad from 5.0.3)
JDK: temurin-jdk-21.0.10+7-ca-jdk21.0.10+7-win_x64
Platfrom: Windows Server 2025 x64 Intel
SQL: PostgreSQL v17.6 x64 Windows
Clients: Conversations, Gajim
My avatars aren’t working, and I’m having trouble changing a user’s role or deleting a user in MUC. Exceptions are frequently thrown when administering MUC.
There are many similar entries in the logs.
PubSub / PEP, MUC: NullPointerException and StackOverflowError in MUC when handling Entity Capabilities events due to corrupted PEP service data
Upon startup, Openfire detects that the PostgreSQL database already contains affiliation records (in the ofpubsubaffiliation table) for user PEP service nodes (e.g., user1@example.com), but the nodes themselves are not in the ofpubsubnode table. This results in SQL errors such as PSQLException: duplicate key value violates the uniqueness constraint “ofpubsubaffiliation_pk” when the server attempts to synchronize the cache with the database. Further processing of client capability change events (Entity Capabilities) triggers a recursive call to methods in MUC, resulting in a stack overflow.
Data Integrity Violation:
WARN ... - Affiliations found for a non-existent node:
ERROR ... - An exception occurred while creating an affiliation (org.jivesoftware.openfire.pubsub.NodeAffiliate@... - JID: user1@example.com - Affiliation: owner) to a node (UniqueIdentifier{serviceId='user1@example.com', nodeId='user1@example.com'}) in the database.
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint"ofpubsubaffiliation_pk"
NullPointerException when delivering last elements:
WARN ... - An exception occurred while dispatching entity capabilities changed event for entity 'user2@example.com/gajim.W78WPM8L' to listener '...PEPServiceManager...'.
java.lang.NullPointerException: Cannot invoke "org.jivesoftware.openfire.pubsub.CollectionNode.getSubscription(org.xmpp.packet.JID)" because "this.rootCollectionNode" is null
StackOverflowError in MUC that completely breaks the admin session (HTTP 500):
ERROR [Jetty-QTP-AdminConsole-...]: org.jivesoftware.openfire.container.PluginServlet - null
javax.servlet.ServletException: java.lang.StackOverflowError
...
Caused by: java.lang.StackOverflowError
at org.xmpp.packet.JID.toString(JID.java:706)
at org.jivesoftware.openfire.muc.MUCRoom.broadcastPresence(MUCRoom.java:1656)
at org.jivesoftware.openfire.muc.MUCRoom.send(MUCRoom.java:1612)
at org.jivesoftware.openfire.muc.MUCOccupant.send(MUCOccupant.java:445)
...
(the fragment is repeated dozens of times)
The server must correctly handle broken records in the PubSub database without entering a recursive loop. Admin console pages should not crash with a StackOverflowError.
What should I do? Could this be a SQL, JDK, or something else issue? It’s impossible for version 5 of our server to have such problems worldwide. Are these just my local issues? Please give me some information on what to do about this. I haven’t been able to figure anything out on my own. I really need your help!