【发布时间】:2026-01-23 23:15:02
【问题描述】:
注意:这发生在我的开发服务器上(运行 Mojave 的 MAC)
我在 Google App Engine(标准环境)上运行 Python 3,我有以下代码
cursor = ndb.Cursor(urlsafe = next_page) if next_page else ndb.Cursor()
q = myObject.query(myObject.link == linkKey).order(-myObject.created)
resultsFuture = q.fetch_page_async(PAGE_SIZE,start_cursor=cursor)
如果 next_page 不是 None (这意味着 cursor 不是 None),我得到以下错误
Traceback (most recent call last):
File .../env/lib/python3.7/site-packages/google/cloud/ndb/_datastore_api.py", line 92, in rpc_call
result = yield rpc
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Error parsing protocol message"
debug_error_string = "{"created":"<CREATION_TIME>","description":"Error received from peer ipv6:<MY_IP_ADDRESS>","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"Error parsing protocol message","grpc_status":3}"
>
以前有没有人遇到过这种情况,如果有,解决办法是什么?
如果没有,谁能指出一个可能的解决方案?
【问题讨论】:
-
我已将此作为问题添加到 NDB 问题跟踪器:github.com/googleapis/python-ndb/issues/471
-
维护者有一些关于这个问题的问题
-
我该如何应对?我在 Github 上没有帐户.. next_page 只是一个变量,我用来保存从上一次调用 fetch_page_async 返回的“光标”的值
-
不用担心,我已经为您回复了。能否附上分配
next_page的代码? -
你能解决这个问题吗?我有同样的问题。我将它作为我的 HTML 页面中的 URL 传递
标签: google-app-engine google-cloud-platform app-engine-ndb google-app-engine-python