[Mon Dec 12 10:45:23 2016] [error] [client 178.161.91.227] (70007)The timeout specified has expired: mod_wsgi (pid=941): Unable to get bucket brigade for request.
[Mon Dec 12 10:45:23 2016] [error] Internal Server Error: /profile/
[Mon Dec 12 10:45:23 2016] [error] Traceback (most recent call last):
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
[Mon Dec 12 10:45:23 2016] [error] response = self.process_exception_by_middleware(e, request)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
[Mon Dec 12 10:45:23 2016] [error] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
[Mon Dec 12 10:45:23 2016] [error] return view_func(*args, **kwargs)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
[Mon Dec 12 10:45:23 2016] [error] return self.dispatch(request, *args, **kwargs)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/rest_framework/views.py", line 466, in dispatch
[Mon Dec 12 10:45:23 2016] [error] response = self.handle_exception(exc)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/rest_framework/views.py", line 463, in dispatch
[Mon Dec 12 10:45:23 2016] [error] response = handler(request, *args, **kwargs)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/projects/capstone/app/views.py", line 258, in get
[Mon Dec 12 10:45:23 2016] [error] pk = request.data.get('pk', None)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/rest_framework/request.py", line 353, in __getattribute__
[Mon Dec 12 10:45:23 2016] [error] return super(Request, self).__getattribute__(attr)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/rest_framework/request.py", line 183, in data
[Mon Dec 12 10:45:23 2016] [error] self._load_data_and_files()
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/rest_framework/request.py", line 243, in _load_data_and_files
[Mon Dec 12 10:45:23 2016] [error] self._data, self._files = self._parse()
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/rest_framework/request.py", line 289, in _parse
[Mon Dec 12 10:45:23 2016] [error] parsed = parser.parse(stream, media_type, self.parser_context)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/rest_framework/parsers.py", line 66, in parse
[Mon Dec 12 10:45:23 2016] [error] data = stream.read().decode(encoding)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/django/http/request.py", line 322, in read
[Mon Dec 12 10:45:23 2016] [error] six.reraise(UnreadablePostError, UnreadablePostError(*e.args), sys.exc_info()[2])
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/django/http/request.py", line 320, in read
[Mon Dec 12 10:45:23 2016] [error] return self._stream.read(*args, **kwargs)
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 47, in read
[Mon Dec 12 10:45:23 2016] [error] result = self.buffer + self._read_limited()
[Mon Dec 12 10:45:23 2016] [error] File "/sites/virtualenvs/capstone/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 41, in _read_limited
[Mon Dec 12 10:45:23 2016] [error] result = self.stream.read(size)
[Mon Dec 12 10:45:23 2016] [error] UnreadablePostError: request data read error
[Mon Dec 12 10:45:23 2016] [error] [client 178.161.91.227] mod_wsgi (pid=937): Exception occurred processing WSGI script '/sites/projects/capstone/project/wsgi.py'.
[Mon Dec 12 10:45:23 2016] [error] [client 178.161.91.227] IOError: failed to write data
[Mon Dec 12 14:18:18 2016] [error] Not Found: /
[Mon Dec 12 20:15:04 2016] [error] Not Found: /etc/lib/pChart2/examples/index.php
[Tue Dec 13 07:01:55 2016] [error] Not Found: /
[Tue Dec 13 07:01:55 2016] [error] Not Found: /
[Tue Dec 13 07:14:10 2016] [error] Not Found: /
[Tue Dec 13 07:14:11 2016] [error] Not Found: /
[Tue Dec 13 07:39:17 2016] [error] Not Found: /
这是我在服务器中的error_log的最新部分。此错误随机弹出(我无法看到模式)。我研究了一吨,无法找到解决方案,尝试了无数的谷歌搜索,没有真正有用的东西。有点工作然后停止工作的一件事是改变" Timeout"在apache配置文件中并增加它,它现在为600.它解决了当时的问题,然后问题又回来了。我第一次遇到它时,我更改了Django代码中的URI端点和视图函数的名称,但保留了相同的旧代码,问题就消失了。但它后来又回来了。
我使用Django == 1.9.6和MySQL-python == 1.2.5和Apache / 2.2.22(Ubuntu 12.04 LTS x86_64 Minimal)
以下是访问日志中导致此错误弹出的条目。
178.161.91.227 - - [12/Dec/2016:10:45:13 +0000] "GET /profile/ HTTP/1.1" 500 637 "-" "Capstone-Project/1.0 (alebrahim.Capstone-Project; build:1; iOS 10.1.0) Alamofire/4.1.0"
我不知道还有什么相关内容,如果有任何需要的信息我会在这里添加。
编辑:我们注意到只有在Alamofire请求将请求对象编码为JSON时才会出现此问题。如果它没有编码,这个问题就会消失。
答案 0 :(得分:0)
这两个错误都是由HTTP客户端在请求完成之前删除连接引起的。这可能导致请求主体被截断,从而导致读取错误,或者在连接已关闭时发生写入错误。发生这种情况是很正常的,你的应用程序中没有任何东西可以阻止它,因为它是由用户在另一端的故意行为引起的,或者可能是两者之间的网络问题。