uWSGI backtrace:严重错误错误

我在我的uWSGI日志中获得了以下回溯,我不知道从哪里开始寻找解决办法:

DAMN ! worker 5 (pid: 29056) died :( trying respawn ... Respawned uWSGI worker 5 (new pid: 29088) DAMN ! worker 6 (pid: 29080) died :( trying respawn ... Respawned uWSGI worker 6 (new pid: 29089) !!! uWSGI process 29089 got Segmentation Fault !!! *** backtrace of 29089 *** uwsgi(uwsgi_backtrace+0x2e) [0x468a9e] uwsgi(uwsgi_segfault+0x21) [0x468e61] /lib/x86_64-linux-gnu/libc.so.6(+0x36d40) [0x7f74aa424d40] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(_PyType_Lookup+0x19d) [0x7f74aa97572d] ... /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x7d30d) [0x7f74aa83130d] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f74aa8dde23] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x12e5f5) [0x7f74aa8e25f5] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f74aa8dde23] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x47) [0x7f74aa89c837] uwsgi(python_call+0x11) [0x47b011] uwsgi(uwsgi_request_wsgi+0x116) [0x47d206] uwsgi(wsgi_req_recv+0x8e) [0x41e64e] uwsgi(simple_loop_run+0xc4) [0x465084] uwsgi(uwsgi_ignition+0x194) [0x4690b4] uwsgi(uwsgi_worker_run+0x2dd) [0x46d88d] uwsgi(uwsgi_run+0x3b4) [0x46ddb4] uwsgi(_start+0) [0x41dd1e] *** end of backtrace *** 

我在Ubuntu 14.04 LTS上运行uWSGI 2.0.9以及django 1.7.4和nginx 1.6。 这是我的uWSGI应用程序configuration:

 module=project.wsgi:application socket=127.0.0.1:7001 pidfile=/tmp/project-master.pid master=True vacuum=True enable-threads=True disable-logging=True #limit-as=4096 # can cause problems with some application (especially on 64bit)? max-requests=8192 processes=12 listen=12000 idle = 3600 stats=127.0.0.1:1717 memory-report = True 

这是nginx的conf:

 worker_processes 8; # 12 cores worker_rlimit_nofile 100000; pid /var/run/nginx.pid; events { worker_connections 16384; use epoll; multi_accept on; } ... 

另外有时会出现以下错误:

 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__ response = self.get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 199, in get_response response = self.handle_uncaught_exception(request, resolver, sys.exc_info()) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 243, in handle_uncaught_exception return callback(request, **param_dict) File "./project/utils/utils.py", line 137, in error500 return error(request, status_code, description) File "./project/utils/utils.py", line 127, in error response = render(request, 'error.html.jinja', {'description': description }) File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py", line 50, in render return HttpResponse(loader.render_to_string(*args, **kwargs), File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 178, in render_to_string return t.render(context_instance) File "/usr/local/lib/python2.7/dist-packages/django_jinja/base.py", line 139, in render return super(Template, self).render(new_context) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 982, in render return self.environment.handle_exception(exc_info, True) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 746, in handle_exception reraise(exc_type, exc_value, tb) File "/var/www/pixabay/pixabay/project/templates/error.html.jinja", line 1, in top-level template code {% extends "base.html.jinja" %} File "/var/www/pixabay/pixabay/project/templates/base.html.jinja", line 37, in top-level template code {% spaceless %} File "./project/utils/templatetags/jinga2_extensions.py", line 61, in _strip_spaces return strip_spaces_between_tags(caller().strip()) File "/var/www/pixabay/pixabay/project/templates/base.html.jinja", line 51, in template {% if request.user.is_authenticated() %} File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 400, in getattr return getattr(obj, attribute) jinja2.exceptions.UndefinedError: 'django.core.handlers.wsgi.WSGIRequest object' has no attribute 'user' 

这个代码运行没有错误的6核心和Ubuntu的12.04 LTS的机器…任何想法将是伟大的…谢谢

这是由未绑定的写入引起的。 这个bug在1.0中修复,请升级https://pypi.python.org/pypi/xxtea/1.0

感谢报告这个问题。