Questions tagged [epipe]

EPIPE is a return value (errno) when writing to a file under Unix system. Its an attempt to write to a broken pipe.

When a process ignores the SIGPIPE, the writing system call returns with an EPIPE error. So processes wanting to handle the broken pipe manually would typically ignore SIGPIPE and take action upon a EPIPE error.

SIGPIPE is for situations like this:

grep "pattern" < reallyhugefile | head

grep might print millions of lines, but head only reads 10 then quits. Once head closes the read-end and quits, grep gets SIGPIPE, which kills it, forcing it to quit early instead of processing the entire file uselessly.

If you don't want your program to be killed, handle or block SIGPIPE yourself. You will start getting write-errors with errno set to EPIPE instead.

https://unix.stackexchange.com/questions/84813/what-makes-a-unix-process-die-with-broken-pipe

32 questions
19
votes
2 answers

Android: write failed: EPIPE (Broken pipe) Error on write file

I was trying to take screenshot of the Android screen programatically. I had done the following code: private void getsnap(){ try{ Process sh = Runtime.getRuntime().exec("su", null, null); OutputStream os = sh.getOutputStream(); …
13
votes
2 answers

Error: write EPIPE with node.js and imagemagick

I'm lost as to where this error is coming from, and I'm hoping you can help me. I'm new to node and am trying to resize an image with imagemagick: var express = require('express'), fs = require('fs'), gm = require('gm'), imagemagick =…
iank
  • 800
  • 3
  • 10
  • 32
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
10
votes
2 answers

NodeJS - How to stream request body without buffering

In the below code I can't figure out why req.pipe(res) doesn't work, and yet doesn't throw an error either. A hunch tells me it's due to nodejs' asynch behavior, but this is a very simple case without a callback. What am I…
Robert Christian
  • 18,218
  • 20
  • 74
  • 89
9
votes
1 answer

EPIPE error in Node.js

The following code run fine on JPEG, Docx, zip and several other file formats. Then I try is on mpg-filer however, I am hit by a "Error: write EPIPE" that I am unable to debug. Using a try/catch construction also result in an uncaught exception. The…
rlp
  • 513
  • 2
  • 7
  • 16
8
votes
2 answers

Node.js - events.js:154 throw err write EPIPE; Program Crashing

Trying to run my Node.js program, which has worked for a long time, and now it is suddenly... not. I'm trying to figure out the problem, and I figured it would be helpful if I posted here to try to track it down. Here's the log…
gmemstr
  • 135
  • 1
  • 2
  • 8
8
votes
6 answers

Error: write EPIPE

I keep getting the following error: Error: write EPIPE at errnoException (net.js:901:11) at Object.afterWrite (net.js:718:19) When i run the following function: router.route('/certificationService') .post(function (req, res) { var…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
6
votes
1 answer

Android. write failed: EPIPE (Broken pipe) when use Process

Hello I tried to install app inside of my app via Process. For that function I created this method. private void loadAndInstallApk(String string) { if(!isRooted()){ return; } Uri uri = loadApk(string); if(uri == null){ …
Dima
  • 1,189
  • 1
  • 13
  • 31
5
votes
1 answer

node.js EPIPE exception on child_process.spawn

I'm using node.js v0.6.10 although I've got the same issue on 0.6.7. Basically I run a child process using spawn that starts another node.js process, and communicates over stdout and stdin Here are the two scripts: parent (cli.js): var spawn =…
Eric Allam
  • 197
  • 3
  • 11
4
votes
1 answer

MongoError: write EPIPE

I'm using Node.JS + Mongoose + MongoDB. Had my app working ok until now, now when trying to save a document: Saving operation: doc.save(function(err, d){ console.log(err,d); {"name":"MongoError","message":"write EPIPE"} Error stack: {…
Crisboot
  • 1,420
  • 2
  • 18
  • 29
4
votes
3 answers

Broken pipe (EPIPE) on connection to loopback address

I'm currently testing my networking code. This involves making a connection via the IPv4 loopback address (127.0.0.1). Unfortunately the program often (not always) gives an EPIPE error on sending data. I am using Berkeley network sockets and…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
3
votes
2 answers

Filter out broken pipe errors from template execution

This is similar to Filter out broken pipe errors , but with complications - when a user presses the "stop" button on their browser while a template is executing (html/template.Execute or text/template.Execute), a broken pipe error occurs. However, I…
Darrrrrren
  • 5,968
  • 5
  • 34
  • 51
2
votes
1 answer

Node.js: An uncatchable error is thrown when the child process is abruptly closed during a large write operation to it's stdin stream

Note: I already found a solution to this problem, posting it here for posterity. See the selected answer. The following (simplified) code throws an uncatchable "write EPIPE" (and in some scenarios "write EOF") error: const { exec } =…
Yarin
  • 141
  • 6
2
votes
0 answers

Error: write EPIPE occurring only when Electron Application is Built

I am encountering an odd issue that I am hoping someone can shed some light into. I currently writing an Electron-React desktop application for windows. Part of this application requires that I extract icons from some executable files. I am using…
2
votes
1 answer

Write EPIPE error when filling form using node-pdftk

I am trying to fill a pdf form using nodejs. Im trying to use node-pdftk package for the same.Did following steps: Installed pdftk for windows mapped the path to the environment variables PATH installed node-pdf package `const express =…
1
2 3