Firebase-js-sdk: Bug Report : Registration failed - push service error

Created on 9 Jun 2020  路  12Comments  路  Source: firebase/firebase-js-sdk

[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.

messaging

Most helpful comment

same error here!, also using brave in linux

All 12 comments

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

Was this page helpful?
0 / 5 - 0 ratings