python - Google App Engine 永远出现 NeedIndexError

标签 python google-app-engine

几个小时前,我在 GAE 部署并运行了我的应用程序。它仍然失败,因为它需要订购某些数据存储项,而 GAE 仍然没有生成所需的索引。因此,在 .order() 处,它会抛出一个 NeedIndexError 。这需要多长时间?

过去,我一直在对 10 个 GAE 应用程序执行相同的过程,据我内存,它从未如此缓慢。 (好吧,速度有点慢……)

  • 旧控制台中的“数据存储索引”页面仅显示“您尚未为此应用程序创建索引。”。
  • 新控制台什么也没说。它只是显示“蓝色警报”,就好像我还没有等死一样。警报中的消息是:

Cloud Datastore queries are powered by indexes, scalable data structures that are updated in real time as property values change. Your project's datastore index configuration specifies the indexes it needs to support its queries. Cloud Datastore builds new indexes as needed when you deploy index configuration. You can inspect the ready state of your app's indexes using this console.

(即一个笑话)

我该怎么办?

更新:

这是index.yaml:

indexes:

# AUTOGENERATED

- kind: Mjquizinfo
  ancestor: yes
  properties:
  - name: version
    direction: desc

最佳答案

FWIW,在某些情况下(例如多模块应用程序),用于部署应用程序代码的普通 appcfg.py 更新可能不会更新索引.yaml 文件。

尝试specifically updating the index使用 appcfg.py update_indexes - 您应该能够立即在开发者控制台中看到索引信息(索引可能仍需要一段时间才能执行并生效)。

关于python - Google App Engine 永远出现 NeedIndexError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33388390/

相关文章:

python - 使用 SqlAlchemy 和 Id 为 PostgreSQL 创建夹具数据

Python 在定义时取消引用闭包变量

php - Flex 应用程序引擎 mongoDb

python - Mechanize 不适用于在 Google Appengine 中自动登录 gmail

python - 从登录我的 GAE 应用程序的用户发送电子邮件

python |如何针对命令行界面 (CLI) 进行人体测试

python - 从 python 中的文件读取时删除空格和逗号

python - 递归添加到集合

python-3.x - 新应用引擎应用的 Python 3.7 本地开发服务器选项

google-app-engine - App Engine 接受编码