# Exec node is not responding

**URL:** <https://discourse.nodered.org/t/exec-node-is-not-responding/58740>\
**Category:** General\
**Created:** [21 February 2022 10:44 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740 "2022-02-21T10:44:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [21 February 2022 10:44 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/1 "2022-02-21T10:44:27Z")

</div>

Hi Team,

I have implemented a node-red flow and accessed the flow by exposing it through an API.  
API will trigger the Execute node through which the command will execute based on API params.

Once I load the flow using post API to create a flow and deploy it in node-red.  
At that time when I am calling the API to execute the exec command.  
The exec node is not getting executed and throwing a timeout. it only works once after we edit(just open and redeploy) the exec node and redeploy it.

Any solution or fix for this? so that when i deploy the flow and call the api, Exec node should be running the command and giving results.

---

<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:** [21 February 2022 11:15 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/2 "2022-02-21T11:15:11Z")

</div>

> [@SS-Akhilesh-Appala](#):
>
> The exec node is not getting executed and throwing a timeout.

Show us the exact error you are getting please, and tell us where you see it.

---

<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:** [21 February 2022 12:41 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/3 "2022-02-21T12:41:13Z")

</div>

How are you triggering the `exec` node? Can you show your flow?

Also you could try adding a `catch` node connected to a `debug` node (set to display the complete msg object) and see if that gives you any more information.

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [21 February 2022 14:31 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/4 "2022-02-21T14:31:25Z")

</div>

HI @zenofmud @Colin  
Please find the flow

 ![MicrosoftTeams-image (3)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1ed6b2d2d48e8f336a8fed80e85698035e0de937.png)  
when I call get API with params for the 1st time after initial deployment of flow.EXEC node (will generate a file in destination) is not getting executed as expected and it's going to file access node where it will check for the generated output file.  
and when the call reaches the file access node it is throwing below error which means the file is not getting generated.  
But when we just open the EXEC node and click on done and redeploy it starts working and giving expected output  
File C:\Program Files\Connect Transfer\Transformations\Transformed\transformed\_input\_sample-xml1.xml is not accessible Error: ENOENT: no such file or directory, access 'C:\Program Files\Connect Transfer\Transformations\Transformed\transformed\_input\_sample-xml1.xml'

---

<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:** [21 February 2022 14:33 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/5 "2022-02-21T14:33:56Z")

</div>

Please export your flow and attach it to a reply.  
Also what are the versions of NR and node.js?

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [21 February 2022 18:11 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/6 "2022-02-21T18:11:47Z")

</div>

> [@SS-Akhilesh-Appala](#):
>
> C:\Program Files\Connect Transfer\Transformations\Transformed\transformed\_input\_sample-xml1.xml

Have you checked to see if this file actually exists?

How is the `exec` node set up? Is it possible that it is still running when a new msg arrives?

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [22 February 2022 04:47 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/7 "2022-02-22T04:47:08Z")

</div>

The FIle is not existed because of exec node is not working on 1st deployment of the flow.  
once i just open and click on done and redeploy without any changes from next time it starts working

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [22 February 2022 05:17 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/8 "2022-02-22T05:17:41Z")

</div>

Attach a `debug` node to the output of your `function` node labeled "sending params" and show us the full output when you "call get API with params for the 1st time after initial deployment". So we can see what, if anything is being sent to the `exec` node labeled "cmd".

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [22 February 2022 06:38 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/9 "2022-02-22T06:38:34Z")

</div>

Sure @zenofmud

PFA for flow file  
[output-transfer.json](https://discourse.nodered.org/uploads/short-url/kfW1uhEBKbSbnn7mxl05OuOa2AO.json) (6.1 KB)

Node-red version -- 1.0.6  
nodejs -- 9.6.5

---

<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:** [22 February 2022 08:55 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/10 "2022-02-22T08:55:46Z")

</div>

> [@SS-Akhilesh-Appala](#):
>
> nodejs -- 9.6.5

I hope that is not correct as that has never been a supported version of nodejs for node-red. Also everything below v12 is no longer supported (by the nodejs developers or by the current version of node-red) v14 is the one currently recommended for node-red but 12 and 16 are also ok.  
In addition, node-red 1.0.6 is very old.

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [22 February 2022 11:58 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/11 "2022-02-22T11:58:27Z")

</div>

> [@SS-Akhilesh-Appala](#):
>
> Node-red version -- 1.0.6  
> nodejs -- 9.6.5

Sure @Colin  
we are trying to update it to 1.3.5 and node version 12.  
But is there any alternative for exec node and run the commands with arguments in nodered?

---

<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:** [22 February 2022 12:01 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/12 "2022-02-22T12:01:05Z")

</div>

> [@SS-Akhilesh-Appala](#):
>
> But is there any alternative for exec node and run the commands with arguments in nodered?

You don't need an alternative, you just need to configure it correctly and send it the right message. You have not done as Peter requested:

> [@HaroldPetersInskipp](#):
>
> Attach a `debug` node to the output of your `function` node labeled "sending params" and show us the full output when you "call get API with params for the 1st time after initial deployment". So we can see what, if anything is being sent to the `exec` node labeled "cmd".

---

<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:** [22 February 2022 12:49 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/13 "2022-02-22T12:49:26Z")

</div>

I see you have `EXEC` in the `exec` node. I'm not a Windows person so is the command case sensitive?

also can you provide an example of the HTTP being used to run the request?

one other thing, in your function node you have

```auto
 flow.set("outputFoldePath",msg.payload.outputFoldePath);
 flow.set("outputFileName", msg.payload.outputFileName, );

msg.payload = "\""+msg.payload.inputFilePath+"\"" +" "+ "\""+ msg.payload.outputFilePath +"\"" +" "+ "\""+msg.payload.logicFilePath+"\"";

```

you are using msg.payload.`outputFoldePath` and msg.payload.`outputFilePath` shouldn't they be the same??

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [23 February 2022 03:50 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/14 "2022-02-23T03:50:21Z")

</div>

Yeah, my mistake its actually 10.15.3

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [23 February 2022 04:34 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/16 "2022-02-23T04:34:10Z")

</div>

That is not actually a command, we are using a custom one from environment variables. where exec node will execute it.  
Both are a little different outputFoldePath -- gives till the folder  
outputFilePath -- gives till the name of the output file - to be created.

---

<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:** [23 February 2022 09:24 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/17 "2022-02-23T09:24:46Z")

</div>

> [@SS-Akhilesh-Appala](#):
>
> it is not able to find the output file

Does the file exist?

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [23 February 2022 09:55 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/18 "2022-02-23T09:55:54Z")

</div>

No, its not there

---

<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:** [23 February 2022 10:07 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/19 "2022-02-23T10:07:43Z")

</div>

Well that is why you get the file not found error. Assuming the file should be there then you must work out why it is not there.

---

<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:** [23 February 2022 10:15 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/20 "2022-02-23T10:15:52Z")

</div>

So if I understand,

- the `function` node create a string that contains three strings seperated by a space
- each string containing a full path to a filename
- this payload is sent to the `exec` node which is running a unknown (to us) command.
- the unknown command is not returning results

It would seem that the issue is with the program(s) processing the data you are sending it.

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [23 February 2022 10:24 UTC](https://discourse.nodered.org/t/exec-node-is-not-responding/58740/21 "2022-02-23T10:24:50Z")

</div>

But if i execute the same, by just opening the node and redeploying. it is working fine.

[Next page](https://discourse.nodered.org/t/exec-node-is-not-responding/58740.md?page=2)
