我正在尝试将 Python 应用从 App Engine 标准环境移植到 App Engine 灵活环境。按照App Engine 文档中的说明,我将 app.yaml 文件更改为使用“python-compat”模式,如下所示:
service: default
runtime: python-compat
api_version: 1
vm: true
threadsafe: true
instance_class: F2
inbound_services:
- warmup
builtins:
- remote_api: on
env_variables:
GCLOUD_PROJECT: the-name-of-my-project
部署后,任何从应用程序调用数据存储的尝试(使用 NDB api)都会导致以下引用(截断):
File "/env/local/lib/python2.7/site-packages/google/appengine/datastore/datastore_rpc.py" in check_rpc_success
1371. rpc.check_success()
File "/env/local/lib/python2.7/site-packages/google/appengine/api/apiproxy_stub_map.py" in check_success
579. self.__rpc.CheckSuccess()
File "/env/local/lib/python2.7/site-packages/google/appengine/ext/vmruntime/vmstub.py" in _WaitImpl
312. raise self._ErrorException(*_DEFAULT_EXCEPTION)
Exception Type: RPCFailedError at /volume-list/
Exception Value: The remote RPC to the application server failed for call datastore_v3.RunQuery().
知道问题是什么吗?据我所知,App Engine 文档没有提供使用 python-compat 运行时设置 NDB 的特殊说明。