我最近访问了我的 App Engine 站点,该站点运行良好,没有错误,并得到了一个丑陋的错误页面。在管理工具 App Engine 中记录了此错误:
2012-09-06 10:53:43.938
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 189, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 227, in _LoadHandler
handler = __import__(path[0])
File "/base/data/home/apps/s~myapp/1.361555922666090832/main.py", line 3, in <module>
from controllers.routes import api_routes, web_routes, admin_routes
File "/base/data/home/apps/s~myapp/1.361555922666090832/controllers/routes/api_routes.py", line 3, in <module>
from ..api import api_obj_controller, api_app_controller, api_path_controller, api_user_controller
File "/base/data/home/apps/s~myapp/1.361555922666090832/controllers/api/api_obj_controller.py", line 2, in <module>
from ..handlers.api_handler import ApiRequestHandler
File "/base/data/home/apps/s~myapp/1.361555922666090832/controllers/handlers/api_handler.py", line 2, in <module>
from ..handlers.content_handler import BaseRequestHandler
File "/base/data/home/apps/s~myapp/1.361555922666090832/controllers/handlers/content_handler.py", line 3, in <module>
from webapp2_extras import jinja2
File "/base/data/home/apps/s~myapp/1.361555922666090832/webapp2_extras/jinja2.py", line 15, in <module>
import jinja2
File "/base/python27_runtime/python27_lib/versions/third_party/jinja2-2.6/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/base/python27_runtime/python27_lib/versions/third_party/jinja2-2.6/jinja2/environment.py", line 13, in <module>
from jinja2 import nodes
ImportError: cannot import name nodes
W 2012-09-06 10:53:43.967
After handling this request, the process that handled this request was found to have handled too many sequential errors, and was terminated. This is likely to cause a new process to be used for the next request to your application. If you see this message frequently, you are likely returning errors continously from your application.
因此它继续出现许多错误,但随后又开始工作而没有发布任何新代码。我的担忧显然是将来如何防止这种情况发生?为什么会这样?如果我不部署任何代码修复程序,它怎么可能自我纠正?这个错误让我担心它会随机发生在我的客户身上。
编辑:
此外,我收到的第一个错误是 DeadlineExceededError 错误,其中包括消息“此请求导致为您的应用程序启动一个新进程,因此导致您的应用程序代码首次加载。因此,此请求可能需要比应用程序的典型请求更长且使用更多 CPU。”
因此,从这条消息和蒂姆评论的内容来看,这是完全有道理的,但是我该如何解决它以使其不再发生?我该怎么做才能使 DeadlineExceededError 在启动新实例之前基本上不会出错整个站点?(也就是说,如果我理解正确的话)