Uncaught exception from mysql nodes

Hi !

Is there anyone, who has some experience with the mysql node? My problem the whole node-red randomly shutting down thanks to a uncaught exception, which caused by the mysql node.

Here it is a screenshoot, about what exactly happend.

Someone know how the fix that ? Because it's very anoing problem, and thanks for that the whole system is unstable.

Which mysql node are you using?
Which version of node red?
Which version of nodejs? Use node -v to find out.

Edit: Also which version of the mysql node?

mysql node: node-red-node-mysql v0.1.1
node red: v1.2.7
node js: v12.19.0

What device is NR running on?
What device is MySQL running on?
Do you know if the database has restrictions on it? (like time limits for connections - if this is a corporate DB you may have to talk to your DBA))
How often are you using the node?

The NR and the MySQL is running on the same device, which is currently my laptop. It's running Win 10 and the MySQL is running as part of the XAMPP.

Currently i dont know that, have any time limit set in the SQL, but i will definitely check it.

If your last question is tend to, how often use the sql nodes, then my answer is pretty often. My devices, which running on batteries every 3 minutes send message and then doing insert with data which send it. Then few seconds later the system doing a select query. Both the select and the insert query i use separate mysql nodes.

Can I assume these devices are sensors of some type. Doing an insert every three minutes shouldn’t be a problem. Does the laptop ever go to sleep or go into a reduced power mode?

No. I disabled that reason.

Why are you using separate nodes for the insert and select?

I noticed that, if i use the same node for the select and the insert it cause some trouble.

Whatever the cause of the error, it should not crash node-red, I think that in itself shows that there is a problem in node-red-node-mysql as it is not catching the error correctly.

1 Like

Yeah, i think that too. Do you know any alternative mysql node ?

No, but that node is maintained by the core developers, so it may well receive attention quite quickly. I suggest submitting an issue here.

what kind of trouble?

When i send a insert query to node, from the node output got a object. which i don't need and the handle is cumbersome.

What do you mean it is cumbersome

by all means raise it as an issue so we have it logged and tracked, - but as a) we don't use it regularly, b) the crash only seems to occur occasionally, c) no use case to demonstrate the error d) the error listed looks to be in the underlying library, and e) databases are not my area of expertise - I'm going to say that it may sit there a long time unless someone else is prepared to step up and help.

Should not every call into the library be surrounded by try, catch? Or is it not that simple with async functions?

indeed - not when they are thrown asynchronously.

Elarobate if it's more understandable. Handling what we got from the mysql node when i insert i found dificult so i simple use separate nodes for both inserts and the selects.