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?
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).
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
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.
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:
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.