Questions tagged [broken-pipe]

Broken pipe is a general term for when a process is unable to output to a socket or pipe due to no process reading from the other end of the pipe.

Broken pipe is a condition in programming where a process is unable to direct output to either a pipe or socket due to the connection being closed by a peer.

Every library function that returns this error code also generates a SIGPIPE signal; this signal terminates the program if not handled or blocked.

More info in the libc documentation

238 questions
296
votes
10 answers

How to prevent SIGPIPEs (or handle them properly)

I have a small server program that accepts connections on a TCP or local UNIX socket, reads a simple command and (depending on the command) sends a reply. The problem is that the client may have no interest in the answer and sometimes exits early. …
jkramer
  • 15,440
  • 5
  • 47
  • 48
179
votes
6 answers

How to prevent errno 32 broken pipe?

Currently I am using an app built in python. When I run it in personal computer, it works without problems. However, when I move it into a production server. It keeps showing me the error attached as below:. I've done some research and I got the…
SƲmmēr Aƥ
  • 2,374
  • 6
  • 24
  • 29
105
votes
6 answers

What causes the Broken Pipe Error?

I know that broken pipe error is thrown when the socket on the peer side is closed. But, in my test I have noted that an immediate 'send' call on this side when the peer side is closed doesn't always lead to a broken pipe error. E.g.: After closing…
Jay
  • 24,173
  • 25
  • 93
  • 141
69
votes
12 answers

Django Broken pipe in Debug mode

I have django 1.3 on the remote server behind Nginx. If I run django with apache + mod_wsgi, I can watch errors in apache log files. It's ok but I'd like to have in console. If I run django own development server, I get errors with stacktrace in…
San4ez
  • 8,091
  • 4
  • 41
  • 62
55
votes
8 answers

How to prevent BrokenPipeError when doing a flush in Python?

Question: Is there a way to use flush=True for the print() function without getting the BrokenPipeError? I have a script pipe.py: for i in range(4000): print(i) I call it like this from a Unix command line: python3 pipe.py | head -n3000 And it…
tommy.carstensen
  • 8,962
  • 15
  • 65
  • 108
55
votes
5 answers

How to handle a broken pipe (SIGPIPE) in python?

I've written a simple multi-threaded game server in python that creates a new thread for each client connection. I'm finding that every now and then, the server will crash because of a broken-pipe/SIGPIPE error. I'm pretty sure it is happening…
Adam Plumb
  • 3,738
  • 8
  • 35
  • 34
45
votes
8 answers

Broken pipe when pushing to git repository

I'm trying to push for the first time a code to my git repository but i get the following error: Counting objects: 222026, done. Compressing objects: 100% (208850/208850), done. Write failed: Broken pipe222026) error: pack-objects died of signal…
Deadlock
  • 799
  • 1
  • 7
  • 15
26
votes
6 answers

Django + WebKit = Broken pipe

I'm running the Django 1.2 development server and I get these Broken Pipe error messages whenever I load a page from it with Chrome or Safari. My co-worker is getting the error as well when he loads a page from his dev server. We don't have these…
jmagnusson
  • 5,799
  • 4
  • 43
  • 38
16
votes
3 answers

Python BaseHTTPServer, how do I catch/trap "broken pipe" errors?

I build a short url translator engine in Python, and I'm seeing a TON of "broken pipe" errors, and I'm curious how to trap it best when using the BaseHTTPServer classes. This isn't the entire code, but gives you an idea of what I'm doing so far: …
iandouglas
  • 4,146
  • 2
  • 33
  • 33
13
votes
3 answers

EC2 ssh broken pipe terminates running process

I'am using a EC2 instance to run a large job that I estimate to take approx 24 hours to complete. I get the same issue described here ssh broken pipe ec2 I followed the suggestion/solutions in the above post and in my ssh session shell I launched my…
codingknob
  • 11,108
  • 25
  • 89
  • 126
13
votes
1 answer

What is a broken pipe error?

Running code in python, I discovered a "Broken Pipe Error." Can someone please explain to me what this is simply? Thanks.
louie mcconnell
  • 701
  • 3
  • 7
  • 20
13
votes
2 answers

error: [Errno 32] Broken pipe

I am working on a Django project. All went well till I created an Ajax request to send values from the html page to the backend (views.py). When I send the data using Ajax, I am able to view the values being passed to views.py, and it even reaches…
kruthirshanks
  • 171
  • 1
  • 1
  • 10
13
votes
3 answers

Filter out broken pipe errors

I'm getting an error returned from an io.Copy call, to which I've passed a socket (TCPConn) as the destination. It's expected that the remote host will simply drop the connection when they've had enough, and I'm not receiving anything from…
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
12
votes
1 answer

Python socket.send() can only send once, then socket.error: [Errno 32] Broken pipe occurred

I'm a newbie in network programming, so please forgive me if this is a dumb question :) I created 1 client and 1 SocketServer.ThreadingMixIn server on Ubuntu 10.04.2 using Python2.7, but it seems like I can only call sock.send() once in client, then…
hencrice
  • 167
  • 1
  • 1
  • 10
11
votes
2 answers

Why am I getting "cat: write error: Broken pipe" rarely and not always

I am running some scripts with commands having cat pipelined with grep like: cat file.txt | grep "pattern" Most of the times there are no problems. But sometimes I get below error: cat: write error: Broken pipe So how do I find out when the…
Vishal-L
  • 1,307
  • 1
  • 9
  • 16
1
2 3
15 16