error with client disconnection when uploading files, stuck!

96 views
Skip to first unread message

Iain Duncan

unread,
Apr 25, 2013, 1:42:56 PM4/25/13
to pylons-...@googlegroups.com
Hi folks, I have a custom file uploading utility in a pyramid app, and it's using an older version of webob, 1.1 to be precise. I'm getting the following when uploading a large file, and it seems from the web ob docs that this should be OK in webob 1.1. I also read some mention that it might be a server issue, but I get the same problem whether hitting paster or modwsgi. Not really sure where to look to deal with it and wondering if anyone else has had a similar issue and can comment? 

Thanks!
Iain


Exception happened during processing of request from ('127.0.0.1', 33105)
1101 Traceback (most recent call last):
1102   File "/home/jordans/Jordans/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 1068, in process_request_in_thread
1103     self.finish_request(request, client_address)
1104   File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
1105     self.RequestHandlerClass(request, client_address, self)
1106   File "/usr/lib/python2.7/SocketServer.py", line 638, in __init__
1107     self.handle()
1108   File "/home/jordans/Jordans/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 442, in handle
1109     BaseHTTPRequestHandler.handle(self)
1110   File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
1111     self.handle_one_request()
1112   File "/home/jordans/Jordans/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 437, in handle_one_request
1113     self.wsgi_execute()
1114   File "/home/jordans/Jordans/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 287, in wsgi_execute
1115     self.wsgi_start_response)
1116   File "/home/jordans/Jordans/eggs/pyramid-1.1-py2.7.egg/pyramid/router.py", line 161, in __call__
1117     response = view_callable(context, request)
1118   File "/home/jordans/Jordans/eggs/pyramid-1.1-py2.7.egg/pyramid/config.py", line 3020, in _secured_view
1119     return view(context, request)
1120   File "/home/jordans/Jordans/eggs/pyramid-1.1-py2.7.egg/pyramid/config.py", line 3123, in rendered_view
1121     result = view(context, request)
1122   File "/home/jordans/Jordans/eggs/pyramid-1.1-py2.7.egg/pyramid/config.py", line 3220, in _class_view
1123     response = inst()
1124   File "/home/jordans/Jordans/framework_src/xornot.cms/xornot/cms/views/upload.py", line 83, in __call__
1125     self.post()
1126   File "/home/jordans/Jordans/framework_src/xornot.dram/xornot/dram/views/__init__.py", line 560, in post
1127     self.post_values = self.request.POST
1128   File "/home/jordans/Jordans/eggs/WebOb-1.1-py2.7.egg/webob/request.py", line 573, in POST
1129     vars = self._str_POST
1130   File "/home/jordans/Jordans/eggs/WebOb-1.1-py2.7.egg/webob/request.py", line 558, in _str_POST
1131     keep_blank_values=True)
1132   File "/usr/lib/python2.7/cgi.py", line 508, in __init__
1133     self.read_multi(environ, keep_blank_values, strict_parsing)
1134   File "/usr/lib/python2.7/cgi.py", line 637, in read_multi
1135     environ, keep_blank_values, strict_parsing)
1136   File "/usr/lib/python2.7/cgi.py", line 510, in __init__
1137     self.read_single()
1138   File "/usr/lib/python2.7/cgi.py", line 647, in read_single
1139     self.read_lines()
1140   File "/usr/lib/python2.7/cgi.py", line 669, in read_lines
1141     self.read_lines_to_outerboundary()
1142   File "/usr/lib/python2.7/cgi.py", line 697, in read_lines_to_outerboundary
1143     line = self.fp.readline(1<<16)
1144   File "/home/jordans/Jordans/eggs/WebOb-1.1-py2.7.egg/webob/request.py", line 1292, in readline
1145     self._check_disconnect()
1146   File "/home/jordans/Jordans/eggs/WebOb-1.1-py2.7.egg/webob/request.py", line 1311, in _check_disconnect
1147     + "(%d more bytes were expected)" % self.remaining
1148 DisconnectionError: The client disconnected while sending the POST/PUT body (601187 more bytes were expected)

Mariano Mara

unread,
Apr 25, 2013, 1:50:34 PM4/25/13
to pylons-...@googlegroups.com


On 04/25/2013 02:42 PM, Iain Duncan wrote:
> Hi folks, I have a custom file uploading utility in a pyramid app, and
> it's using an older version of webob, 1.1 to be precise. I'm getting the
> following when uploading a large file, and it seems from the web ob docs
> that this should be OK in webob 1.1. I also read some mention that it
> might be a server issue, but I get the same problem whether hitting
> paster or modwsgi. Not really sure where to look to deal with it and
> wondering if anyone else has had a similar issue and can comment?
>
> Thanks!
> Iain
>
>
> Exception happened during processing of request from ('127.0.0.1', 33105)
> "/home/jordans/Jordans/eggs/WebOb-1.1-py2.7.egg/webob/request.py", line
> 1311, in _check_disconnect
> 1147 + "(%d more bytes were expected)" % self.remaining
> 1148 DisconnectionError: The client disconnected while sending the
> POST/PUT body (601187 more bytes were expected)
>

So far I have not detected this error as the fault of a particular piece
of software in the framework stack.

I have seen this error if the user who is uploading the file navigates
away, retry the submit or similar actions without waiting for the upload
to finish.
In those cases, some clear indication for the user about the progress of
the action (or maybe blocking some actions with js) should help to
prevent the impatience. Other than that, a clear message for the user to
let them know the upload was unsuccessful should be of help too.

I guess a network problem on the user side might trigger this error too
but so far I didn't particularly test it.

Jonathan Vanasco

unread,
Apr 25, 2013, 4:38:47 PM4/25/13
to pylons-...@googlegroups.com
Is this happening only on linux or is it happening on other os's ?   if you can make a short reproduceable example, i can test on osx for you.  

i'm only noting that because i've run into problems before where beautifulsoup died on large files in linux , but worked fine on osx.  there ended up being a bug upstream in a library.

Iain Duncan

unread,
Apr 30, 2013, 1:55:29 PM4/30/13
to pylons-...@googlegroups.com
Thanks guys. It happened with a large file when I tested it on linux and when the client tested it on windows. 

I'll try replicating on various machines and browsers to see if that's the issue.

iain


On Thu, Apr 25, 2013 at 1:38 PM, Jonathan Vanasco <jona...@findmeon.com> wrote:
Is this happening only on linux or is it happening on other os's ?   if you can make a short reproduceable example, i can test on osx for you.  

i'm only noting that because i've run into problems before where beautifulsoup died on large files in linux , but worked fine on osx.  there ended up being a bug upstream in a library.

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jonathan Vanasco

unread,
Apr 30, 2013, 5:20:19 PM4/30/13
to pylons-...@googlegroups.com
if it happened on linux+windows, then it's probably not an issue with the environment.
Reply all
Reply to author
Forward
0 new messages