1

在“后端”Google App Engine 柔性环境实例的后台线程中使用 Google Cloud API for Datastore 运行简单查询,我在几秒钟内多次尝试查询时遇到以下异常。

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

(有关堆栈跟踪,请参见下文。)

它与另一个错误同时出现

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 超时,例如 Web 请求的 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
4

0 回答 0