[英]Google App Engine Java 11 - unclear errors com.google.apphosting.api.ApiProxy$CallNotFoundException
We are currently migrating our App Engine from Java 8 to Java 11 using the bundled services ( https://cloud.google.com/blog/products/serverless/support-for-app-engine-services-in-second-generation-runtimes ).我们目前正在使用捆绑服务( https://cloud.google.com/blog/products/serverless/support-for-app-engine-services-in-second-generation-)将我们的 App Engine 从 Java 8 迁移到 Java 11 运行时)。
We made it as far as that the application seems to be running as expected - BE, FE and Datastore all seem to work in our staging GCP project.我们做到了该应用程序似乎按预期运行 - BE、FE 和 Datastore 似乎都在我们的暂存 GCP 项目中工作。
The following errors are showing up in our logs every 10 seconds, however:但是,以下错误每 10 秒就会出现在我们的日志中:
Failed to query GCE metadata service
and then进而
java.io.IOException: com.google.apphosting.api.ApiProxy$CallNotFoundException: Can't make API call urlfetch.Fetch in a thread that is neither the original request thread nor a thread created by ThreadManager
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:70)
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.fetchResponse(URLFetchServiceStreamHandler.java:609)
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getInputStream(URLFetchServiceStreamHandler.java:488)
at com.google.devtools.cdbg.debuglets.java.GceMetadataQuery.readResponse(Unknown Source)
at com.google.devtools.cdbg.debuglets.java.GceMetadataQuery.queryMetadataAttribute(Unknown Source)
at com.google.devtools.cdbg.debuglets.java.GceMetadataQuery.getProjectId(Unknown Source)
at com.google.devtools.cdbg.debuglets.java.GcpHubClient.registerDebuggee(Unknown Source)
Caused by: com.google.apphosting.api.ApiProxy$CallNotFoundException: Can't make API call urlfetch.Fetch in a thread that is neither the original request thread nor a thread created by ThreadManager
at com.google.apphosting.api.ApiProxy$CallNotFoundException.foreignThread(ApiProxy.java:844)
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:117)
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:54)
... 6 more
Edit: The Cloud Debugger says "The debugger could not find a debug target for the application".编辑:云调试器说“调试器找不到应用程序的调试目标”。 The versions still relying on Java 8 work though, so what extra step is missing for the migration to set up the debugger correctly?
不过,这些版本仍然依赖 Java 8 工作,那么迁移正确设置调试器缺少什么额外步骤? As we're using the App Engine standard environment, that should be enabled by default ( https://cloud.google.com/debugger/docs/setup/java#gae-standard ).
由于我们使用的是 App Engine 标准环境,因此应默认启用 ( https://cloud.google.com/debugger/docs/setup/java#gae-standard )。
Edit 2: Looks like this could be a Google Cloud Debugger bug: https://github.com/GoogleCloudPlatform/cloud-debug-java/issues/18编辑 2:看起来这可能是 Google Cloud Debugger 错误: https : //github.com/GoogleCloudPlatform/cloud-debug-java/issues/18
As per the App Engine documentation regarding issuing HTTP requests , if you use URL Fetch, it will cause requests to cloud client libraries (and that includes the Google Cloud Debugger Client for Java) to fail.根据有关发出 HTTP 请求的App Engine 文档,如果您使用 URL Fetch,它将导致对云客户端库(包括 Google Cloud Debugger Client for Java)的请求失败。
As wer are using the bundled services, we are still using an appengine-web.xml
file.由于我们正在使用捆绑服务,我们仍在使用
appengine-web.xml
文件。
We had the following line in there:我们在那里有以下行:
<url-stream-handler>urlfetch</url-stream-handler>
Removing that line fixed the issue for us.删除该行为我们解决了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.