Unable to send push notifications (There are no Tokens for this user)

Description

So, i found references to this error on multiple posts and sites, but nothing described there actually helps so maybe with a new version it needs a new fix?

I tried to setup push notifictaions for the rocket chat mobile app to use it with our team.

I have registered our selfhosted server with the cloud and it shows up in the Dashboard with the remark “Registered”

I have checked all the things mentioned here: Push (Notifications Admin Guide) - Rocket.Chat Docs

But i still can not get any push notifications to send.
If i click the test Button i am Greeted with the red allert message “There are no Tokens for this user”.
Some other posts have alluded to this meaning that i am not correctly logged in on my mobile device so i tried logging in there again, reinstalling the app and klicking the test button on my mobile phone (iOS) but i get the same message every time.

I Enabled logging and this seems to be the relevant log:

I20210928-13:02:52.985(0) API ➔ info 172.27.0.1 - qbeASbEHfN [2021-09-28T13:02:52.985Z] "POST /api/v1/method.call/cloud%3AcheckUserLoggedIn" 200 - "https://DOMAIN/admin/cloud" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Electron/13.2.2 Safari/537.36" |  
I20210928-13:02:59.459(0) Meteor ➔ method 172.27.0.1 - qbeASbEHfN [2021-09-28T13:02:59.457Z] "METHOD push_test" - "https://DOMAIN/admin/Push" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Electron/13.2.2 Safari/537.36" |  
I20210928-13:02:59.464(0) server.js:204 System ➔ error Exception while invoking method push_test There are no tokens for this user [error-no-tokens-for-this-user] 
I20210928-13:02:59.465(0) Exception while invoking method push_test Error: There are no tokens for this user [error-no-tokens-for-this-user]     at MethodInvocation.push_test (server/lib/pushConfig.js:51:10)     at MethodInvocation.methodsMap.<computed> (app/lib/server/lib/debug.js:90:34)     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12)     at packages/ddp-server/livedata_server.js:1689:15     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)     at packages/ddp-server/livedata_server.js:1687:36     at new Promise (<anonymous>)     at Server.applyAsync (packages/ddp-server/livedata_server.js:1686:12)     at Server.apply (packages/ddp-server/livedata_server.js:1625:26)     at Server.call (packages/ddp-server/livedata_server.js:1607:17)     at Object.post (app/api/server/v1/misc.js:272:26)     at app/api/server/api.js:400:82     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)     at Object._internalRouteActionHandler [as action] (app/api/server/api.js:400:39)     at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)     at packages/nimble_restivus/lib/route.coffee:59:33     at packages/simple_json-routes.js:98:9  => awaited here:     at Promise.await (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12)     at Server.apply (packages/ddp-server/livedata_server.js:1638:22)     at Server.call (packages/ddp-server/livedata_server.js:1607:17)     at Object.post (app/api/server/v1/misc.js:272:26)     at app/api/server/api.js:400:82     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)     at Object._internalRouteActionHandler [as action] (app/api/server/api.js:400:39)     at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)     at packages/nimble_restivus/lib/route.coffee:59:33     at packages/simple_json-routes.js:98:9 
I20210928-13:02:59.467(0) API ➔ debug Success {   statusCode: 200,   body: {     message: '{"msg":"result","id":"24","error":{"isClientSafe":true,"error":"error-no-tokens-for-this-user","reason":"There are no tokens for this user","details":{"method":"push_test"},"message":"There are no tokens for this user [error-no-tokens-for-this-user]","errorType":"Meteor.Error"}}',     success: true   } } 
I20210928-13:02:59.468(0) API ➔ info 172.27.0.1 - qeASbEHf [2021-09-28T13:02:59.468Z] "POST /api/v1/method.call/push_test" 200 - "https://DOMAIN/admin/Push" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Electron/13.2.2 Safari/537.36" |

I hope someone can help a bit, and feel free to request more relevant infos if you need them.

Server Setup Information

  • Version of Rocket.Chat Server: 3.18.1
  • Operating System:
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v12.22.1
  • MongoDB Version: 4.0.27 / mmapv1 (oplog Enabled)
  • Proxy: nginx
  • Firewalls involved:

Hi!

I found this thread here on forums that may help you:

Hi @dudanogueira
thanks for the link, bt as i have said in my post i have already tried to log out and in again multiple times on mobile, including reinstalling the app :frowning:
Sadly nothing seemed to help for now

So, after a few reinstalls of the RocketChat App on my iPhone i now get a success message if i try to send a test notification.

Sadly no notification ever arrives on my phone. Seems like i fixed one thing just to run into more problems :confused:

Also experiencing this problem.

And the push test:

And the no tokens:

What to do?

I was logged in to rocketchat on my phone (Apple/iOS 17.1.2) at the time

did you enter the token in the “connectivity services” tab?

Still having the same problem. It seems to be supported as in the cloud panel show 10k push notifications available. But this error is always happening. Anyone have any idea how to solve that for new implementation? Btw I’m using docker and already tried to change the image but the problems persists!