tmolitor-stud-tu / mod_push_appserver

Simple and extendable appserver for XMPP pushes (aka. XEP-0357)
MIT License
25 stars 9 forks source link

Push handler for type 'fcm' not executed successfully: handler not found #10

Closed streaps closed 5 years ago

streaps commented 5 years ago

I'm testing mod_push_appserver with Conversations and I'm getting this error in prosody.log. Conversations is patched. I'm not sure if this is a bug or if I misconfigured something.

Dec 30 19:21:17 push.example.com:push_appserver     info    Firing event 'incoming-push-to-fcm' (node = '123a567b901c34d6', secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
Dec 30 19:21:17 push.example.com:push_appserver     error   Push handler for type 'fcm' not executed successfully: handler not found
Dec 30 19:21:17 push.example.com:push_appserver     warn    Rate limit for node '123a567b901c34d6' reached, ignoring push request (and returning 'OK')
Dec 30 19:21:17 push.example.com:push_appserver     warn    Rate limit for node '123a567b901c34d6' reached, ignoring push request (and returning 'OK')
Dec 30 19:21:17 push.example.com:push_appserver     warn    Rate limit for node '123a567b901c34d6' reached, ignoring push request (and returning 'OK')
...
tmolitor-stud-tu commented 5 years ago

You have to load and configure the fcm submodule (push_appserver_fcm), too.

streaps commented 5 years ago

I had configured it like this

push_appserver_fcm_key = "<key>"
push_appserver_debugging = true
...
Component "push.example.com" "push_appserver"

and changed it to that

Component "push.example.com" "push_appserver"
        push_appserver_fcm_key = "<key>"
        push_appserver_debugging = true

Is this the way to do it? It seems to work now.

I'm running the p2 server as a separate component until all clients have updated their app.

tmolitor-stud-tu commented 5 years ago

Well, it's strange if it works now, because you still didn't load the fcm submodule. Example:

Component "push.example.com" "push_appserver"
        push_appserver_fcm_key = "<key>"
        push_appserver_debugging = true
        modules_enabled = { "push_appserver_fcm" }

Don't forget to disable debugging if everything works as expected!!

streaps commented 5 years ago

I did load the push_appserver and push_appserver_fcm module in the global config. If push_appserver_fcm have to be enabled in the Component config, then we should put it in the README. I haven't seen this kind of configuration before and there is no mention of it in the obvious places at prosody.im.

The "handler not found" error is gone now, but I still get "Rate limit" warnings, if the client is not reachable. To reproduce the warnings I turn off the wifi at device 1, then send a message from device 2 to device 1 and after some time these warning appear in the log until device 1 is online again. Is this normal?

tmolitor-stud-tu commented 5 years ago

Loading them globally is ok, I just didn't know you did it that way.

To answer your question you should look at the debug log of the xmpp server device 1 uses (ideally a prosody server using mod_cloud_notify). You can send me the debug log for device 1 if you want me to check if everything is all right. Ideally accompanied by the debug log of the appserver showing the rate limit warnings.

streaps commented 5 years ago

The rate limit warnings are gone, I'm not sure why and how to reproduce it.

Unfortunately it seems mod_cloud_notify does not work at all on my server. I don't see any push messages delivered to the client. I tested it with Conversations and adb logcat. Using a conversations.im account push messages are arriving, with an account on my server there are now push messages that arrive. According to the prosody.log push notifications are enabled:

info   Push notifications enabled for test@mydomain.example/Conversations.s5cj (p2.siacs.eu<PBzsh37Ds)
tmolitor-stud-tu commented 5 years ago

Activate prosody's debug logs on your server. This will make mod_cloud_notify log a lot of useful information.

If you paste the cloud_notify portion of this debug log here, I'll try to help :)

tmolitor-stud-tu commented 5 years ago

Are you using the newest version of mod_cloud_notify?

tmolitor-stud-tu commented 5 years ago

I'll close this now because mod_cloud_notify debugging is kind of offtopic here, feel free to contact me in private for assistance here.