I am trying to play a video on an iOS device. When I tried to play i got the following error:
[27/Apr/2015 06:59:30] "GET /media/2015/04/VID_20150327_112644.mp4 HTTP/1.1" 200 18
Exception happened during processing of request from ('192.168.1.230', 51412)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/home/likewise-open/ZEALOUSYS/manesh/virtualenv/tracks/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 129, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 279, in close
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
Exception happened during processing of request from ('192.168.1.230', 51412)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/home/likewise-open/ZEALOUSYS/manesh/virtualenv/tracks/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 129, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 279, in close
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
The video file of all formats is working perfectly in all browsers and Android devices. When I try to access it from an iOS device. It gives me the above error. As you can see in error, first it is giving me response as 200 and then there is broken pipe. What does this broken pipe even mean? Just FYI, I have already posted a question stating that I can't play video on iOS devices, I am now posting a new question because I found this error in my terminal.
How do i fix this issue? Any help is appreciated.
This is beacause django is handling your media files not apache.Try by changing you configuration in server.
For example inside your apache2 edit example.com.conf file add following lines so that apache will serve media files.
**Alias /media /your project path/media**
Sometimes this may fix this issue.
Related
I have a simple server application, communicating with a mongodb server, running on the port 1234. Sometimes i find the application hanging (not down, it would be better...) and this error on the log
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 279, in close
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
**error: [Errno 32] Broken pipe**
I read about 'broken pipe' error and how to avoid it, but i don't really know when does it occur... So, there's a way to reproduce the problem or to debug it?
I don't know if the question makes sense without fully explaining what the server does, actually, but if i don't get some clue of the situation, I can't explain better than this...
I have a very simple API server built on top of bottle. What is does is to just return a JSON upon being called, the content of the JSON being a random string. It works great.
This server was scanned yesterday by a vulnerability scanner (nessus) and crashed because of a misbehavior of the scanner. I include the Traceback information below which shows a error: [Errno 10054] An existing connection was forcibly closed by the remote host exception.
My question is the following: who is the one who should handle this problem?
Is this nessus, which does unholy things? On the one hand yes, it should behave in a standard way (this is a scanner which, among others, is used for industrial scans where it meets all sorts of devices and should attempt to mitigate the risk of crashes). On the other hand life is brutal and the receiving end (what is scanned) should be able to cope.
Is this bottle ? It is a framework which should handle typical and not so typical web traffic and leave to the programmer the task of handling the business logic and not the internals
Is this me? handling all the possible exceptions
I am asking as I would like to help improve either nessus or bottle (or myself) - this is not strictly a programming problem ("how to catch the exception") so if you really feel so, vote to close as opinion-based, though I ask anyway as I see it as a "programmers methodology" question.
The error stack:
C:\Python27\python.exe C:/Users/yop/Documents/dev/infoscreen/webserver.py
10.81.163.129 - - [03/Feb/2015 18:21:00] code 400, message Bad request syntax ('\x16\x03\x01\x00\xea\x01\x00\x00\xe6\x03\x01T\xd1\x03|\xb3\x02lm\xf0\xb92\x9a\xd7\xa7\xec\xbca\xdaR9\xfc\xe3]);`\xfbI\x98\x17\x94\xe3\x00\x00x\xc0\x14\xc0')
10.81.163.129 - - [03/Feb/2015 18:21:05] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x00\xea\x01\x00\x00\xe6\x03\x01T\xd1\x03\x81\xfcxI\x0e\xd5\xc4\xba\x17\xd9\x92\x9f+\x83BR\x10\x94N\xa5\x12\xc0')
10.81.163.129 - - [03/Feb/2015 18:21:24] code 400, message Bad request version ('Secure-HTTP/1.4')
10.81.163.129 - - [03/Feb/2015 18:21:24] code 400, message Bad request syntax ("\x16\x03\x01\x00\xea\x01\x00\x00\xe6\x03\x01T\xd1\x03\x95\x95\x154\x94h/5\x8dL\xa6\x148\x04#s\x13\x9f'\xec\x1az\xbc\x87/L\x0e\xc7\x02\x00\x00x\xc0\x14\xc0")
Traceback (most recent call last):
----------------------------------------
File "C:\Python27\lib\SocketServer.py", line 295, in _handle_request_noblock
Exception happened during processing of request from ('10.81.163.129', 57035)
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 651, in __init__
self.handle()
File "C:\Python27\lib\wsgiref\simple_server.py", line 117, in handle
if not self.parse_request(): # An error code has been sent, just exit
File "C:\Python27\lib\BaseHTTPServer.py", line 291, in parse_request
self.headers = self.MessageClass(self.rfile, 0)
File "C:\Python27\lib\mimetools.py", line 25, in __init__
----------------------------------------
rfc822.Message.__init__(self, fp, seekable)
File "C:\Python27\lib\rfc822.py", line 108, in __init__
self.readheaders()
File "C:\Python27\lib\rfc822.py", line 155, in readheaders
line = self.fp.readline()
File "C:\Python27\lib\socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
Traceback (most recent call last):
----------------------------------------
File "C:\Python27\lib\SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
Exception happened during processing of request from ('10.81.163.129', 37539)
File "C:\Python27\lib\SocketServer.py", line 321, in process_request
----------------------------------------
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 651, in __init__
self.handle()
File "C:\Python27\lib\wsgiref\simple_server.py", line 116, in handle
self.raw_requestline = self.rfile.readline()
File "C:\Python27\lib\socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
----------------------------------------
Traceback (most recent call last):
Exception happened during processing of request from ('10.81.163.129', 38322)
File "C:\Python27\lib\SocketServer.py", line 295, in _handle_request_noblock
----------------------------------------
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 651, in __init__
self.handle()
File "C:\Python27\lib\wsgiref\simple_server.py", line 116, in handle
self.raw_requestline = self.rfile.readline()
File "C:\Python27\lib\socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
Process finished with exit code -1
In my application I am trying to save a simple entry with the help of the following code.
if form.is_valid():
f=form.save(commit = False)
f.Questionair=qset
f.questionnumber = f.Questionair.questions_set.all().count()+1
f.save()
return redirect('/feedback/create/'+str(fbid))
What is happening is as soon as this code is executed using runserver I get the following error in the terminal.
Exception happened during processing of request from ('127.0.0.1', 36076)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self)
File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 126, in __init__ super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__ self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 710, in finish self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 279, in close self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
Along with this the entry is saved twice in the database. This does not happen everytime but 3 out of 4 time I am facing this issue. I am using Ubuntu 13.10 and Django 1.6
I am getting this dump occasionally from OpenERP, but it seems harmless. The code serves HTTP; is this dump what happens when a connection is dropped?
Exception happened during processing of request from ('10.100.2.71', 42799)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 582, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 640, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 693, in finish
self.wfile.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
This just means that the underlying TCP connection was abruptly dropped. In this case it means that you are trying to write data to a socket that has already been closed on the other side (by the client). It is harmless, it means that while your server was sending an HTTP response to the client (browser) she stopped the request (closed the browser for example).
Here is the code:
conn = httplib.HTTPConnection("127.0.0.1:8000")
conn.request("POST", "/api/job/", some_params, headers)
conn.close()
no problem with sending request to server
but if i use loop for example:
for i in range(n):
conn = httplib.HTTPConnection("127.0.0.1:8000")
conn.request("POST", "/api/job/", some_params, headers)
conn.close()
it rises an exception, but it is interesting that request is successfull:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 284, in run
self.finish_response()
File "/usr/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 324, in finish_response
self.write(data)
File "/usr/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 403, in write
self.send_headers()
File "/usr/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 467, in send_headers
self.send_preamble()
File "/usr/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 385, in send_preamble
'Date: %s\r\n' % http_date()
File "/usr/lib/python2.7/socket.py", line 324, in write
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 60438)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 570, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 641, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 694, in finish
self.wfile.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
any suggestions ???
Looks to me like your buffer is getting filled. Your buffer will fill with any network requests you make, then is cleared when the server acknowledges receipt of the data. Not sure if there isn't a better way to do this, but you could try giving the server some time to acknowledge receipt by doing a short time.pause within your loop.