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

Python Google云端点:将v1迁移到v2在发现调用中出错,python,google-app-engine,google-cloud-platform,google-cloud-endpoints,google-cloud-endpoints-v2,Python,Google App Engine,Google Cloud Platform,Google Cloud Endpoints,Google Cloud Endpoints V2,我们正在使用以下google文档将google云端点v1迁移到v2 部署迁移版本后出现以下错误 “RuntimeError:tasklet不应产生普通值” 这是完整的回溯 Traceback (most recent call last): File "/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/runtime/

我们正在使用以下google文档将google云端点v1迁移到v2

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

“RuntimeError: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"
回溯(最近一次呼叫最后一次):
文件“/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py”,第267行,在Handle中
结果=处理程序(dict(自我环境)、自我启动响应)
文件“/base/alloc/tmpfs/dynamic_运行时/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py”,第1108行,添加上下文包装器
返回synctaskletfunc(*args,**kwds)
synctasklet包装中的文件“/base/alloc/tmpfs/dynamic_运行时/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py”,第1087行
返回taskletfunc(*args,**kwds).get_result()
文件“/base/alloc/tmpfs/dynamic_运行时/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py”,第383行,在get_结果中
self.check_success()
文件“/base/alloc/tmpfs/dynamic_运行时/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py”,第378行,检查是否成功
self.wait()
文件“/base/alloc/tmpfs/dynamic_运行时/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py”,第362行,正在等待
如果不是ev.run1():
文件“/base/alloc/tmpfs/dynamic_运行时/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/eventloop.py”,第268行,在run1中
delay=self.run0()
文件“/base/alloc/tmpfs/dynamic_runtimes/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/eventloop.py”,第230行,在run0中
回调(*args,**kwds)
文件“/base/alloc/tmpfs/dynamic_运行时/python27g/7894e0c59273b2b7/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py”,第509行,在“帮助”小任务中
“%.200s产生%.200r%”(信息,值))
RuntimeError:tasklet不应产生普通值:初始生成器调用(endpoints\u dispatcher.py:128)产生了{\n“auth”:{\n“oauth2”:{\n“scopes”:{}\n}\n}、\n“basePath”:“,\n“baseUrl”:”https://.appspot.com/,\n“批路径”:“批”
我已经尝试了一些东西,比如,我知道有些尝试是不符合逻辑的,但尽管尝试过

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

如果有人面临类似问题,请帮助我。

这是由于ndb库与WSGI规范不兼容造成的。您应该向该库的支持团队报告这一情况