Forums

SIGPIPE error

Hello. I created a simple QA system using django. First I tested with HttpResponse and it works. Then I tried to change the response to JsonResponse to make it interact with chatbot with subtle adjustment for it, but it does not work!
The response contains two data, one of which is a sentence(string) and the other one is sentences(joined as string), and the following is the error message in server.log.
2020-06-18 14:48:45 Thu Jun 18 14:48:45 2020 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /kakao/babi (ip 10.0.0.52) !!! 2020-06-18 14:48:45 Thu Jun 18 14:48:45 2020 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during POST /kakao/babi (10.0.0.52)
I found some topics deal with similar problem so I checked running time, but it takes only 10 seconds.

Stay healthy and safe

The error says "probably the client disconnected", which means that you were trying to send back data to whatever is making requests to your site after it had already disconnected. The time saved in the access log for a request will reflect the time between when the request came in, and when the client disconnected; if it's very close to ten seconds, then it's possible that whatever was connecting to your site had a ten-second timeout: it connected, your site started doing its calculations, then it timed out and disconnected (which led to a line being written to the access log) and then later your site finished its calculations and tried to send data back, which led to the error in the server log.