# Node-Red v3.1.0 Exec node now causing an Error

**URL:** <https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366>\
**Category:** General\
**Created:** [16 September 2023 10:57 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366 "2023-09-16T10:57:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 10:57 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/1 "2023-09-16T10:57:27Z")

</div>

The following command works without issue in the Terminal of the Raspberry PI

```auto
ffmpeg -i /path/to/your/audiofile.mp3 -f wav - | aplay

```

and use to work in the Node Red exec node, but now fails producing an unknown error.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4d650c738ed34dffe8c30d1d5780800b2ef9240f.png)

```auto
aplay: main:830: audio open error: Unknown error 524

```

What has changed in Node Red Exec?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 September 2023 11:23 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/2 "2023-09-16T11:23:29Z")

</div>

1. What version of NR did it work on?
2. add a `catch` node connected to a `debug` node (set to display the complete msg object) and see if it shows anything
3. take a look at the node-red log and see if it shows anything.
4. have you done any other upgrades (like the os)?

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 11:39 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/3 "2023-09-16T11:39:07Z")

</div>

- It worked on recent NR prior to the release of 3.1.

- Catch Node does not show anything in the Debug msg.object

- Exec Node stderr shows as `aplay: main:830: audio open error: Unknown error 524` as already mentioned.

- The Node Red Console on the RPI doesn't show any errors.

- Yes I have recently upgraded the OS to Bullseye, and at the same time as going to NR 3.1.

Nevertheless the command works in the Terminal on the RPI but not when in the NR Exec node on the same device.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/c/4c48d04e7013e5bcc86fd6b3f558a4ac5f5d27fc.png)

Incidentally the filename use to have to be in quotes in exec node but in the Terminal, at least currently, the quotes are not essential. But doesn't work with or without quoptes in NR Exec node now.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [16 September 2023 11:45 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/4 "2023-09-16T11:45:48Z")

</div>

Many things that work fine in terminal (espeically sound things) don't translate direct to exec node ☹

I'm sure it's not the issue but why is there a - just before the pipe | ?

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 11:49 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/5 "2023-09-16T11:49:04Z")

</div>

There has to be at least one output file, so the - is required before the pipe......at least that is my interpretation if I remove the '-'.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [16 September 2023 11:57 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/6 "2023-09-16T11:57:13Z")

</div>

Asssuming you jsut want to hear an .mp3 file playing - see if mpg123 works for you

I used to have some flows that played .mp3 from a Pi but of course I can't find any of them now! ☹

[edit] found an old exec with aplay in it that had few parameters to direct the sound to the headphone socket on the pi - don't know if this will help you?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/9670278c5c37f1508299d3cabf5023cd2ec4fa8b.png)

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 12:13 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/7 "2023-09-16T12:13:42Z")

</div>

Thanks, the purpose is to play any sound to a Bluetooth Speaker.

I used it in conjunction with Google Text To Speech to output audio feedback to an Alexa Amazon Dot from NR flows.

I may try winding back on the NR versions to see when the issues appeared. Just seems strange that it used to work fine and now doesn't but the command still works in the Terminal.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [16 September 2023 12:18 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/8 "2023-09-16T12:18:10Z")

</div>

Its unlikely to be an NR version issue as NR just executes what you tell it to

I'm no linux expert but Rasperry Pi were always playing around with sound things from OS to OS. - maybe they still are

And the exec node doesn't work exactly the same as a standard terminal

I've just tried out mpg123 and it works in NR 3.1.0 Bullseye (at least it outputs to the 3.5mm audio socket)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 September 2023 13:09 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/9 "2023-09-16T13:09:59Z")

</div>

How did you install node red on the pi?

When you run it in a terminal are you logged in as the same user that runs node red?

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 13:46 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/10 "2023-09-16T13:46:25Z")

</div>

- I installed NR using the bash script on the web site.

- Yes logged in as same user on the pi and for NR on the RPI Zero 2W

I've now wound back through the releases to version 1.1.3 and the error is still being produced, so beginning to look as though as not due NR per se. Haven't gone back to earlier Node.js releases yet.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 September 2023 13:59 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/11 "2023-09-16T13:59:57Z")

</div>

I think it is more likely to be an OS change that has made the difference.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 September 2023 14:02 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/12 "2023-09-16T14:02:00Z")

</div>

Also try sending the ffmpeg output direct to a file and see if that works.

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 15:00 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/13 "2023-09-16T15:00:35Z")

</div>

The original Flow dates back to early 2020, unfortunately appending the appropriate Node version to the NR installation results in a failed Node.js install, so my I seem to have been thwarted in investigating that route for the anomalous behaviour. As you say it seems most likely due to an OS or maybe Node.js change. Sending the ffmpeg output from the Exec Node direct to file only results in an error report etc. as seen below.  
`Command failed: ffmpeg -i "/home/pi/Desktop/audio.mp3" -f wav - | aplayaplay: main:830: audio open error: Unknown error 524ffmpeg version 4.3.6-0+deb11u1+rpt5 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 10 (Raspbian 10.2.1-6+rpi1) configuration: --prefix=/usr --extra-version=0+deb11u1+rpt5 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-li...`

Further investigation would suggest that for whatever reason the Exec Node can no longer execute the `aplay` command.

Saving the ffmpeg output direct to a file in the Exec node rather than piping it to `aplay` and then trying to play that file in an Exec node using `aplay` fails with

```auto
Command failed: aplay /home/pi/Desktop/out.wavaplay: main:830: audio open error: Unknown error 524

```

Such a shame! 😮‍💨 😮‍💨 ☹

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 September 2023 15:04 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/14 "2023-09-16T15:04:33Z")

</div>

> [@PdeJ](#):
>
> Saving the ffmpeg output direct to a file in the Exec node rather than piping it to `aplay` and then trying to play that file in an Exec node

Does that a aplay command work in a terminal?

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 15:07 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/15 "2023-09-16T15:07:13Z")

</div>

Yes the aplay works in a terminal.

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 15:10 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/16 "2023-09-16T15:10:48Z")

</div>

Yes the aplay command works in a terminal to play that saved file.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 September 2023 15:36 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/17 "2023-09-16T15:36:40Z")

</div>

> [@PdeJ](#):
>
> aplay command works in a terminal to play that saved file.

Please start node red using  
`node-red-stop`  
`node-red-start`  
Keep the command window open and tell node red to play the file. Then copy/paste here the full output, from the welcome to node red message, to the error and anything immediately after the error. Copy/paste please, not screen shot.

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 15:44 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/18 "2023-09-16T15:44:42Z")

</div>

As I said earlier, the Node Red console shows no changes on executing the exec Node command

```auto
pi@piZero2:~ $ node-red-start

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.1.8:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
16 Sep 16:41:38 - [info]
Welcome to Node-RED
===================
16 Sep 16:41:38 - [info] Node-RED version: v3.1.0
16 Sep 16:41:38 - [info] Node.js version: v18.17.1
16 Sep 16:41:38 - [info] Linux 6.1.21-v7+ arm LE
16 Sep 16:41:41 - [info] Loading palette nodes
level info
16 Sep 16:41:53 - [info] Settings file : /home/pi/.node-red/settings.js
16 Sep 16:41:53 - [info] Context store : 'default' [module=memory]
16 Sep 16:41:53 - [info] User directory : /home/pi/.node-red
16 Sep 16:41:53 - [warn] Projects disabled : editorTheme.projects.enabled=false
16 Sep 16:41:53 - [info] Flows file : /home/pi/.node-red/flows.json
16 Sep 16:41:53 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
16 Sep 16:41:53 - [info] Server now running at http://127.0.0.1:1880/
16 Sep 16:41:53 - [info] Starting flows
Platform node has already been set. Overwriting the platform with node.
16 Sep 16:41:57 - [error] [tensorflowCoco:6f95ae40e7e2711e] Error: /home/pi/.node-red/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node: wrong ELF class: ELFCLASS64
16 Sep 16:41:58 - [info] Started flows
16 Sep 16:41:58 - [info] [mqtt-broker:ea104de9504b9a94] Connected to broker: mqtt://192.168.1.8:1883

```

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [16 September 2023 15:59 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/19 "2023-09-16T15:59:27Z")

</div>

Thought I might be able to get round it by executing a bash script from Node Red Exec, but even that fails.

In the Terminal

```auto
pi@piZero2:~ $ bash /home/pi/Desktop/play_audio.sh
Playing WAVE '/home/pi/Desktop/out.wav' : Signed 16 bit Little Endian, Rate 24000 Hz, Mono
pi@piZero2:~ $ 

```

and in Node Red  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/1/61509f4f94b84d25c47e6d4bc3df139991bb146e.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/357ee075fe87e902a885cbcf43189d6213b3593a.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/aee756f72c3bcdb0fe8bdd18feb3125eaa153ef4.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/56eab4678cc27f49f51fc54158054d0419f050d0.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 September 2023 16:12 UTC](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366/20 "2023-09-16T16:12:54Z")

</div>

Has aplay got any command line options to give more verbose output?

[Next page](https://discourse.nodered.org/t/node-red-v3-1-0-exec-node-now-causing-an-error/81366.md?page=2)
