Google Cloud Messaging for Chrome '500' Error

362 views
Skip to first unread message

Faiz Visram

unread,
May 18, 2013, 1:24:18 AM5/18/13
to chromi...@chromium.org
Every time I try to send a GCM for Chrome, I get a '500' error:

HTTP/1.1 500 Internal Server Error
Content-length: 52
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
X-google-cache-control: remote-fetch
-content-encoding: gzip
Server: GSE
Reason: Internal Server Error
Via: HTTP/1.1 GWA
Cache-control: private, max-age=0
Date: Sat, 18 May 2013 04:56:31 GMT
X-frame-options: SAMEORIGIN
Content-type: application/json; charset=UTF-8
Expires: Sat, 18 May 2013 04:56:31 GMT
{
 
"error": {
 
"code": 500,
 
"message": null
 
}
}
Attempts with incorrect information (bad token, bad channelId) give appropriate error codes, but when using correct input I only ever get 500 Internal Server Error codes. It's been like this for days, so how do I make it work?

Rick Pease

unread,
May 20, 2013, 2:11:40 PM5/20/13
to chromi...@chromium.org

dim...@chromium.org

unread,
May 21, 2013, 6:47:04 PM5/21/13
to chromi...@chromium.org
One of the reasons for that is when an "app owner check" fails. Unfortunately, the message returned is unclear at this point... Something to improve.

This is what "app owner check" means: When you post a message, GCM for Chrome verifies that the user account that was used to obtain the Oauth tokens is the same as the one used to publish the Chrome app that is the receiver in Chrome Web Store. If they don't match, the message post fails with the 500 error. This is done to prevent someone else from posting notifications for your app.

That means that if you created an app and never published it in Web Store (and just load it unpackaged for testing for example) - it will always fail like this because GCM does not know who owns the app. When publishing the app to the Store, use the same google account that was used in Api Console to create a project and Oauth clientId/client secret etc. The publishing works only if those google accounts match.

Note that you can continue to debug/test your app locally after that, you don't need to publish it to Store and update every time you made a change.. What you need to do for it is a bit weird, but please just bear with me here:

- Install your app from the Store. Make sure it can receive Push Messages.
- Find the location of your app on the disk (something like ~/Library/Application Support/Google/Chrome/Default/Extensions/<appid> on Mac for example)
- grab "key": "<string>" from the manifest.json of your installed app. Web Store added this pair into manifest and it contains magic.
- insert that "key" value into your local manifest.json.
- uninstall the app you've got from Store
- load your unpackaged app for testing. It now is able to receive the messages for debugging.
- before uploading it to the Store for update, remove "key" value from manifest - Web Store won't upload the manifest with it. Subsequent uploads don't modify the magic key value inside the Store so the app will continue to receive notifications.

Hope this helps, I can not be sure this is exactly what your issue is though :-)
Dmitry
Reply all
Reply to author
Forward
0 new messages