Forums

URGENT: OSError: write error, SIGPIPE and uwsgi_response_writev_headers_and_body_do()

Hi, My site: www.jung.gg Has blown up on Reddit (https://www.reddit.com/r/leagueoflegends/comments/fdf1hr/a_new_analytics_site_for_popular_challenger/) and now I am getting the following errors:

2020-03-04 20:58:10,391: OSError: write error 2020-03-04 20:56:44 Wed Mar 4 20:56:44 2020 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /result (ip 10.0.0.249) !!! 2020-03-04 20:56:44 Wed Mar 4 20:56:44 2020 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during POST /result (10.0.0.249)

Any urgent help would be appreciated!

Jack

That happens when a client disconnects while a response is being sent. If your website is experiencing high traffic and your views take a long time to render, then you may not have enough workers to handle the load, so requests spend a long time in the queue waiting for an available worker, so the users just see the page loading and leave the site.

Hello, so I'm also encountering similar problem while running my website. I hit API from my website and it will run a loop for 15 iterations, and then the web will display the processed data from the API. The data will be sent to MySQL database before displayed on the web. But I always get this message on my server logs when I hit the API and the error page is also appearing on my site, though all the data from 15 iterations are successfully transferred to the database.

SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /single_testing (ip 10.0.0.66) !!!
uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during POST /single_testing (10.0.0.66)

But when I change the iteration on my API to 9 or 10 iteration, my website runs fine without showing the error page. Can anyone please help me fix this? Thank you

That message means that the client disconnected before the response has been effectively sent back. It's not necessarily an error, rather a symptom. If you don't want to see such messages in the logs, you may try to make processing in your app shorter (if they are caused by a short timeout on the client side) , but you can always get such message from time to time if the client disconnects.