Mysql lost connection after INSERT

Hi, I have played with mysql and it worked before last year.
However, last week, I create a simple flow and the the node-red crash after the INSERT. I have tried in a win-32 system and raspberry pi system, same problem.
Please take a look of the video. I assume the mysql 0.1.9 may have problem? How to downgrade the version? Thx

we really need to see the beginning part of the error in the console not the end. so can you just cut/paste the console log here rather than attach a video.

I use a number of the MySQL nodes, same version as yours 0.1.9 without any problem on a RPI-4B.
The database is on a remote server in London, UK.

Here are some screen-shots for an INSERT using a 'template' node to format the query for data collected, via MQTT, from a set of infrared detectors.

Screen Shot 06-18-21 at 11.51 AM

@AK51 as I asked you in the thread I closed (as it was two years old
what version of NR and node.js?
what device is running NR?
what device is running mysql?
what version of mysql?
what is showing in the NR log (do a copy and paste)
a copy of your flow.

Hi all,
Here is a similar video with more details. For the Time_Stamp and laser column, both are VARCHAR(45). Thx

LOG msg
19 Jun 10:50:32 - [info] Starting flows
19 Jun 10:50:33 - [info] Started flows
19 Jun 10:50:39 - [red] Uncaught Exception:
19 Jun 10:50:39 - TypeError: done is not a function
at Query. (/home/pi/.node-red/node_modules/node-red-node-mysql/68-mysql.js:177:29)
at Query. (/home/pi/.node-red/node_modules/mysql/lib/Connection.js:526:10)
at Query._callback (/home/pi/.node-red/node_modules/mysql/lib/Connection.js:488:16)
at Query.Sequence.end (/home/pi/.node-red/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query._handleFinalResultPacket (/home/pi/.node-red/node_modules/mysql/lib/protocol/sequences/Query.js:149:8)
at Query.OkPacket (/home/pi/.node-red/node_modules/mysql/lib/protocol/sequences/Query.js:74:10)
at Protocol._parsePacket (/home/pi/.node-red/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/pi/.node-red/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/pi/.node-red/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/home/pi/.node-red/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/home/pi/.node-red/node_modules/mysql/lib/Connection.js:88:28)
at Socket. (/home/pi/.node-red/node_modules/mysql/lib/Connection.js:526:10)
at Socket.emit (events.js:189:13)
at addChunk (_stream_readable.js:284:12)
at readableAddChunk (_stream_readable.js:265:11)
at Socket.Readable.push (_stream_readable.js:220:10)
pi@ubuntu:~ $

This is a good clue. done() is a newer node-red feature.

What version of node-red are you running?

The node red version is v0.20.8

Ok, without looking at the source for node-red-node-mysql, I am fairly confident this is an oversight. You should raise an issue.

However, if you can upgrade node-red this problem will disappear.

I have updated the node-red and it is ok now.
I have also tried in the win32 system, it works too.
Thx for everyone's help.
Cheers. :>

It's worth reading the News channel to get info about the latest releases of Node-RED (and any issues).

This is what you need to do to update to the latest release of Node-RED running on a Raspberry Pi.

I did the upgrade and the version is v1.3.4.
Anyway, it works now. Thx

Well done and thanks for letting us know.

EDIT: Did you include @next on the end of the command as my version of Node-RED is at 2.0.0beta1

Screen Shot 06-19-21 at 05.33 AM

I don't think the next version is necessary to sort this problem, just the current release.

Yes I realise that - I was just pointing out that there is a later version availlable.

@dceejay regarding this issue...

The op has confirmed updating node-red has solved his issue. This definitely looks like node-red-node-mysql isn't checking done before calling it. Just thought I'd tag you in case you missed this thread or the op doesn't raise an issue

1 Like

By the way, I have a running node-red system in a remote area, it seems risky to upgrade the node-red version comparing with installing an older version of mysql node.
Is it possible to install mysql node with lower version? There is no selection in UI, right?

I have tried to install older version using this:
I deleted all flow, and uninstall in mysql in manage palette
npm install node-red-node-mysql@0.1.7
restart the computer but the mysql is not there. May I know the proper procedure? Not sure if I did it right. I can try it again.


You should have asked first - that was a fair bit OTT.

You simply needed to cd into the .node-red folder (that's important) then run npm install node-red-node-mysql@0.1.7 then restart node-red.

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