Google 云端点:将 v1 迁移到 v2 在发现调用中出错



我们正在使用以下谷歌文档将 google cloud endpoint v1 迁移到 v2。

https://cloud.google.com/endpoints/docs/frameworks/python/migrating

部署迁移版本后出现以下错误。

"运行时错误:tasklet 不应生成纯值">

这是完整的回溯。

Traceback (most recent call last):
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 267, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 1108, in add_context_wrapper
return synctaskletfunc(*args, **kwds)
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 1087, in synctasklet_wrapper
return taskletfunc(*args, **kwds).get_result()
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 383, in get_result
self.check_success()
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 378, in check_success
self.wait()
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 362, in wait
if not ev.run1():
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/eventloop.py", line 268, in run1
delay = self.run0()
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/eventloop.py", line 230, in run0
callback(*args, **kwds)
File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 509, in _help_tasklet_along
'%.200s yielded %.200r' % (info, value))
RuntimeError: A tasklet should not yield a plain value: initial generator __call__(endpoints_dispatcher.py:128) yielded '{n  "auth": {n    "oauth2": {n      "scopes": {}n    }n  },n  "basePath": "<APINAME>",n  "baseUrl": "https://<<PROJECTNAME>>.appspot.com/<APINAME>",n  "batchPath": "batch"

我已经尝试了一些事情,例如,我知道有些尝试不合逻辑,但尽管尝试过。

  • 使用 gcloud 和 appcfg.py 进行部署
  • 删除了所有旧版本并部署新版本
  • 生成新的发现文档并部署
  • 生成 openapi 服务 json 并部署新服务。

是否有人面临类似的问题,请帮助我。

这是由于ndb库与WSGI规范不兼容引起的。您应该将此报告给该库的支持团队。

最新更新