URL Fetch和oAuth2 Playground 500错误

时间:2013-06-11 14:06:02

标签: google-app-engine oauth-2.0

自上周四以来,我们一直遇到来自Google App Engine的urlfetch错误。通常这些期间持续数小时,导致我们的申请在授权期间失败。通过OAuth2游乐场进行测试有时也会出现问题。

在尝试交换令牌的授权码时,从操场上报告:

Something bad happened: 500 HTTP error. 

Message:  500 Server Error

Error: Server Error

The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this 
error message and the query that caused it

我们的代码报告中的授权请求:

Uncaught exception from servlet
com.google.apphosting.api.DeadlineExceededException: This request (3544c942ab0ce9ec) started at 2013/06/11 11:17:17.608 UTC and was still executing at 2013/06/11 11:18:17.027 UTC.
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1033)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:268)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:96)
at com.google.appengine.tools.development.TimedFuture.get(TimedFuture.java:57)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:69)
at com.google.apphosting.runtime.ApiProxyImpl.doSyncCall(ApiProxyImpl.java:230)
at com.google.apphosting.runtime.ApiProxyImpl.access$000(ApiProxyImpl.java:67)
at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:201)
at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:198)
at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:67)
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:111)
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:38)
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.fetchResponse(URLFetchServiceStreamHandler.java:417)
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getInputStream(URLFetchServiceStreamHandler.java:296)
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getResponseCode(URLFetchServiceStreamHandler.java:149)
at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:95)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:412)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463)
at com.ourapp.server.OAuthMethods2.handleCallbackIfRequired(OAuthMethods2.java:127)
at com.ourapp.server.OAuthServlet2.handleCallbackIfRequired(OAuthServlet2.java:81)
at com.ourapp.server.AuthLandingServlet.handleCallbackIfRequired(AuthLandingServlet.java:1)
at com.ourapp.server.AuthLandingServlet.doGet(AuthLandingServlet.java:30)

或其他形式

Uncaught exception from servlet
java.net.SocketTimeoutException: Timeout while fetching URL: https://accounts.google.com/o/oauth2/token
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:142)
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:43)
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.fetchResponse(URLFetchServiceStreamHandler.java:417)
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getInputStream(URLFetchServiceStreamHandler.java:296)
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getResponseCode(URLFetchServiceStreamHandler.java:149)
at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:95)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
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:607)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:324)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:526)
at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:287)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:836)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:412)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463)
at com.ourapp.server.AuthLandingServlet.doGet(AuthLandingServlet.java:34)

导致超时的确切代码是:

GoogleTokenResponse response = new GoogleAuthorizationCodeTokenRequest(
      transport,
      jsonFactory,
      clientSecrets.getWeb().getClientId(),
      clientSecrets.getWeb().getClientSecret(),
      code,
      clientSecrets.getWeb().getRedirectUris().get(0)).execute();

AppEngine发生了什么想法?

1 个答案:

答案 0 :(得分:0)

谢谢@John Lowry。 Google似乎已经解决了应用引擎问题,现在身份验证正在为我们工作。我想知道底层问题是什么。