我们目前正在使用捆绑服务将我们的应用程序引擎从Java 8迁移到Java 11(
https://cloud.google.com/blog/products/serverless/support-for-app-engine-services-in-second-generation-runtimes
).
我们做到了应用程序似乎按预期运行的程度——be、FE和数据存储似乎都在我们的阶段性GCP项目中工作。
然而,以下错误每10秒就会出现在我们的日志中:
Failed to query GCE metadata service
然后
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
编辑:
云调试器表示“调试器无法找到应用程序的调试目标”。不过,这些版本仍然依赖于Java 8,所以迁移还缺少什么额外的步骤来正确设置调试器呢?因为我们使用的是App Engine标准环境,所以默认情况下应该启用它(
https://cloud.google.com/debugger/docs/setup/java#gae-standard
).
编辑2:
看起来这可能是谷歌云调试器的错误:
https://github.com/GoogleCloudPlatform/cloud-debug-java/issues/18