# Uncaught Execption, Error: write EPIPE

**URL:** https://discourse.nodered.org/t/uncaught-execption-error-write-epipe/62096
**Category:** General
**Created:** [3 May 2022 06:30 UTC](https://discourse.nodered.org/t/uncaught-execption-error-write-epipe/62096 "2022-05-03T06:30:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![RensW](https://avatars.discourse-cdn.com/v4/letter/r/74df32/32.png) [@RensW](https://discourse.nodered.org/u/RensW)
#### Post date: [3 May 2022 06:30 UTC](https://discourse.nodered.org/t/uncaught-execption-error-write-epipe/62096/1 "2022-05-03T06:30:25Z")

</div>

Hi everyone,

I have the following Uncaught exception:

```auto
Stopping Node-RED graphical event wiring tool...
2 May 16:53:42 - [info] Stopping flows
2 May 16:53:42 - [red] Uncaught Exception:
2 May 16:53:42 - [error] Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:817:11)
    at Socket._write (node:net:829:8)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at Socket.Writable.write (node:internal/streams/writable:334:10)
    at GPIOInNode.<anonymous> (/home/pi/.node-red/node_modules/node-red-node-pi-gpio/36-rpi-gpio.js:111:34)
    at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:329:34
    at new Promise (<anonymous>)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
Stopped Node-RED graphical event wiring tool.

```

it does not happen al the time. It seems to happen more when CPU is near 100%

I do not know what it means. i can not find the cause of the problem.

Node red version

```auto
Starting as a systemd service.
3 May 08:32:38 - [info]
Welcome to Node-RED
===================
3 May 08:32:38 - [info] Node-RED version: v2.2.2
3 May 08:32:38 - [info] Node.js version: v16.15.0
3 May 08:32:38 - [info] Linux 5.10.103-v7l+ arm LE
3 May 08:32:39 - [info] Loading palette nodes
redPlc rpi_mcp23017 driver V1.0.6 (c) Ocean iiot2k@gmail.com
3 May 08:32:41 - [info] Dashboard version 2.23.4 started at /ui
3 May 08:32:42 - [info] Settings file : /home/pi/.node-red/settings.js
3 May 08:32:42 - [info] Context store : 'default' [module=memory]
3 May 08:32:42 - [info] User directory : /home/pi/.node-red
3 May 08:32:42 - [warn] Projects disabled : editorTheme.projects.enabled=false
3 May 08:32:42 - [warn] Flows file name not set. Generating name using hostname.
3 May 08:32:42 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
3 May 08:32:42 - [info] Server now running at http://127.0.0.1:1880/
3 May 08:32:42 - [warn]

```

If anyone knows how to find the cause of know the solution that would help me out so much.

RensW

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [3 May 2022 06:57 UTC](https://discourse.nodered.org/t/uncaught-execption-error-write-epipe/62096/2 "2022-05-03T06:57:25Z")

</div>

Looks like some missing error handling in `node-red-node-pi-gpio`.

With that type of error there isn't much you can do as an end user - the node needs updating to handle that case.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [3 May 2022 08:51 UTC](https://discourse.nodered.org/t/uncaught-execption-error-write-epipe/62096/3 "2022-05-03T08:51:02Z")

</div>

Seems to be in the on close event / re-deploy. Is easy enough to add a try/catch around the the write that is failing... but not sure of the consequence of that... will it leave the child process dangling ?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [2 July 2022 08:51 UTC](https://discourse.nodered.org/t/uncaught-execption-error-write-epipe/62096/4 "2022-07-02T08:51:26Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
