Google App Engine数据存储内部服务器错误(localhost)

时间:2016-08-19 07:04:25

标签: google-app-engine google-cloud-datastore

我正在为Google Data Store做一个标准的介绍教程,我在Ubuntu上本地运行。它起初工作但由于某些原因它停止工作并始终显示跟随错误。

如果我尝试访问数据或转到http://localhost:8000/datastore

,这就是我得到的

我尝试删除Google App Engine文件夹并重新加载它并尝试使用该命令清除数据。我没有想法了。有没有人遇到过这个问题?

Internal Server Error

The server has either erred or is incapable of performing the requested operation.

Traceback (most recent call last):
  File "/home/matthew/Project/google_appengine/lib/webapp2-2.5.1/webapp2.py", line 1536, in __call__
    rv = self.handle_exception(request, response, e)
  File "/home/matthew/Project/google_appengine/lib/webapp2-2.5.1/webapp2.py", line 1530, in __call__
    rv = self.router.dispatch(request, response)
  File "/home/matthew/Project/google_appengine/lib/webapp2-2.5.1/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/home/matthew/Project/google_appengine/lib/webapp2-2.5.1/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "/home/matthew/Project/google_appengine/google/appengine/tools/devappserver2/admin/admin_request_handler.py", line 96, in dispatch
    super(AdminRequestHandler, self).dispatch()
  File "/home/matthew/Project/google_appengine/lib/webapp2-2.5.1/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/home/matthew/Project/google_appengine/lib/webapp2-2.5.1/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "/home/matthew/Project/google_appengine/google/appengine/tools/devappserver2/admin/datastore_viewer.py", line 667, in get
    kinds = self._get_kinds(namespace)
  File "/home/matthew/Project/google_appengine/google/appengine/tools/devappserver2/admin/datastore_viewer.py", line 603, in _get_kinds
    return sorted([x.kind_name for x in q.run()])
  File "/home/matthew/Project/google_appengine/google/appengine/ext/db/__init__.py", line 2330, in next
    return self.__model_class.from_entity(self.__iterator.next())
  File "/home/matthew/Project/google_appengine/google/appengine/datastore/datastore_query.py", line 3321, in next
    next_batch = self.__batcher.next_batch(Batcher.AT_LEAST_OFFSET)
  File "/home/matthew/Project/google_appengine/google/appengine/datastore/datastore_query.py", line 3207, in next_batch
    batch = self.__next_batch.get_result()
  File "/home/matthew/Project/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result
    return self.__get_result_hook(self)
  File "/home/matthew/Project/google_appengine/google/appengine/datastore/datastore_query.py", line 2906, in __query_result_hook
    self._batch_shared.conn.check_rpc_success(rpc)
  File "/home/matthew/Project/google_appengine/google/appengine/datastore/datastore_rpc.py", line 1371, in check_rpc_success
    rpc.check_success()
  File "/home/matthew/Project/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 579, in check_success
    self.__rpc.CheckSuccess()
  File "/home/matthew/Project/google_appengine/google/appengine/api/apiproxy_rpc.py", line 157, in _WaitImpl
    self.request, self.response)
  File "/home/matthew/Project/google_appengine/google/appengine/datastore/datastore_sqlite_stub.py", line 971, in MakeSyncCall
    response, request_id)
  File "/home/matthew/Project/google_appengine/google/appengine/api/apiproxy_stub.py", line 131, in MakeSyncCall
    method(request, response)
  File "/home/matthew/Project/google_appengine/google/appengine/datastore/datastore_stub_util.py", line 2962, in UpdateIndexesWrapper
    self._SetupIndexes()
  File "/home/matthew/Project/google_appengine/google/appengine/datastore/datastore_stub_util.py", line 3438, in _SetupIndexes
    index_defs = datastore_index.ParseIndexDefinitions(index_text)
  File "/home/matthew/Project/google_appengine/google/appengine/datastore/datastore_index.py", line 208, in ParseIndexDefinitions
    return yaml_object.BuildSingleObject(IndexDefinitions, document)
  File "/home/matthew/Project/google_appengine/google/appengine/api/yaml_object.py", line 321, in BuildSingleObject
    definitions = BuildObjects(default_class, stream, loader)
  File "/home/matthew/Project/google_appengine/google/appengine/api/yaml_object.py", line 304, in BuildObjects
    listener.Parse(stream, loader)
  File "/home/matthew/Project/google_appengine/google/appengine/api/yaml_listener.py", line 227, in Parse
    self._HandleEvents(self._GenerateEventParameters(stream, loader_class))
  File "/home/matthew/Project/google_appengine/google/appengine/api/yaml_listener.py", line 178, in _HandleEvents
    raise yaml_errors.EventError(e, event_object)
EventError: Unable to assign value '5770237022568448' to attribute 'name':
Value 5770237022568448 for name is not of the expected type str
  in "<string>", line 17, column 11:
      - name: 5770237022568448

更新更多信息

这是我在交互式控制台上尝试时看到的内容: enter image description here 这是我在单击“数据存储查看器”,“数据存储区索引”或“Blobstore查看器”时看到的内容。

enter image description here

2 个答案:

答案 0 :(得分:3)

我想出了如何解决这个问题。

我意识到我的项目文件夹中有一个“index.yaml”,这就是它内部的内容。

indexes:

# AUTOGENERATED

# This index.yaml is automatically updated whenever the dev_appserver
# detects that a new type of query is run.  If you want to manage the
# index.yaml file manually, remove the above marker line (the line
# saying "# AUTOGENERATED").  If you want to manage some indexes
# manually, move them above the marker line.  The index.yaml file is
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.

- kind: Post
  ancestor: yes
  properties:
  - name: 5770237022568448
    direction: desc

在某些时候,我可能输入了一个不正确的查询记录。这导致我的数据存储区出错。删除此文件可以解决问题。

我不确定我做了什么样的查询导致这种情况发生。有点担心不正确的查询会永久破坏数据库。

答案 1 :(得分:0)

如果要清除数据存储区数据,可以转到应用的数据存储区管理员(云控制台&gt;数据存储区&gt;管理员)并从中删除您的实体。这可以解决这个问题,如果事实上你已经在创建了一些实体之后改变了你的数据模型,导致了不兼容的属性类型。