Spurious GCM Error NotRegistered responses.

4,171 views
Skip to first unread message

Kate Wilkins

unread,
Mar 20, 2013, 10:55:41 AM3/20/13
to andro...@googlegroups.com
Hi,

We're writing an Android App with a service component and using GCM to notify clients of events. The server side is written in Java using the GCM libs (com.google.android.gcm.... V1.0.2 from the SDK) and 99.99% of the time it works just fine but quite regularly and randomly we are getting back error responses from GCM to the push notification for particular clients. The application itself has not been removed and was working fine the day before and will suddenly generate {"error":"NotRegistered"} whenever we try and send to it.

The problem being the app hasn't been removed and the API docs state that this error is when the app has been uninstalled and so our server implementation removes the client from the database. Now when the client next talks to the server its told it has to re-register which is very irritating to users. If we ignore the not registered message and don't remove clients then we grow cruft in our database and send notifications to clients that really have been uninstalled.

It seems when we see this error then it keeps happening for that client for a day and then all returns to normal and then a few days later a different handset will have the issue. We've seen the problem on a variety of different devices and its always the same, problems for a day/part of the day with GCM regularly returning "NotRegistered" for a device, we re-register the device it works for a few mins/hours then its "NotRegistered" again.

Is this a known issue, is there a workaround or fix for this. Anyone from Google care to help me/us debug this???

Thanks

Kate

Sergei Barinov

unread,
Jun 7, 2013, 2:37:22 AM6/7/13
to andro...@googlegroups.com
I've got the same problem for a few users. Found this while checking server logs:
  1. Client app becomes registered on a server
  2. After a few seconds I need to send back push message to this device
  3. GCM returns "NotRegistered" error
  4. My server delete this account, as it should

I'm definetely sure, that app is installed on device, since user tries to login on my server many times, and I can only observe the situation I wrote above: register-send push-NotRegistered-delete account from server.

Anybody, please advice anything.


среда, 20 марта 2013 г., 18:55:41 UTC+4 пользователь Kate Wilkins написал:

Rene Ravenel

unread,
Jun 12, 2013, 7:51:04 PM6/12/13
to andro...@googlegroups.com
I'm seeing the same thing.

In my case, the first message my server sends to the device following device registration via GCM is received by the device as a com.google.android.c2dm.intent.REGISTRATION action w/ an "unregistered" extra.  This first message succeeds on the server side, but subsequent messages return the "NotRegistered" error.

This problem also began spontaneously on a Monday morning when it had been working as expected on Friday evening w/o any code change over the weekend.

Has any one seen this problem with the c2dm implementation?  

Thanks,
-Rene

Sergei Barinov

unread,
Jun 13, 2013, 12:47:06 AM6/13/13
to andro...@googlegroups.com
Well, I decided to switch to streamlined GCM registration API. My project is using Google Services API already, so I removed gcm.jar, update goolge play services library and rewrite GCM stack in my application. For now, no problem met.

Sergei Barinov

unread,
Jun 13, 2013, 4:21:28 PM6/13/13
to andro...@googlegroups.com
Today I met the same problem on server production logs. Got request from device with registrationId, and after trying to send push message - got Unregistered response :(
I'll post an issue for gcm repository. May be someone can help us there...

четверг, 13 июня 2013 г., 8:47:06 UTC+4 пользователь Sergei Barinov написал:

Rene Ravenel

unread,
Jun 25, 2013, 10:29:40 PM6/25/13
to andro...@googlegroups.com
I re-implemented on the older d2cm API and it worked...  until it didn't.  I get occasional java.net.SocketException: Broken pipe exceptions.

To me this says it's not an issue w/ my implementation but instability on Google's side.

Sure would be nice to have a stable platform to dev against.

ricard...@gmail.com

unread,
Sep 3, 2014, 4:13:20 PM9/3/14
to andro...@googlegroups.com
Hi,

Sorry for reopen this topic but I'm having the same problem for a few users, does anyone have a solutions or a technical answer for this issue?

Thanks,

Ricardo Momm

Mohamed Hafez

unread,
Sep 29, 2014, 4:09:36 PM9/29/14
to andro...@googlegroups.com
I'm also encountering this problem, actually more frequently now than last year. Any word from Google on this? (tried to send them a bug report) Any workarounds?

Mohamed Hafez

unread,
Sep 30, 2014, 8:26:05 PM9/30/14
to andro...@googlegroups.com
I've seen this blog saying that have to re-register when the user updates their Android OS version, anybody think that could be what is causing this problem?

Massimo Di Cosimo

unread,
Oct 23, 2014, 10:59:42 AM10/23/14
to andro...@googlegroups.com, mohamed....@gmail.com
Hello there,
same problem here.
The only information I can add is that all cases I see are on Android 2.3.x
The last one, yesterday, on Android 2.3.6.
Thanks,
Max Di Cosimo

Sachin Gupta

unread,
Oct 30, 2014, 8:06:11 AM10/30/14
to andro...@googlegroups.com, mohamed....@gmail.com
Hi All,

I have logged an issue for this at https://code.google.com/p/gcm/issues/detail?id=47.

Please star this issue to prioritize.

Sachin Gupta

unread,
Oct 30, 2014, 8:06:19 AM10/30/14
to andro...@googlegroups.com
Hi All,

I have logged an issue for this at https://code.google.com/p/gcm/issues/detail?id=47.

Please star this issue to prioritize.

Sachin Gupta

unread,
Oct 30, 2014, 8:06:31 AM10/30/14
to andro...@googlegroups.com
Hi All,

I have logged an issue for this at https://code.google.com/p/gcm/issues/detail?id=47.

Please star this issue to prioritize.

GM6

unread,
Nov 12, 2014, 3:24:07 AM11/12/14
to andro...@googlegroups.com
a year and a half and no solution...Really?!
Same problem for me only it's a lot more often. Testing on an emulator and every few minutes gets the NotRegistered error

Yi Cui

unread,
Nov 19, 2014, 8:23:34 PM11/19/14
to andro...@googlegroups.com
Apologies for not replying on this thread for long. The best way to diagnose your problem is to send us the registration ID of your device, as well as the approximate time window at which the problem occurred. Then we can investigate from our side.

Thanks

Yi

Swapnil Gupta

unread,
Nov 21, 2014, 1:15:37 AM11/21/14
to andro...@googlegroups.com
Hi Yi,

I have been facing this issue for almost 25% of total user base of an enterprise application. I have handled all possible scenario such OS Update , App version update in application for fetching new registeration ID's but still i am facing this issue. In my case what happens for certain specific users GCM works for first one -two hours after first installation but after that server starts getting NotRegistered Error while the app is still installed in their mobile devices. Due to this persistent issue and no solution i am forced to implement polling mechanism using alarm manager in app which consumes a lot of battery and bandwidth.

As asked by Following are couple of registration ID's and time frame :

1. APA91bEYHuVylWQLHaiWF8eR_XELBkYhE3uyGZ-2mzHMFESGe3dZLrXXm_e54RgbMm7Fb8NG2uZbSenNpzi3XjuN3wkz9Zbafzs0QtUBLprECwJGrtM1bEjuz4k1EYdRTGnd_os3G5Y65aia8Kfk6BbbkNNiX4SibZ-lalXI2blWZHJG_8LiUp0  

Time Frame issue being faced : Everyday since  2014-10-13 12:45:13 (IST) till current date.

2. APA91bHJc_8bib0iaSn78fbj3lEMbn3pGmaIXgcec8az-b88mYlXBS_AGTTzel7J4GW_Zy6wACcO94gcvDGP8_xE37jpzsVbG3Xjh-p4HcxDUMoG5iZlatqqKyxWCoGDXVAPsdElIzi8JSYjM910kwT86IlQAYvEgDRLrMLxKkRf9onD5Ym5zeE

Time Frame issue being faced : Everyday since 2014-08-08 12:50:04 (IST) till current date.

3.APA91bF9pf4vkETFxMhQTHpbSiyHWoekcRCgtLoOPP0OEaPVA2SM_F7h_1LpcNsz0wVFZG88z0oqxt2FpA-RTQl6P-Pi5AyWAgJhbG0Sa5Wen3JjWjCixbRZ6bGdiHwhv98IfXiOaHn2qZyB8IFWMymB7RF6pToJzjSiuyUvM8vilqhN6Os6hiM

Time Frame issue being faced : Everyday since 2014-08-29 17:10:09  (IST) till current date.

Let us know if you need more registration ID for analysis....

Yi Cui

unread,
Nov 21, 2014, 12:38:09 PM11/21/14
to andro...@googlegroups.com
Thanks. RegID is always a good starting point for troubleshooting. It allows us to diagnose the problem at the device level, even if the regID is an expired one. In this case, your registration is no longer valid, very likely due to the reasons listed here.

Basically, the regID becomes invalid when your app is upgraded. The solution (also posted in the webpage above) is to associate your current regID with your app version. When they mismatch (mostly due to an app upgrade), register to GCM again to obtain a new regID (also sync the new regID to your server).

Hope this helps and let us know if situation improves.

Swapnil Gupta

unread,
Nov 21, 2014, 11:49:12 PM11/21/14
to andro...@googlegroups.com
Hi Yi,

Thanks and we really appreciate you for your prompt response to my query. 

As i had already quoted in my query that i have already implemented to fetch new registration id in cases of OS update / App version update. Considering these two points i have also observed that after the application is updated user's start receiving the GCM notification as they are newly registered users but after 10-20 sec gcm server starts giving NotRegistered Error despite the user not uninstalling the application. If needed i can share with the implementation of my gcm client privately. Let me know what do you need additionally so that it could help in debugging the issue. 


Note : This issue is only observed for few handsets for which no pattern on hardware configuration exists.. In some random selected devices we are facing this issue.

Thanks 
Swapnil Gupta

Massimo Di Cosimo

unread,
Dec 15, 2014, 11:42:49 AM12/15/14
to andro...@googlegroups.com
Today one user installed, for the first time, my app.
Registered to GCM at 13:17 UTC with regID
APA91bFstILcMlKZsHMq6v9colqD0w

_wa2r1WERcnfqCKSvMny-xyLPgxgl9aX_KvAfqxZ45Hah-yNYCbTQX5CyDR8lL1IK_Xn2EXliWmVVlsKoG_5z4L5oIVIcru8lu-5odGEd9RTAT0qPd7nb8yixJeLuZi3jXZA


After less than two hours I sent the first notification and the answer was "Not Registered" !

App is still installed.

Thank you,

Max

Mayur Jain

unread,
Oct 30, 2015, 9:57:53 AM10/30/15
to android-gcm
Hello Yi,

I didnt found any thing in the given link.Its just showing the home page of cloud messaging.

Diego Giorgini

unread,
Oct 30, 2015, 10:04:48 AM10/30/15
to android-gcm
The website has been update.
I believe that the content that Yi linked can be found here:
https://developers.google.com/cloud-messaging/http-server-ref#error-codes


--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/c155f9f4-cb00-479a-8056-3f260d704b8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vignesh karthik

unread,
Nov 2, 2015, 6:07:20 AM11/2/15
to android-gcm
Hi,

Two of our devices had done a GoogleCloudMessaging.getInstance().register() and obtained the following GCM registration ids 

Device 1)
GCM registration id: APA91bGSP032oCJVdh1xkDUpfD2_C1cVnuqPp31SbCH0eR4Y69Vz0kOVnk_apUvMXwfgwNhs_PtZfphb4xk0V2C0wBfj-LjQgAsnl46Df7C9i-QefKf7mNTDUDzL-wmzIpCTMZ1pnOrX
(10/29/2015, 11:57:44 PM GMT+5:30)

Device 2)
GCM registration id: APA91bGEduS63uZMGe31y_G-rtP1rINrpIGJzvDq_2--MdY32IPcJG-KvhfMxtvX8dnEGtA2gBlHu36Vye-ai0QBhDEwQo3RuM-JLi4PHeLfsXIkB6SBh5Lrks7IcsuvuthTKqaXNi9q
(10/29/2015, 11:58:17 PM GMT+5:30)

But when servers tried to send messages to this regid almost around the same time, the server got a failure 'NotRegistered'.   Many devices appear to face this problem (about 20 in number out of 100 and this number is growing).

From this link:  https://developers.google.com/cloud-messaging/http-server-ref#error-codes, there are four cases, when gcm registration id can go invalid

My application cannot be uninstalled, cannot be upgraded and it could not have done a GCM de-registration.   Only remaining piece is "If the registration token expires (for example, Google might decide to refresh registration tokens)".   How can my application know, that my registration token is expired?

Any pointers/clues will be of great help.

Thanks very much.


Vidya Narayanan

unread,
Nov 22, 2015, 2:39:46 PM11/22/15
to android-gcm
Hi,
We have the same issue of getting spurious NotRegistered errors on some of our devices and we observe this happens a lot more on iOS devices (we are using GCM to also handle APNS notifications to iOS clients).  The application is not uninstalled and it receives a success on GCM connects.  Yet, notifications start out working, then suddenly stop and server logs show NotRegistered errors.  The server then removes that id from its list (as it should).  That pretty much ends the notifications to that device altogether after that point. 

Any pointers of how to handle this will help. 

Thanks,
Vidya 

Diego Giorgini

unread,
Nov 23, 2015, 9:47:53 AM11/23/15
to android-gcm
Hi Vidya,

please use the form https://support.google.com/code/contact/gcm_dev_support to report your issues with GCM.

Thanks,
- Diego

--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages