# Mysql stored procedured, node-red stops

**URL:** https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350
**Category:** General
**Created:** [7 May 2021 22:50 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350 "2021-05-07T22:50:28Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![JUANPAVQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juanpavq/32/41488_2.png) [@JUANPAVQ](https://discourse.nodered.org/u/JUANPAVQ)
#### Post date: [7 May 2021 22:50 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/1 "2021-05-07T22:50:29Z")

</div>

Hello community, I have a problem.  
When I do a query to call a stored procedure, node-red stops and I get the following information. I mounted node-red on another pc, I did the installation of the mysql node and I tested with a simple SELECT type query and there are no problems, but when I make a query to call a stored procedure, node-red stops, it is important to comment that with the version 1.2 of node-red and the previous one of the mysql node this problem did not occur. Greetings.

 ![node-red stops](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/4/d42f0c25f4c3c5ced7b27f426eea273d6b08e422.jpeg)  
 ![console](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3e5c2023d0c8dbde4e5af1d35c45c7f31ae1e534.jpeg)  
 ![Node-red version](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/be1447273828459a697b1703004e8bf28457ffc6.jpeg)

Test flow

```auto
[{"id":"2c90e6ab.f63112","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c0da3d58.435548","type":"mysql","z":"2c90e6ab.f63112","mydb":"f0d52b31.059408","name":"","x":340,"y":180,"wires":[["538cb092.52b6b8"]]},{"id":"dd745132.c4f4","type":"inject","z":"2c90e6ab.f63112","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":100,"wires":[["b94af6f6.2ca0e8"]]},{"id":"b94af6f6.2ca0e8","type":"function","z":"2c90e6ab.f63112","name":"","func":"msg.topic=\"CALL `OEE_PROD` ('2020-10-01','2021-05-04',false,'none');\";\n//msg.topic=\"SELECT * FROM `OEE` LIMIT 20;\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":100,"wires":[["55e5851.a9c9ffc","c0da3d58.435548"]]},{"id":"538cb092.52b6b8","type":"debug","z":"2c90e6ab.f63112","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":490,"y":180,"wires":[]},{"id":"55e5851.a9c9ffc","type":"debug","z":"2c90e6ab.f63112","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":520,"y":100,"wires":[]},{"id":"f0d52b31.059408","type":"MySQLdatabase","name":"iotmysql","host":"192.168.1.121","port":"3306","db":"IOTDimatra","tz":"","charset":"UTF8"}]

```

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [8 May 2021 07:38 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/2 "2021-05-08T07:38:08Z")

</div>

This has already been reported here:

> <https://github.com/node-red/node-red-nodes/issues/802>
>
> Hi,
> 
> after updating node-red-node-mysql to version 0.1.8 I noticed that nodere…d is restarting about every minute throwing the following uncaught exception (I have found the issue #763 but I feel like this is a different issue)
> 
> \`\`\`
> May 05 12:09:26 stp-shs Node-RED\[2242\]: 5 May 12:09:26 - \[red\] Uncaught Exception:
> May 05 12:09:26 stp-shs Node-RED\[2242\]: 5 May 12:09:26 - TypeError: v.map is not a function
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at /home/hmcsusr/.node-red/node\_modules/node-red-node-mysql/68-mysql.js:163:75
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Array.map (\<anonymous\>)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Query.\<anonymous\> (/home/hmcsusr/.node-red/node\_modules/node-red-node-mysql/68-mysql.js:163:64)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Query.\<anonymous\> (/home/hmcsusr/.node-red/node\_modules/mysql/lib/Connection.js:526:10)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Query.\_callback (/home/hmcsusr/.node-red/node\_modules/mysql/lib/Connection.js:488:16)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Query.Sequence.end (/home/hmcsusr/.node-red/node\_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Query.\_handleFinalResultPacket (/home/hmcsusr/.node-red/node\_modules/mysql/lib/protocol/sequences/Query.js:149:8)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Query.OkPacket (/home/hmcsusr/.node-red/node\_modules/mysql/lib/protocol/sequences/Query.js:74:10)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Protocol.\_parsePacket (/home/hmcsusr/.node-red/node\_modules/mysql/lib/protocol/Protocol.js:291:23)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Parser.\_parsePacket (/home/hmcsusr/.node-red/node\_modules/mysql/lib/protocol/Parser.js:433:10)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Parser.write (/home/hmcsusr/.node-red/node\_modules/mysql/lib/protocol/Parser.js:43:10)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Protocol.write (/home/hmcsusr/.node-red/node\_modules/mysql/lib/protocol/Protocol.js:38:16)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Socket.\<anonymous\> (/home/hmcsusr/.node-red/node\_modules/mysql/lib/Connection.js:88:28)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Socket.\<anonymous\> (/home/hmcsusr/.node-red/node\_modules/mysql/lib/Connection.js:526:10)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Socket.emit (events.js:314:20)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at addChunk (\_stream\_readable.js:297:12)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at readableAddChunk (\_stream\_readable.js:272:9)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at Socket.Readable.push (\_stream\_readable.js:213:10)
> May 05 12:09:26 stp-shs Node-RED\[2242\]: at TCP.onStreamRead (internal/stream\_base\_commons.js:188:23)
> \`\`\`
> 
> Upon further troubleshooting I tracked the issue down to a few nodes that are calling a stored procedure from the MySQL server every minute. 
> The results of the stored procedure returned by the server is a single line that looks like this:
> \`\`\`
> \# SensorID, SensorNameEN, Type, SensorTimestamp, Current, Max, Min
> '7', 'Exterior', 'TEMPERATURE', '2021-05-05 12:12:50', '19.1', '21.3', '8.6'
> \`\`\`
> 
> The stored procedure works without issues when run via MySQL Workbench and even the nodes were working up until the update of node-red-node-mysql to version 0.1.8.
> 
> Can you please help?
> 
> 
> 
> \- \[\] Node-RED version: 1.3.4
> \- \[\] node.js version: v12.22.1
> \- \[\] npm version: 6.14.12
> \- \[\] Platform/OS: Raspberry Pi 4 (2GB)
> \- \[\] Browser: Firefox 88.0

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [8 May 2021 08:20 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/3 "2021-05-08T08:20:45Z")

</div>

@JUANPAVQ it would be good idea to add a comment and your test flow to the issue so the developers know it is not just a one-off problem.

---

<div class="post-metadata">

### Author: ![JUANPAVQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juanpavq/32/41488_2.png) [@JUANPAVQ](https://discourse.nodered.org/u/JUANPAVQ)
#### Post date: [8 May 2021 15:50 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/4 "2021-05-08T15:50:02Z")

</div>

I don't understand you, attached test flow at the end

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [8 May 2021 16:02 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/5 "2021-05-08T16:02:31Z")

</div>

> [@JUANPAVQ](#):
>
> I don't understand you

I meant to add a comment and your flow to the bug report linked by @hardillb [node-red-node-mysql - Uncaught exception error (TypeError: v.map is not a function) · Issue #802 · node-red/node-red-nodes · GitHub](https://github.com/node-red/node-red-nodes/issues/802)

---

<div class="post-metadata">

### Author: ![JUANPAVQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juanpavq/32/41488_2.png) [@JUANPAVQ](https://discourse.nodered.org/u/JUANPAVQ)
#### Post date: [8 May 2021 16:43 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/6 "2021-05-08T16:43:29Z")

</div>

Ok, i get it, i will.Thanks

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [8 May 2021 17:09 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/7 "2021-05-08T17:09:21Z")

</div>

You should probably include details about your stored procedure and db schema for that procedure as we will need something to test it against.

---

<div class="post-metadata">

### Author: ![JUANPAVQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juanpavq/32/41488_2.png) [@JUANPAVQ](https://discourse.nodered.org/u/JUANPAVQ)
#### Post date: [9 May 2021 20:34 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/8 "2021-05-09T20:34:06Z")

</div>

I already added a comment as you request.  
I uninstalled v0.1.8 and installed v0.1.7 and tested it, it works fine.

---

<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: [8 July 2021 20:34 UTC](https://discourse.nodered.org/t/mysql-stored-procedured-node-red-stops/45350/9 "2021-07-08T20:34:20Z")

</div>

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