将应用程序移植到 App Engine 柔性环境后的数据存储区 RPCFailedError
Datastore RPCFailedError after porting an app to App Engine Flexible environment
我正在尝试将 Python 应用程序从 App Engine 标准环境移植到 App Engine 柔性环境。在 the directions in the App Engine documentation 之后,我将我的 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)调用数据存储的尝试都会导致以下引用(t运行cated):
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 运行-time 设置 NDB 的特殊说明。
我这周刚 运行 遇到这个错误,在调试它并使用 App Engine 支持后,找到了答案。
看我的,或者直接在appengine_config.py
中添加以下代码:
try:
import appengine.ext.vmruntime.vmstub as vmstub
except ImportError:
pass
else:
if isinstance(vmstub.DEFAULT_TIMEOUT, (int, long)):
# Newer requests libraries do not accept integers as header values.
# Be sure to convert the header value before sending.
# See Support Case ID 11235929.
vmstub.DEFAULT_TIMEOUT = bytes(vmstub.DEFAULT_TIMEOUT)
我正在尝试将 Python 应用程序从 App Engine 标准环境移植到 App Engine 柔性环境。在 the directions in the App Engine documentation 之后,我将我的 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)调用数据存储的尝试都会导致以下引用(t运行cated):
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 运行-time 设置 NDB 的特殊说明。
我这周刚 运行 遇到这个错误,在调试它并使用 App Engine 支持后,找到了答案。
看我的appengine_config.py
中添加以下代码:
try:
import appengine.ext.vmruntime.vmstub as vmstub
except ImportError:
pass
else:
if isinstance(vmstub.DEFAULT_TIMEOUT, (int, long)):
# Newer requests libraries do not accept integers as header values.
# Be sure to convert the header value before sending.
# See Support Case ID 11235929.
vmstub.DEFAULT_TIMEOUT = bytes(vmstub.DEFAULT_TIMEOUT)