Push Notifications fail to enable (#419)
Closed
Unknown opened 4 years ago

Describe the bug When trying to enable Push Notification on an XMPP server that supports XEP-0357 Push Notifications, Siskin reports "It was not possible to contact push notification component: undefined-condition"

To Reproduce Steps to reproduce the behavior:

  1. Go to an account in Siskin
  2. Toggle Enabled for Push Notifications
  3. Wait for the error message to appear after approx 60 seconds.

Expected behavior Expected behavior is for Push Notifications to be enabled and to work.

Smartphone (please complete the following information):

  • Device: iPhone 8
  • OS: iOS 13.4.1

Additional context Using Openfire 4.5.1.

Unknown commented 4 years ago

OpenFire has an issue with establishing server-to-server communication with Tigase XMPP Server running push component for Siskin IM. Right now we have prepared (but not deployed yet) a workaround for that issue.

I'm closing this issue as there is nothing wrong with Siskin IM or our installation.

Unknown commented 4 years ago

Same error here: iphone XR, IOS 13.5.1, ejabberd 20.07 "It was not possible to contact push notification component: undefined-condition"

Unknown commented 4 years ago

Could you check (and share) your server logs? Did it process the request correctly? Was it able to connect and send request to push.tigase.im (is the s2s working)?

Unknown commented 4 years ago
2020-08-22 19:24:38.021306+02:00 [info] <0.1561.0>@ejabberd_s2s_out:init/1:275 Outbound s2s connection started: jabbxi.de -> push.tigase.im
2020-08-22 19:24:41.120200+02:00 [info] <0.1561.0>@ejabberd_s2s_out:handle_auth_success/2:209 (tls|<0.1561.0>) Accepted outbound s2s EXTERNAL authentication jabbxi.de -> push.tigase.im (52.36.117.23)
2020-08-22 19:24:44.371572+02:00 [info] <0.336.0>@ejabberd_listener:accept/7:273 (<0.1562.0>) Accepted connection 54.218.245.82:46296 -> 192.168.0.210:5269
2020-08-22 19:24:46.024215+02:00 [info] <0.1562.0>@ejabberd_s2s_in:handle_auth_success/4:183 (tls|<0.1562.0>) Accepted inbound s2s EXTERNAL authentication push.tigase.im -> jabbxi.de (54.218.245.82)

From this I assume that s2s is working correctly with push.tigase.im, anyhting else I could check?

Unknown commented 4 years ago

Could you try enabling more detailed debug information and confirm that the registration packet is correctly send to push.tigase.im?

Unknown commented 4 years ago

Hello, i have the same error with an iPhone 8+ and XMPP server Metronome 3.14.1. Here it is debug log after "Push notifications" are activated from Siskin : https://gist.github.com/guigot/d11960c117fd62695d47a994ef2e29b7 (personal server, the url is replaced by "www.example.com")

Unknown commented 4 years ago

@guigot

I checked the logs and it seems that the s2s connection was established correctly:

Sep 30 10:29:06 s2sin5623dbc943d0	debug	connection push.tigase.im->www.example.com is now authenticated for push.tigase.im
Sep 30 10:29:06 s2sin5623dbc943d0	info	incoming s2s connection push.tigase.im->www.example.com complete

And you received response to enabled push from our server, but it caused an error in mod_push (?!):

Sep 30 10:29:06 s2sin5623dbc943d0	debug	Received[s2sin]: <iq id='56E699BA-46D9-4131-80A1-B23FF3D2B061' type='result' to='maryies@www.example.com/iPhoneMarie' from='push.tigase.im'>
Sep 30 10:29:06 mod_c2s	error	Traceback[c2s]: /usr/lib/metronome/modules/mod_push.lua:112: attempt to index local 'form' (a nil value): stack traceback:
	/usr/lib/metronome/modules/mod_c2s.lua:133: in function </usr/lib/metronome/modules/mod_c2s.lua:133>
	/usr/lib/metronome/modules/mod_push.lua:112: in function '?'
	/usr/lib/metronome/util/events.lua:67: in function </usr/lib/metronome/util/events.lua:63>
	(tail call): ?
	(tail call): ?
	/usr/lib/metronome/util/events.lua:67: in function 'fire_event'
	/usr/lib/metronome/modules/mod_router.lua:185: in function '?'
	/usr/lib/metronome/util/events.lua:67: in function 'fire_event'
	/usr/lib/metronome/modules/mod_router.lua:128: in function '?'
	/usr/lib/metronome/util/events.lua:67: in function </usr/lib/metronome/util/events.lua:63>
	(tail call): ?
	...
	/usr/lib/metronome/util/xmppstream.lua:201: in function 'feed'
	/usr/lib/metronome/modules/mod_c2s.lua:229: in function 'data'
	/usr/lib/metronome/modules/mod_c2s.lua:250: in function 'onincoming'
	/usr/lib/metronome/net/server_event.lua:575: in function </usr/lib/metronome/net/server_event.lua:527>
	[C]: in function 'loop'
	/usr/lib/metronome/net/server_event.lua:734: in function </usr/lib/metronome/net/server_event.lua:733>
	[C]: in function 'xpcall'
	/usr/bin/metronome:324: in function 'loop'
	/usr/bin/metronome:388: in main chunk
	[C]: ?

I'd recommend following up with this error in Metronome authors.

Unknown commented 4 years ago

The error has been solved with the help of Metronome authors. But push notifications still don't work. Here it is a log when the option is enabled (it becomes disabled on UI after a short time) : https://gist.github.com/guigot/ad315ae14b0a7d16dd66907dc9f3eb6f s2s is working, push seems being enabled according to the logs but the user still not received any notification.

Unknown commented 4 years ago

@guigot I've reviewed attached log and while there is a response with type set to result (so push component processed the requests successfully), I cannot tell what the payload of the notification was as in attached logs are just <iq/> elements and their attributes.

However, I suppose that request was valid according to the PubSub protocol (which is reused by XEP-0357: Push Notifications), but the internal structure may result in sending a different type of push notification, ie. low priority which may be dropped by the APNS.

I've looked at the Metronome source code available at https://github.com/maranda/metronome/blob/master/plugins/mod_push.lua and while I'm not an expert in Lua, it looks like Metronome may be generating push notifications payload without a Data From (it generates just a <notification xmlns="rn:xmpp:push:0"/> which then contains <field/> elements while according to the XEP-0357 <notification/> element MAY contain a Data Form, so <field/> elements should be wrapped within <x xmlns="jabber:x:data"/> element.

Without this element, our push component considers those notifications as low priority and due to that those notifications may be dropped later on by the APNS. This distinction was added as some servers were sending push notifications for all packets which should be delivered to our XMPP client causing a lot of notifications which alerted users while those notifications were not important at all.

Could anyone from Metronome could verify my findings? and if possible adjust source code of Metronome to properly include Data Form elements? The issue (if I'm correct) is around the line 71 of the mentioned mod_push.lua file.

issue 1 of 1
Issue Votes (0)
Watchers (0)
Reference
tigase/_clients/siskin-im#419
Please wait...
Page is in error, reload to recover