Uncaught Execption, Error: write EPIPE

Hi everyone,

I have the following Uncaught exception:

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

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

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.

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 ?