Projects tigase _server server-core Issues #1296
NPE in AbstractPushNotifications.sendPushNotification (#1296)
Closed
wojciech.kapcia@tigase.net opened 3 years ago
java.lang.NullPointerException
	at tigase.xmpp.impl.push.AbstractPushNotifications.sendPushNotification(AbstractPushNotifications.java:315)
	at tigase.xmpp.impl.push.PushNotifications.processMessage(PushNotifications.java:123)
	at tigase.xmpp.impl.push.PushNotifications.process(PushNotifications.java:103)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2685)
	at tigase.util.processing.WorkerThread.run(WorkerThread.java:67)
wojciech.kapcia@tigase.net commented 3 years ago

Complete log entry

[2021-09-22 18:14:26:276] [SEVERE  ] [urn:xmpp:push:0-proc-0 ] WorkerThread.run()               : tigase.server.xmppsession.SessionManager$ProcessorWorkerThread,(urn:xmpp:push:0-proc-0) Exception during packet processing: Packet=from=c2s@ip-172-31-38-91.us-west-2.compute.internal/172.23.0.2_5223_172.31.40.134_40256, to=sess-man@ip-172-31-38-91.us-west-2.compute.internal, serverAuthorisedStanzaFrom=Optional[jonathanbacolod@tigase.im/movimt1RzSm], DATA=<message xmlns="jabber:client" from="jonathanbacolod@tigase.im/movimt1RzSm"><accept id="ojo03vvfk" xmlns="urn:xmpp:jingle-message:0"/></message>, SIZE=144, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=null, STABLE_ID=40aecb07-2365-459d-8e3d-3e4e9b19fb39, connection=XMPPResourceConnection=[user_jid=jonathanbacolod@tigase.im/movimt1RzSm, packets=318, connectioId=c2s@ip-172-31-38-91.us-west-2.compute.internal/172.23.0.2_5223_172.31.40.134_40256, domain=tigase.im, authState=AUTHORIZED, isAnon=false, isTmp=false, parentSession hash=1689502099, parentSession liveTime=1952227]
java.lang.NullPointerException
	at tigase.xmpp.impl.push.AbstractPushNotifications.sendPushNotification(AbstractPushNotifications.java:315)
	at tigase.xmpp.impl.push.PushNotifications.processMessage(PushNotifications.java:123)
	at tigase.xmpp.impl.push.PushNotifications.process(PushNotifications.java:103)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2685)
	at tigase.util.processing.WorkerThread.run(WorkerThread.java:67)
wojciech.kapcia@tigase.net commented 3 years ago

Possibly related, No 'to' Address: Message

If the stanza possesses no 'to' attribute, the server MUST handle it directly on behalf of the entity that sent it, where the meaning of "handle it directly" depends on whether the stanza is message, presence, or IQ. Because all stanzas received from other servers MUST possess a 'to' attribute, this rule applies only to stanzas received from a local entity (typically a client) that is connected to the server.

If the server receives a message stanza with no 'to' attribute, it MUST treat the message as if the 'to' address were the bare JID localpart@domainpart of the sending entity.

Andrzej Wójcik (Tigase) commented 3 years ago

The issue is in Tigase XMPP Server (not push) and we decided to stamp proper message packets with to attribute if it is missing.

Andrzej Wójcik (Tigase) commented 3 years ago

Fix was implemented as discussed. Method responsible for address sanitizing was moved to new bean and it now contains "to" attribute sanitization. Pull request for review created, see https://github.com/tigase/tigase-server/pull/115

wojciech.kapcia@tigase.net commented 3 years ago

I reviewed the changes and they were OK. However during the review I found out that my previous change to use connection manager to stamp correct from (#issue #1271) resulted in wrong behaviour (for presence-subscription related stanzas) thus I reworked the unit tests to make them more sane and fixed the issue with ServerAuthorisedStanzaFrom.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
tigase-server-8.2.0
Spent time
4h 30m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1296
Please wait...
Page is in error, reload to recover