GAE上传web app出现索引错误

五月 12th, 2009 发表评论 阅读评论

最近上传google app engine时可能遇到的下面的错误。

Error 400: --- begin server output ---
Creating a composite index failed: An index may not be comprised of a
 single repeated property. Your query probably doesn't need this 
index. Try without it!

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

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

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

注:转载请注明出处http://www.kgblog.net 

分类: GAE相关 标签: GAE  app engine  (2539次阅读)

  1. 也问
    2009-07-12 at 12:59
    如果程序是micolog,那么它的index.yaml应该如何改才不会出现上面提到的错误呢?我一点也不懂程序,兄弟能否把修改过的这个代码给贴出来呢?在此先谢过了。
  2. 2009-07-12 at 16:17
    代码太长了,比如下面就是一个索引:
    # Used 16 times in query history.
    - kind: Comment
      properties:
      - name: date
        direction: desc
    其中一个name表示一个属性,只要把这种只有一个name的索引删除就行了。有两个或以上个name的索引保留。
    如果你删错了也不怕,本地测试一下系统又会生成一个新的index.yaml。
  3. good
    2009-09-26 at 21:20
    ok,谢谢提供解决方法!
  4. 2009-10-19 at 11:21
    博主,请教下,上传后是HTTP 500错误,但是也不知道怎么个性代码,不知麻烦你可不可以把个性好的代码发一份给谢谢了!hsmick#gmail.com
  5. 2010-05-22 at 13:36
    谢谢,学习了
  6. 孙东博
    2010-07-11 at 23:03
    本想做下代理,对py不了解,但是在上传fetchserver时出现了400错误。代码如下:


    # Used 18 times in query history.
    - kind: AccessDestination
      properties:
     - name: counter
        direction: desc

    # Used 15 times in query history.
    - kind: AccessFrom
      properties:
      - name: counter
        direction: desc
    因为看到楼主的单属性和双属性看的不是太清楚,错误代码如下:
     Error 400: --- begin server output ---
    Creating a composite index failed: This index:
    entity_type: "AccessDestination"
    ancestor: false
    Property {
      name: "counter"
      direction: 2
    }

    求详细解决方法,希望楼主能看见
  7. 孙东博
    2010-07-11 at 23:03
    本想做下代理,对py不了解,但是在上传fetchserver时出现了400错误。代码如下:


    # Used 18 times in query history.
    - kind: AccessDestination
      properties:
     - name: counter
        direction: desc

    # Used 15 times in query history.
    - kind: AccessFrom
      properties:
      - name: counter
        direction: desc
    因为看到楼主的单属性和双属性看的不是太清楚,错误代码如下:
     Error 400: --- begin server output ---
    Creating a composite index failed: This index:
    entity_type: "AccessDestination"
    ancestor: false
    Property {
      name: "counter"
      direction: 2
    }

    求详细解决方法,希望楼主能看见
  8. 孙东博
    2010-07-11 at 23:03
    本想做下代理,对py不了解,但是在上传fetchserver时出现了400错误。代码如下:


    # Used 18 times in query history.
    - kind: AccessDestination
      properties:
     - name: counter
        direction: desc

    # Used 15 times in query history.
    - kind: AccessFrom
      properties:
      - name: counter
        direction: desc
    因为看到楼主的单属性和双属性看的不是太清楚,错误代码如下:
     Error 400: --- begin server output ---
    Creating a composite index failed: This index:
    entity_type: "AccessDestination"
    ancestor: false
    Property {
      name: "counter"
      direction: 2
    }

    求详细解决方法,希望楼主能看见
  9. 孙东博
    2010-07-11 at 23:03
    本想做下代理,对py不了解,但是在上传fetchserver时出现了400错误。代码如下:


    # Used 18 times in query history.
    - kind: AccessDestination
      properties:
     - name: counter
        direction: desc

    # Used 15 times in query history.
    - kind: AccessFrom
      properties:
      - name: counter
        direction: desc
    因为看到楼主的单属性和双属性看的不是太清楚,错误代码如下:
     Error 400: --- begin server output ---
    Creating a composite index failed: This index:
    entity_type: "AccessDestination"
    ancestor: false
    Property {
      name: "counter"
      direction: 2
    }

    求详细解决方法,希望楼主能看见
  10. 孙东博
    2010-07-11 at 23:04
    晕,网速慢,多点了几下,没想到....