诊断GAE中的内部服务器错误

时间:2018-02-21 19:14:25

标签: python-2.7 google-app-engine internal-server-error

    Traceback (most recent call last):
      File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
        rv = self.handle_exception(request, response, e)
      File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
        rv = self.router.dispatch(request, response)
      File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
        return route.handler_adapter(request, response)
      File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
        return handler.dispatch()
      File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/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/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/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~dkc-app/20180221t133719.407817416956265792/manage/admin.py", line 13, in get
        applicants, applications = query.get_all_overview()
      File "/base/data/home/apps/s~dkc-app/20180221t133719.407817416956265792/manage/query.py", line 52, in get_all_overview
        applications = ndb.get_multi(application_keys)
      File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/ext/ndb/model.py", line 3931, in get_multi
        for future in get_multi_async(keys, **ctx_options)]
      File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/ext/ndb/model.py", line 3916, in get_multi_async
        return [key.get_async(**ctx_options) for key in keys]
    AttributeError: 'NoneType' object has no attribute 'get_async'

几周前这种情况突然发生,我无法弄清楚发生了什么。我最好的猜测是,更新gcloud组件会导致它,因为没有其他任何改变。

1 个答案:

答案 0 :(得分:2)

尝试改变:

applications = ndb.get_multi(application_keys)

applications = ndb.get_multi([key for key in application_keys if key])

看起来你的一个关键是None