Is nodered supposed to crash if a contrib node throws with a catch node?

Hello.
Te question is simple, after updating to nodered 2.x (the latest) it is on a crash loop because a contrib node is throwing an exception. The thing is that I have a catch node attached to it, so how is this happening? Isn't the catch node supposed to behave like a try-catch even for async functions?

Regards

Yes, if the node doesn't catch it's own errors then Node-RED has to exit because it can no longer be sure of the internal state of the node in question.

The Catch node only catches errors explictly thrown by the node using the node.error() function, it will not catch generic uncaught errors from the node in question.

If the node is causing Node-RED to crash you need to raise an issue with it's author to get it fixed

You can use safe-mode to start the runtime but not actually execute the flow until deploy is pressed. This will let you either reconfigure or disable the failing node. (add --safe to the command line)

Yes, that's what I did, open node-red using the safe command. The funny part is that this was previously working (no crash, but raised exception). Has this been changed recently? I didn't updated in a while (3 or so months).

Which node is causing the crash? And can you provide the stack trace from the Node-RED logs when it fails?

Also while in safe mode make sure you update any extra nodes you have installed, Updates should be listed under the "Manage Palette" option

What exactly do you mean by that? An uncaught exception will always crash node red, I believe.

Is the samba node who is giving me trouble: node-red-contrib-smb (node) - Node-RED
Why would I need to check for updates if everything worked good till now? Is there any recent breaking change?

I mean exactly what I meant. This same flow, was doing the very same thing and not crashing node-red, so either node-red has changed how exceptions are captured, or somehow the plugin updated automatically, changed it's code to include a regression and now it doesn't handle exceptions properly, which I don't think it's the case because the latest commit on that node is from 15 Sep 2020, which is older than my installation date.
I'm not saying that nothing has changed, obviously something did, but I can't figure out what and why

When you updated to node-red V2.x, did you also upgrade nodejs?

Can you please provide specific version numbers...

  • before update
    • node-red
    • node js
    • node-red-contrib-smb
  • after update
    • node-red
    • node js
    • node-red-contrib-smb

Lastly, can you please capture the node-red log when it crashes. This will include a stack trace to help us pin point the problem.

I have a few ideas but without details I would only be guessing - but my headspace is at...

  • the underlying SMB lib and newer nodejs issue
  • your old node-red installation of SMB was different?
  • more thoughts (need info)

There have been internal changes to Node-RED, but no changes to the public API, so this implies that the node may not be using the APIs as it's meant to be. But all this is academic, until we see the stack trace we can't actually help.

Please show us exactly how it's failing (The node-red console logs output) so we can see if it is a result of a change or something else. Without the actual details of How Node-RED is crashing we can only guess.

You said previously that it raises an exception but didn't crash, so what do you mean by raising an exception? What did you see in the log?

Hello, I am facing the same issue with SMB node on NodeRed.
Hello.
I am using the operation "Create file" in order to create a new file, & for a new file it works absolutely fine, but when a file with same name already exists, then the complete NodeRed crashes.
Here a screenshot of my log message:

Question:

         case "create":
                    let data = "";
                    if (msg.hasOwnProperty("payload")) {
                        data = msg.payload;
                    }
                    node.statusProcess();
                    node.config.writeFile(filename, data, (err) => {
                       if (err) {
                            node.statusError();
                            done(err);
                            return;
                        }
                        node.statusDone();
                        send(msg);
                        done();
                    });
                    break;

While debugging I found that the code is going into "if (err)" statement above and then returning: [error] Error: STATUS_OBJECT_NAME_COLLISION (0xC0000035) : The object name already exists.
Then suddenly everything stops & Node Red crashes.

I am using the latest version of SMB node from here: GitHub - st-one-io/node-red-contrib-smb: Node of Node-RED for SMB Protocol.

@hardillb @Steve-Mcl Is this a bug in the Code or am I missing something. Please help me out in this. Thanks in advance.

Regards

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