NPE in MAM/Message Archiving (#54)
wojciech.kapcia@tigase.net opened 5 years ago

From monitor notification:

2019-07-19 03:50:05.686 [in_1-message-archive]  StanzaProcessor.processPacket()    SEVERE:   null when processing from=sess-man@ip-10-0-13-5.us-west-2.compute.internal, to=message-archive@ip-10-0-13-5.us-west-2.compute.internal, DATA=[iq id="sMp6Cn4tgMMBk1bN3dEADsb" type="set" xmlns="jabber:client"][query queryid="mam-5xIulP5DnYeV2lXdGQ7wr5A" xmlns="urn:xmpp:mam:1"][x type="submit" xmlns="jabber:x:data"][field var="FORM_TYPE" type="hidden"][value]urn:xmpp:mam:1[/value][/field][field var="start" type="text-single"][value]2019-07-19T10:36:36.620Z[/value][/field][/x][set xmlns="http://jabber.org/protocol/rsm"][before/][max]100[/max][/set][/query][/iq], SIZE=422, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=LOCAL, TYPE=set
java.lang.NullPointerException
	at tigase.archive.db.MessageArchiveRepositoryPool.queryItems(MessageArchiveRepositoryPool.java:87)
	at tigase.archive.db.MessageArchiveRepositoryPool.queryItems(MessageArchiveRepositoryPool.java:45)
	at tigase.xmpp.mam.modules.QueryModule.process(QueryModule.java:76)
	at tigase.component.modules.StanzaProcessor.process(StanzaProcessor.java:164)
	at tigase.component.modules.StanzaProcessor.processPacket(StanzaProcessor.java:85)
	at tigase.component.AbstractKernelBasedComponent.processPacket(AbstractKernelBasedComponent.java:81)
	at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1319)
Andrzej Wójcik (Tigase) commented 5 years ago

There is no from attribute in the <iq/> query, so that causes the NPE as when a packet is leaving SessionManager it should always have from set correctly. In this case,​ it is not.

Andrzej Wójcik (Tigase) commented 5 years ago

I've made a fix which will solve this issue. However, I'm still a little worried as SessionManager should take care of that!

wojciech.kapcia@tigase.net commented 5 years ago

@andrzej.wojcik I'm aware about the cause of the issue. And this is yet another "should have had from" issue. I'd say we should figure out why we are suddenly getting more packets like that and find the root cause - or is it the same as in #acspubsub-17?

Andrzej Wójcik (Tigase) commented 5 years ago

It is slightly different. In #acspubsub-17 the issue is missing packetFrom, while here stanzaFrom was missing. However, the cause of the issue may be the same.

wojciech.kapcia@tigase.net commented 5 years ago

I took a more in-depth look and I'd be in favour of fixing this on SM level - basically this should not happen. Your current fix ensures that to is set it seems.

Andrzej Wójcik (Tigase) commented 5 years ago

Added additional protection in the AbstractAuthPreprocessor in Tigase XMPP Server to filter out <iq/> packets from not authorized sessions which most likely caused this issue.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
tigase-server-8.2.0
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-message-archiving#54
Please wait...
Page is in error, reload to recover