# Find error origin from node-red log

**URL:** <https://discourse.nodered.org/t/find-error-origin-from-node-red-log/22011>\
**Category:** General\
**Created:** [20 February 2020 12:48 UTC](https://discourse.nodered.org/t/find-error-origin-from-node-red-log/22011 "2020-02-20T12:48:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaless](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kaless](https://discourse.nodered.org/u/kaless)\
**Post date:** [20 February 2020 12:48 UTC](https://discourse.nodered.org/t/find-error-origin-from-node-red-log/22011/1 "2020-02-20T12:48:05Z")

</div>

Hello,

My node-red server display regularly the following info:

> 20 Feb 13:36:51 - [info] [exec:e6ac59f1.d21818] error:Error: Command failed: nc -w 2 -zv 192.168.193.1 22  
> nc: connect to 192.168.193.1 port 22 (tcp) timed out: Operation now in progress

> 20 Feb 13:36:54 - [info] [exec:e6ac59f1.d21818] error:Error: Command failed: nc -w 2 -zv 192.168.193.1 22

My project is fairly large, and I'm not sure from what flow this error occured. (I have a lot of exec nodes that connect in ssh to 192.168.193.1)  
I interpreted this number "e6ac59f1.d21818" as a flow id.  
However when I use the API GET/flows with this id, I get an error 404.

Isn't it a flow id? Any suggestion in how to I could investigate the issue?

Thanks

---

<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:** [20 February 2020 13:32 UTC](https://discourse.nodered.org/t/find-error-origin-from-node-red-log/22011/2 "2020-02-20T13:32:48Z")

</div>

Use the search / find option - ctrl- or cmd- f - then enter that exec node id - it should then show you it in the list and you can then click on that to jump to it.

---

<div class="post-metadata">

**Author:** ![kaless](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kaless](https://discourse.nodered.org/u/kaless)\
**Post date:** [27 February 2020 09:46 UTC](https://discourse.nodered.org/t/find-error-origin-from-node-red-log/22011/3 "2020-02-27T09:46:30Z")

</div>

Unfortunately, no flow appears in th esearch menu when I search using by Id.

For the first problem, I eventually loacte the issue manually.  
But this is a reccurent problem, now I have the following message, and fail to find its origin:

```auto
27 Feb 10:44:11 - [info] [exec:b6ecca19.86f668] error:Error: spawn /bin/sh EMFILE
27 Feb 10:44:11 - [info] [exec:b6ecca19.86f668] error:Error: spawn /bin/sh EMFILE
27 Feb 10:44:11 - [info] [exec:b6ecca19.86f668] error:Error: spawn /bin/sh EMFILE

```

Could it be that the search function only check flow, and not subflow in use ?

---

<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:** [27 February 2020 10:20 UTC](https://discourse.nodered.org/t/find-error-origin-from-node-red-log/22011/4 "2020-02-27T10:20:46Z")

</div>

If the node logging the error is inside a subflow, the id in the log will be the internally generated id of that particular instance of the node. That makes it impossible for you to map it back to exactly which node logged it.

There are already some improvements coming in 1.0.4 on identifying nodes inside subflows - but this is not a case that is currently handled. I will look to see if we can include more info in the log message (without making it unnecessarily long) to help identify the logging node.

---

<div class="post-metadata">

**Author:** ![kaless](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kaless](https://discourse.nodered.org/u/kaless)\
**Post date:** [27 February 2020 15:21 UTC](https://discourse.nodered.org/t/find-error-origin-from-node-red-log/22011/5 "2020-02-27T15:21:00Z")

</div>

Hey guys, I find a trick allowing you to spot the issue.

First enable "trace" log in settings.js, by default it should be at "info".  
Then restart your node-red instance.

At start up, it will load all flows, subflow and nodes associated. I believe it allocated id to each at this time too.  
For example you will find:

```auto
27 Feb 16:07:28 - [trace] [subflow:1a9af2cb.7ca92d] start subflow
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] start subflow
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] ------------------|--------------|-----------------
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] id | type | alias
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] ------------------|--------------|-----------------
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] 65189990.44f078 | exec | 891a91c.4e9097
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] 33a321ea.be465e | delay | 708d0759.b45fc
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] 272118d1.586dd8 | function | e202fd4d.a3a128
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] 249e6e5f.5d35d2 | function | f9172701.196208
27 Feb 16:07:28 - [trace] [subflow:a3c9aed3.eef0d] 189a1227.4aa1de | function | f43958a7.054988

```

All error will give you the id of the node in question, however as Knolleary said you can search by this id, if the node is in a subflow.  
The trick is to use the idea in the error message:

```auto
27 Feb 16:08:20 - [info] [exec:65189990.44f078] error:Error: spawn /bin/sh EMFILE

```

Check the alias matching that id, in the example:

> exec:65189990.44f078 =\> 891a91c.4e9097

Then use node-red search functionality with the alias (cf dceejay)  
And it will work.  
😄

---

<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:** [12 March 2020 15:21 UTC](https://discourse.nodered.org/t/find-error-origin-from-node-red-log/22011/6 "2020-03-12T15:21:06Z")

</div>

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