Timeouts refreshing Google oauth token in GAE app

Timeouts refreshing Google oauth token in GAE app

I have a GAE app that periodically requests a user's activities from G+. I'm using the google oauth client api for java.
This has been working fine for months with literally no code changes (I'll post the code if required, it's all taken straight from the oauth client project examples, using GoogleAuthorizationCodeFlow).
However, a couple of days ago this changed. Now, without fail from the GAE instance, I get this exception during token refresh:
java.net.SocketTimeoutException: Timeout while fetching URL: https://accounts.google.com/o/oauth2/token
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:141)
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:43)
at com.google.api.client.extensions.appengine.http.UrlFetchRequest.execute(UrlFetchRequest.java:77)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1009)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:299)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:323)
at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:586)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:505)
at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:266)

Now this still works fine from my local machine. There are no reported quota issues on the GAE dashboard or on the Google APIS console for this app. Billing is enabled for the Google APIs console project, but not the GAE app.
I note there's a similar looking issue in a python app reported here, but that has no responses so far.
This has been happening continuously for a couple of days - the app tries once an hour for a hundred or so different users. If I limit the app to only perform this for a single user it still occurs.


Answer 1:

Here is what I’ve noticed:
the service started working for me two days in a row at about 10:30 pm and then stopped working again next day at about 8am(both Saturday and Sunday this weekend: June 8-9 2013). Really looks like high load issue.
Will hope that Google fix it soon.

I absolutely made no changes in my code on app engine server. It just started working and then stopped working.

P.S. also it looks like it takes always about 40 seconds before server gets SocketTimeoutException every time I try to sign in with Google plus.

P.P.S. and yes it works on my local instance of Google App Engine.

Answer 2:

We are still experiencing the same problem: at around 1pm-2pm GMT of every day the OAuth2 refresh token method starts failing with a time out error, for 10-14 ours. After that time it works again.

A similar issue is posted here: https://code.google.com/p/google-glass-api/issues/detail?id=99.


Update: it seems the problem has been solved.
See https://groups.google.com/forum/?fromgroups#!topic/google-appengine-downtime-notify/TqKVL9TNq2A

Answer 3:

I think it may have been due to this issue:

The problem with Google App Engine URL Fetch service to Google
Accounts authentication endpoints was resolved as of 5:15 PM
US/Pacific on June 7, 2013. We apologize for the inconvenience and
thank you for your patience and continued support. Please rest assured
that system reliability is a top priority at Google, and we are making
continuous improvements to make our systems better.


Answer 4:

This timeout issue is happening consistently for on two app engine instances running my app anyCloud and staging.anycloud.co). I can not get an access token or refresh an existing one and consistent with the other posters, the same code works fine when running in a localhost dev environment.