powered by Jive Software

PEP Handler: IQ must be of type 'set' or 'get'

We’ve seen this error in the log (Openfire 4.5.2). Any ideas?

2021.05.17 17:18:08 org.jivesoftware.openfire.handler.IQHandler - Interner Serverfehler
java.lang.IllegalArgumentException: IQ must be of type 'set' or 'get'. Original IQ: <iq type="error" id="150-140399" from="romeo" to="juliet"><pubsub xmlns="http://jabber.org/protocol/pubsub"><subscribe jid="juliet"/><options><x xmlns="jabber:x:data"><field var="FORM_TYPE" type="hidden"><value>http://jabber.org/protocol/pubsub#subscribe_options</value></field><field var="pubsub#subscription_type"><value>items</value></field><field var="pubsub#subscription_depth"><value>all</value></field></x></options></pubsub><error code="401" type="auth"><not-authorized xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><presence-subscription-required xmlns="http://jabber.org/protocol/pubsub#errors"/></error></iq>
        at org.xmpp.packet.IQ.createResultIQ(IQ.java:378) ~[tinder-2.0.0.jar:?]
        at org.jivesoftware.openfire.pep.IQPEPHandler.handleIQ(IQPEPHandler.java:303) ~[xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:62) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:369) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:112) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:74) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.pubsub.PubSubEngine.sendErrorPacket(PubSubEngine.java:1852) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.pubsub.PubSubEngine.subscribeNode(PubSubEngine.java:668) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.pubsub.PubSubEngine.process(PubSubEngine.java:101) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.pep.PEPServiceManager.process(PEPServiceManager.java:230) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.pep.IQPEPHandler.createSubscriptionToPEPService(IQPEPHandler.java:491) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.pep.IQPEPHandler.subscribedToPresence(IQPEPHandler.java:554) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.user.PresenceEventDispatcher.subscribedToPresence(PresenceEventDispatcher.java:143) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.handler.PresenceSubscribeHandler.process(PresenceSubscribeHandler.java:217) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.PresenceRouter.handle(PresenceRouter.java:175) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.PresenceRouter.route(PresenceRouter.java:79) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:84) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.net.StanzaHandler.processPresence(StanzaHandler.java:384) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.net.ClientStanzaHandler.processPresence(ClientStanzaHandler.java:102) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:285) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:203) [xmppserver-4.5.2.jar:4.5.2]
        at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:183) [xmppserver-4.5.2.jar:4.5.2]
        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:834) [?:?]

Doesn’t ring a bell. What’s going on here?

There’s a new presence subscription being established, which causes Openfire to try and establish a PEP-based subscription. It does so by generating an IQ request on behalf of the subscriber, which is routed to the owner of the PEP service (that seems dodgy).

Next, the server seems to be generating an error for some reason (PubSubEngine.sendErrorPacket(PubSubEngine.java:1852)) in response to subscription request. That code does invert the ‘to’ and ‘from’ attributes of the stanza, after which the response is being routed. That somehow gets picked up by the IQ-handler that seems try try and parse it as if it was a request made to the user that should’ve received the error?