3

使用以下代码查询 ndb 实体时:

return cls.query(cls.name == name, cls.deleted == False).get()

开发服务器崩溃,我正在查询的实体突然从数据存储中消失。

我无法将此错误链接到我的代码中的任何奇怪之处,我可能做错了什么?

追溯:http --dev_appserver_log_level=debug: //pastebin.com/rnpJkYxT

追溯 :

Traceback (most recent call last):
  File "lib/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "lib/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "lib/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "lib/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/semion/Rolepoint/code/rolepoint-app/rolepoint/web/utils.py", line 188, in wrapped
    company = models.Company.find_by_rp_subdomain(subdomain)
  File "/Users/semion/Rolepoint/code/rolepoint-app/rolepoint/core/domain/models/company.py", line 51, in find_by_rp_subdomain
    cls.deleted == False).get()
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/ndb/query.py", line 1154, in get
    return self.get_async(**q_options).get_result()
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/ndb/tasklets.py", line 325, in get_result
    self.check_success()
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/ndb/tasklets.py", line 368, in _help_tasklet_along
    value = gen.throw(exc.__class__, exc, tb)
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/ndb/query.py", line 1167, in _get_async
    res = yield self.fetch_async(1, **q_options)
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/ndb/tasklets.py", line 368, in _help_tasklet_along
    value = gen.throw(exc.__class__, exc, tb)
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/ndb/query.py", line 921, in _run_to_list
    batch = yield rpc
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/ndb/tasklets.py", line 454, in _on_rpc_completion
    result = rpc.get_result()
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 604, in get_result
    return self.__get_result_hook(self)
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/datastore/datastore_query.py", line 2528, in __query_result_hook
    self._batch_shared.conn.check_rpc_success(rpc)
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/datastore/datastore_rpc.py", line 1222, in check_rpc_success
    rpc.check_success()
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 570, in check_success
    self.__rpc.CheckSuccess()
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/api/apiproxy_rpc.py", line 156, in _WaitImpl
    self.request, self.response)
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 200, in MakeSyncCall
    self._MakeRealSyncCall(service, call, request, response)
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 235, in _MakeRealSyncCall
    raise pickle.loads(response_pb.exception())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1382, in loads
    return Unpickler(file).load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1090, in load_global
    klass = self.find_class(module, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1124, in find_class
    __import__(module)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
  File "/Users/semion/.virtualenvs/rp/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 856, in load_module
    raise ImportError('No module named %s' % fullname)
ImportError: No module named _sqlite3
4

0 回答 0