为什么Datastore抛出异常解析URLFETCH的参数?

时间:2016-11-27 16:41:40

标签: java google-app-engine google-cloud-datastore app-engine-flexible

在“后端”Google App Engine灵活环境实例的后台线程中使用Google Cloud API for Datastore运行简单查询,我在多次查询尝试中获得了以下异常几秒钟。

An error occurred parsing (locally or remotely) the arguments to URLFETCH.Fetch()

(参见下面的stacktrace。)

它与另一个错误同时出现

com.google.apphosting.vmruntime.VmApiProxyDelegate  convertApiResponseRpcErrorToException: RPC failed, API=urlfetch.Fetch : BAD_REQUEST : There is no active request context for this API call.

在例外之前,日志显示

 com.google.apphosting.vmruntime.VmRequestThreadFactory interruptRequestThreads: Request thread Thread-16 is still alive, forcing interrupt. 

... convertApiResponseRpcErrorToException: RPC failed, API=urlfetch.Fetch : CANCELLED

这表示已达到Google App Engine超时,例如网络请求的60秒限制。看看日志,这似乎不是真的。但无论如何,该查询在使用 backgroundThreadFactory 创建的后台线程中运行。

这是我之前和之后运行的Java代码,在相同的数据上没有这样的问题,所以在运行时发生了特定的事情

什么可能导致这个问题?

堆栈跟踪:

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.google.cloud.datastore.DatastoreException: com.google.apphosting.api.ApiProxy$ArgumentException: An error occurred parsing (locally or remotely) the arguments to URLFETCH.Fetch(). at com.google.cloud.datastore.DatastoreException.translateAndThrow(DatastoreException.java:66) at com.google.cloud.datastore.DatastoreImpl.runQuery(DatastoreImpl.java:97) at com.google.cloud.datastore.QueryResultsImpl.sendRequest(QueryResultsImpl.java:73) at com.google.cloud.datastore.QueryResultsImpl.<init>(QueryResultsImpl.java:57) at com.google.cloud.datastore.DatastoreImpl.run(DatastoreImpl.java:82) at com.google.cloud.datastore.DatastoreImpl.run(DatastoreImpl.java:73) at com.freightos.backup.datastore.gcloudapi.GCloudApiDSBackup.loadEntity(GCloudApiDSBackup.java:692) at com.freightos.backup.datastore.gcloudapi.GCloudApiDSBackup$CopyEntities.loadOneEntity(GCloudApiDSBackup.java:1104) ... 7 more Caused by: com.google.apphosting.api.ApiProxy$ArgumentException: An error occurred parsing (locally or remotely) the arguments to URLFETCH.Fetch(). at com.google.apphosting.vmruntime.VmApiProxyDelegate.convertApiResponseRpcErrorToException(VmApiProxyDelegate.java:397) at com.google.apphosting.vmruntime.VmApiProxyDelegate.convertRemoteError(VmApiProxyDelegate.java:341) at com.google.apphosting.vmruntime.VmApiProxyDelegate.runSyncCall(VmApiProxyDelegate.java:187) at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeApiCall(VmApiProxyDelegate.java:155) at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCallWithTimeout(VmApiProxyDelegate.java:143) at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCall(VmApiProxyDelegate.java:132) at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCall(VmApiProxyDelegate.java:75) at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:118) at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:40) at com.google.api.client.extensions.appengine.http.UrlFetchRequest.execute(UrlFetchRequest.java:74) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981) at com.google.datastore.v1.client.RemoteRpc.call(RemoteRpc.java:87) at com.google.datastore.v1.client.Datastore.runQuery(Datastore.java:108) at com.google.cloud.datastore.spi.DefaultDatastoreRpc.runQuery(DefaultDatastoreRpc.java:158) at com.google.cloud.datastore.DatastoreImpl$1.call(DatastoreImpl.java:93) at com.google.cloud.datastore.DatastoreImpl$1.call(DatastoreImpl.java:89) at com.google.cloud.RetryHelper.doRetry(RetryHelper.java:179) at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:244) at com.google.cloud.datastore.DatastoreImpl.runQuery(DatastoreImpl.java:88) ... 13 more

0 个答案:

没有答案