Forums

Server error

Hello, i've got the following error in server log:

2018-04-19 13:26:45 Thu Apr 19 13:26:45 2018 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /wapp (ip 10.0.0.31) !!! 
2018-04-19 13:26:45 Thu Apr 19 13:26:45 2018
    - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 296] during POST /wapp (10.0.0.31) 
2018-04-19 13:26:45 RuntimeError: generator ignored GeneratorExit

what does it mean? thanks

If you're only seeing a few, it's nothing to worry about -- just people closing the browser tab while your code was trying to send data back to them. More information here.

there are a lot of such errors in my case and it turns to be a problem, because i host not a site, but a web script, that recieves POST request, and does one more POST request, which sends a message to customer. After this errors happen, my script send lots of duplicated messages to customer. What can i do with this?

The error is happening when whatever is calling your site breaks the connection, so you need to find out why it's doing that. Does your site sometimes take more than three minutes to process a request?

No, scipt runs very fast, there is not more 10 sec between i recieve post request and then send it back

What is it that is accessing the site? That is, the thing that's doing the POST request?

i just recieve json-object via post request, do some calculation with this json and forward it via another post request. As i understand, there is no point of somebody waiting to get any content from my side

yes, my script only recieves and sends post requests

There might be timeouts in whatever is making the request to your site and that would cause the logs you'd see.

so the problem is in timeouts that happen when i recieve 10kb json file in incoming post request?

here is my error log, its full of such errors: https://prnt.sc/j87rk0 is this because of the same?

All of those relate to clients accessing your site and disconnecting before you've sent any data back. A good way to track down which view is causing this is to open the access log and search for " 499 " (with the spaces around the number). This will show you all of the hits that returned a 499 status code, which is a synthetic status code that nginx puts into the logs to show "client disconnected". You'll see how long the client waited before disconnecting at the end of the line, tagged with response-time=. That should help you track down what's taking so long and causing the problem.

thanks, now i got it. As i see, average response time is about 1 sec and the problem is because of hits with response_time = 300 sec. In my case this is POST requests only. Does it mean that such POST request lasts 300 sec?

It's not necessarily all POST requests, just the ones that say that the response time is 300s in the access log. If they're always requests to a particular view, then you can try to work out what's taking so long in that view by adding print statements to it -- they'll wind up in the server log.