热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

django+uwsgi上传大文件失败

uwsgi的log是这样的

uwsgi的log是这样的



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[uwsgi-body-read] Error reading 49152 bytes. Content-Length: 14582139 consumed: 6373376 left: 8208763 message: Client closed connection

Internal Server Error: /temrule/uploadocrpdf/

Traceback (most recent call last):

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/request.py", line 331, in read

    return self._stream.read(*args, **kwargs)

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 53, in read

    result = self.buffer + self._read_limited(size - len(self.buffer))

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 41, in _read_limited

    result = self.stream.read(size)

OSError: error during read(65536) on wsgi.input



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner

    respOnse= get_response(request)

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response

    respOnse= self.process_exception_by_middleware(e, request)

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response

    respOnse= wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/home/serverend/comengine/templaterule/views/ocrpdf_views.py", line 51, in upload_ocr_pdf

    sessiOnid= request.POST.get('sessionid')

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 126, in _get_post

    self._load_post_and_files()

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/request.py", line 299, in _load_post_and_files

    self._post, self._files = self.parse_file_upload(self.META, data)

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/request.py", line 258, in parse_file_upload

    return parser.parse()

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/multipartparser.py", line 238, in parse

    for chunk in field_stream:

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/multipartparser.py", line 384, in __next__

    output = next(self._producer)

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/multipartparser.py", line 517, in __next__

    for bytes in stream:

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/multipartparser.py", line 384, in __next__

    output = next(self._producer)

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/multipartparser.py", line 448, in __next__

    data = self.flo.read(self.chunk_size)

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/http/request.py", line 333, in read

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 53, in read

    result = self.buffer + self._read_limited(size - len(self.buffer))

  File "/home/yangtao/miniconda3/envs/compoengine/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 41, in _read_limited

    result = self.stream.read(size)

django.http.request.UnreadablePostError: error during read(65536) on wsgi.input

Fri Jan  5 19:25:45 2018 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /temrule/uploadocrpdf/ (ip 192.168.10.3) !!!

Fri Jan  5 19:25:45 2018 - uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 331] during POST /temrule/uploadocrpdf/ (192.168.10.3)

OSError: write error

这是怎么回事?怎么解决?


   



推荐阅读
author-avatar
乌鸦晕倒_767
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有