Python Google App Engine内部服务器错误

时间:2016-06-20 16:52:16

标签: python google-app-engine

我是app引擎的新手,并尝试部署python应用程序。当我在本地主机上预览时,该应用程序正常工作,但当我部署它时,我收到以下错误:"内部服务器错误

服务器出错或无法执行请求的操作。"

并追溯:

Traceback (most recent call last):   
   File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)   
   File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)   
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
File "/base/data/home/apps/s~ecd-signup/20160620t104611.393644814392119591/hpvball.py", line 78, in get
    entries_c = qry_c.fetch(100)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/utils.py", line 160, in positional_wrapper
    return wrapped(*args, **kwds)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/query.py", line 1203, in fetch
    return self.fetch_async(limit, **q_options).get_result()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 383, in get_result
    self.check_success()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 427, in _help_tasklet_along
    value = gen.throw(exc.__class__, exc, tb)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/query.py", line 980, in _run_to_list
    batch = yield rpc
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 513, in _on_rpc_completion
    result = rpc.get_result()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result
    return self.__get_result_hook(self)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2921, in __query_result_hook
    yaml_index=yaml, xml_index=xml) 

NeedIndexError: no matching index found. recommended index is:
  - kind: Entry
    ancestor: yes   
properties:
  - name: committed
  - name: date

The suggested index for this query is:
- kind: Entry
  ancestor: yes
properties:
  - name: committed
  - name: date

1 个答案:

答案 0 :(得分:1)

如果这是应用程序的新/最近部署,则新添加/修改的索引仍然可以构建,条件是暂时的,最终会消失。请参阅此答案:https://stackoverflow.com/a/29807764/4495081

在某些情况下,本地开发服务器不会自动生成建议的索引。检查本地索引文件中是否存在建议的索引。如果遗漏,请手动添加。

在某些情况下(例如某些多模块应用程序),应用程序部署也不会自动上载本地应用程序索引文件。如果开发人员控制台中显示的索引与您在本地索引文件中看到的索引不匹配,则应使用update_indexes appcfg.py选项明确部署它们。