Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 639
Nick Cotter Avatar asked Jun 07 '13 20:06

Nick Cotter


1 Answers

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.

like image 108
ioanbsu Avatar answered Oct 19 '22 17:10

ioanbsu