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 发生了什么?

4

1 回答 1

0

谢谢@约翰·洛瑞。Google 似乎已经解决了应用引擎问题,并且身份验证现在正在为我们工作。我想知道根本问题是什么。

于 2013-06-12T08:30:25.300 回答