Forums

Frequently getting SIGPIPE: writing to a closed pipe

Hi PythonAnywhere Team,

In my Django app's server logs I've been noticing an increase in SIGPIPE: writing to a closed pipe/socket/fd... errors and can't seem to figure out the cause.<br><br>

I referenced them against the requests inside the access log and saw that they all had relatively low response times (ranged between 150ms & 3s) with a few exceptions (ranged between 5s and 20s). Also, there isn't any individual url that this occurs on and although the pages end up loading there is a noticable effect on the client side when the error appears in the server log - sometimes its the homepage, the admin site, etc.

I've read through others topics in the forums and haven't been able to deduce the cause. Any thoughts on approaches to debug or ideas on what could be causing this would be greatly appreciated. Oh, and I added the links to the other posts I've referenced for debugging thus far! <br><br> Thank you for your help!

<br><br>


The important thing to remember about errors like that is that they are a symptom of a potential problem, not a cause -- it means that the server was trying to send a response to a client, and was unable to send it because the client has disconnected. That can be a sign that the site is running slowly and people are giving up waiting for a page to load, but it can just be a result of people with poor internet connections accessing it.

It doesn't look like your site is overloaded -- I can see that you have enough worker processes to handle all of the requests it's getting without things being queued up.

Normally I'd say that if you only get a few of these, then you can just ignore them -- regard it as the results of the people with bad network connections accessing the site. But you mention that:

although the pages end up loading there is a noticable effect on the client side when the error appears in the server log - sometimes its the homepage, the admin site, etc.

What is the effect that you see?

Thanks for getting back so quickly Giles. By effect I just was referring to the response time feeling slower - which would make sense given a poor connection haha. Sometimes it's just more noticable where I can tell the error occured without having looked at the server log - for example, two requests to the same uri produced the following response times & codes:

.... [25/Mar/2021:01:19:28 +0000] "GET /admin/../..... 499 ... response-time=0.624

.... [25/Mar/2021:01:21:38 +0000] "GET /admin/../..... 200 ... response-time=21.969

Anyways, I was just curious if there were any steps I could take to help determine if it is just a connection issue or if there is something in my code that was causing it - but for the time being I'll just chalk it up to poor connection.

Thanks again for the help Giles!

OK, thanks for letting us know!