App Engine AttributeError:'module'对象没有属性'events'

时间:2012-10-05 20:05:27

标签: google-app-engine

我在同一个实例上有20次这个错误,然后由于处理过多的顺序错误而导致实例被杀死后它就消失了。我的代码没有变化,这是我见过这种情况的唯一时间。

问题:

  • 我的代码中的哪种类型的问题可能导致仅在某些情况下发生这种情况?我不知道从哪里开始寻找,因为我无法重现问题。
  • 有没有办法减少实例在被杀之前允许的连续错误的数量,这样如果它再次发生就不会造成很大的中断?

这是我从这个实例获得的第一个日志(没有错误):

2012-10-05 18:41:03.266 /rpc/?action=ServerAvailable 500 60908ms 0kb popwords/1.2         CFNetwork/548.1.4 Darwin/11.4.2
98.207.195.103 - - [05/Oct/2012:11:41:03 -0700] "GET /rpc/?action=ServerAvailable HTTP/1.1" 500 0 - "popwords/1.2 CFNetwork/548.1.4 Darwin/11.4.2" "www.popwordsapp.appspot.com" ms=60909 cpu_ms=498 loading_request=1 instance=00c61b117c8f8b7f701c0776284c25a64c7ff329
I 2012-10-05 18:41:03.265
This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

这是此实例的下一个日志(第一个有错误的日志):

2012-10-05 18:49:38.704 /rpc/?action=ServerAvailable 500 867ms 0kb popwords/1.2 CFNetwork/548.1.4 Darwin/11.4.2
98.207.195.103 - - [05/Oct/2012:11:49:38 -0700] "GET /rpc/?action=ServerAvailable HTTP/1.1" 500 0 - "popwords/1.2 CFNetwork/548.1.4 Darwin/11.4.2" "www.popwordsapp.appspot.com" ms=867 cpu_ms=86 instance=00c61b117c8f8b7f701c0776284c25a64c7ff329
E 2012-10-05 18:49:38.103
Traceback (most recent call last):
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 195, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 239, in _LoadHandler
handler = __import__(path[0])
  File "/base/data/home/apps/s~popwordsapp/1.362183705604897547/main.py", line 40, in <module>
from google.appengine.ext import db
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 98, in <module>
from google.appengine.api import datastore
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/datastore.py", line 62, in <module>
from google.appengine.datastore import datastore_query
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/datastore/datastore_query.py", line 64, in <module>
from google.appengine.datastore import datastore_index
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/datastore/datastore_index.py", line 62, in <module>
from google.appengine.api import yaml_object
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/yaml_object.py", line 36, in <module>
from google.appengine.api import yaml_listener
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/yaml_listener.py", line 34, in <module>
    yaml.events.StreamStartEvent: 'StreamStart',
AttributeError: 'module' object has no attribute 'events'

在这两个日志之间有一个日志,其中创建了一个额外的实例(没有错误)。没有错误来自在第一个实例之后立即创建的另一个实例。由于处理了太多的顺序错误,它在第一个实例被杀死后成功处理了请求。

1 个答案:

答案 0 :(得分:0)

我在部署代码后偶尔会看到此错误,并且重新部署通常会停止它。我知道,这并不是那么有用,但希望谷歌能尽快解决这个问题。