Bug Report : Registration failed - push service error
[REQUIRED] Describe your environment
- Operating System version: Windows 10
- Browser version: Chrome Version 83.0.4103.61 (Official Build) (64-bit)
- Firebase SDK version: 7.15.0
- Firebase Product: Firebase Messaging
[REQUIRED] Describe the problem
I'm using Angular Fire and when requesting token using below code it throws error
Code
this.messaging.requestToken
.subscribe((token) => {
this.sendTokenToServer(token);
},
(error) => {
console.error(error);
this._gs.hideOverlay();
},
);
Error
Uncaught DOMException: Registration failed - push service error
This issue occurs randomly, I mean the same code which works perfectly suddenly breaks and start throwing this errror.
If I create a new profile on Chrome (i.e. a new user), the exact same code starts working on same machine.
I think its an old issue but has not be permanently fixed, and I believe this should be thoroughly investigated and fixed.
Below are the issues I found on Firebase and Angular Fire Repos,
https://github.com/firebase/firebase-js-sdk/issues/909
https://github.com/FirebaseExtended/polymerfire/issues/345
https://github.com/firebase/firebase-js-sdk/issues/771
https://github.com/firebase/firebase-js-sdk/issues/152
https://github.com/angular/angularfire/issues/2475
Steps to reproduce:
I have no idea whats actually causing the issue and issue occurs randomly, hence don't know how to reproduce the issue.
For https://www.mustakbil.com/ its working for some users and not for others. In my case its working fine on Android and broken on desktop, if I setup new profile it works jut fine.
The issue is, its broken even for some of the new and first time users of the website.
Relevant Code:
Angular Fire code.
this.messaging.requestToken
.subscribe((token) => {
this.sendTokenToServer(token);
},
(error) => {
console.error(error);
this._gs.hideOverlay();
},
);
I would have reported this issue on Angular Fire repo, but in my opinion the issue is related to Firebase library. Since I have seen posts complaining about same issue while using different frameworks.
Thank you or your attention to this issue.
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Same issue yesterday on a stable PWA deployed many months ago. However it seems to be browser related. Clearing Service workers and storage in Chrome Dev Tools / Application have fixed the problem.
Clearing Service workers and storage in Chrome Dev Tools / Application have fixed the problem.
In my case even this doesn't work unless I creat new user profile (reported by other users as well)
I also initially thought this that it must be related to the browser but then I came across the other demos of firebase push notifications, hosted on different domains and all of them had the same issue on the same chrome user profile. But when I tested it with other websites that were for example using other push notification service providers for example one signal it was working fine on same user profile of chrome.
I still think its browser related, as we just tested, same user on two PCs ( iMac & Linux), both running newest version of chrome. PWA works on iMac, chrome on linux displays push service error
In my case it only happens with sites using firebase js sdk.
I left a comment on the other issue, but this is a super annoying issue so I'm going to link that comment here as well: https://github.com/angular/angularfire/issues/2475#issuecomment-711099922
I'm also facing this issue, but that happens only Brave (even when I deactivate the privacy shield); Edge, Firefox and Opera are working fine.
I'm using a npm version of firebase (7.23.0) inside of a React app that has another service worker running, if that helps contextualizing the problem :)
Yeah all the other browsers were working ok for me, but Brave is my main browser
same error here!, also using brave in linux
Any update on this?
I just checked chrome://gcm-internals/ and under Registration Log it shows TOO_MANY_REGISTRATIONS. Any idea what could have caused this? And how to fix this?
If I take a look at Registration Log it seems any call to messaging.getToken and messaging.requestToken methods tries to get registration token with a new random App Id. as a result we have too many registrations.
Example 'App Id's
wp:https://www.mustakbil.com/#BB0DB796-278C-474F-A734-32B35E3E2-V2
wp:https://www.mustakbil.com/#D00AD433-4922-4E22-846D-05DF35109-V2
wp:https://www.mustakbil.com/#D00AD183-4922-4E22-885D-05DF35109-V2
wp:https://www.mustakbil.com/#3FF9E22C-231B-4C61-9C1E-F38B31290-V2
wp:https://www.mustakbil.com/#D7158487-E513-4C08-A904-373567A69-V2
I have also opened a issue with Chrome team, https://bugs.chromium.org/p/chromium/issues/detail?id=1153182
Any updates on this? Still happens in Brave in Manjaro Linux
I'm also experiencing same issue on Brave and Chrome. Same code which has been working for more than 6 months just started throwing that error this week
any updates on this we are getting the same error intermittently
This is intentional behavior in Brave, they disable using Google's push service by default for privacy reasons. As far as I have seen, they do not have on their roadmap a replacement for it and will continue to leave it disabled by default. You can enable it by going to brave://settings/privacy and enabling "Use Google services for push messaging." Here are some related issues:
- https://github.com/brave/brave-browser/issues/15062
- https://github.com/brave/brave-browser/issues/2362
@wbobeirne Thanks, it helps a lot.
It's been a while. Checking in to see if this is a Brave configuration issue for folks that's helped by wboberine's post above. Thanks!
I have the same issue on Android Chrome,Does anybody resolved?
@soulcm, is your environment the same as the original ticket? If not, I'd ask you to create a new issue with details about the configuration you're using and the code that's failing. Thanks!
In my experience the issue occurs on frequent calls to requestToken / deleteToken. In our case, we were calling requestToken on user login and deleteToken on user logout from our website, or when user clicks the toggle notifications button i.e. call requestToken when user clicks Enable Notifications button and call deleteToken when user click Disable Notifications button.
As a workaround, we now never call deleteToken, instead we track the unsubscription on our own server.
In my experience the issue occurs on frequent calls to
requestToken / deleteToken. In our case, we were callingrequestTokenon user login anddeleteTokenon user logout from our website, or when user clicks the toggle notifications button i.e. callrequestTokenwhen user clicks Enable Notifications button and calldeleteTokenwhen user click Disable Notifications button.As a workaround, we now never call
deleteToken, instead we track the unsubscription on our own server.
following up on this thread, couple qs:
- @naveedahmed1 know this is an old thread, but what SDK versions are you on? are you still seeing this error?
- out of curiosity:
we track the unsubscription on our own serverhow is this flow currently implemented in breid
Hey @naveedahmed1. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@naveedahmed1 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.