Home > 技 术 > Python > 关于micolog上传时的400错误

关于micolog上传时的400错误

2009年7月18日 字体大小 发表评论 阅读评论

自从出现了GAE,好多人开始使用它建立自己的个人博客,基于GAE的博客程序我们已经知道了好多,比较来看,我个人比较喜欢的是micolog程序,功能与WP十分相像,最值得一提的是支持XML备份数据的输出与导入。

0.5版本的micolog基本的功能已经很完美了,只是在上传的时候会遇到400的错误提示,类似这样:

Error 400: --- begin server output ---
Creating a composite index failed: This index:
entity_type: "Archive"
ancestor: false
Property {
  name: "date"
  direction: 2
}

is not necessary, since single-property indices are built in. Please remove it from your index file and upgrade to the latest version of the SDK, if you haven't already.
--- end server output ---

错误原因:开发阶段使用过一些对单属性的排序读取数据,由本地app server记下了查询历史,自动生成了这些索引。每次在本地运行该app时都会自动生成这个索引。新的SDK出来后不支持这些单属性的索引,上传出错。希望新版本的app engine SDK会解决这个问题。

解决方法:直接把index.yaml中自动产生的些单属性索引信息删除,就能上传正确。如果在本地运行调试过了,下次上传app时都要这么做。

那什么是单属性索引呢?举例,下面这一段有entry_parent、entrytype、published、menu_order等多个属性,是多属性索引。

# Used 6 times in query history.
- kind: Entry
  properties:
  - name: entry_parent
  - name: entrytype
  - name: published
  - name: menu_order

而以下这段就只有date一个属性,是单属性索引。

# Used 6 times in query history.
- kind: Comment
  properties:
  - name: date
    direction: desc

注意:不能把那些用到的两个以上属性的索引删除了,可能会出现上传成功,但浏览站点时得到的是500错误信息。

分类: Python 标签: , , 浏览679 次
声明: 本站内容遵循 署名-非商业性使用-禁止演绎 2.5 共享协议. 原创文章转载 请注明转自 守望的麦子

相关文章 随机文章 本月热评 热门标签