I am seeing this error when I use the `q-gate` node and am told to ask here

I have this node installed:

node-red-contrib-queue-gate

I am seeing errors in my flows - I think at boot - and when raised with the writer they say it is a problem outside the node's scope.

The error message you've been getting is produced by the JavaScript interpreter when it doesn't know what to do. The older versions of q-gate would throw an error for certain inputs that are now ignored. You probably should check to see that your flow behaves properly, since the node may be ignoring instead of acting on those inputs.

This is the error I am seeing:

{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"7bc998b7.b8c538","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"93d25089.579ef8","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"93d25089.579ef8","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"93d25089.579ef8","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"7bc998b7.b8c538","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"7bc998b7.b8c538","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"7bc998b7.b8c538","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"93d25089.579ef8","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"93d25089.579ef8","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}
{"message":"TypeError: msg.payload.toLowerCase is not a function","source":{"id":"93d25089.579ef8","type":"q-gate","name":"qgate","count":1},"stack":"TypeError: msg.payload.toLowerCase is not a function\n    at QueueGateNode._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:79:37)\n    at hooks.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)\n    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)\n    at QueueGateNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)\n    at QueueGateNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)\n    at QueueGateNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)\n    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)"}

All Greek to me.

But I am asking if someone can help me understand what is going on and why.

Is this the same issue that was raised (by you?) on GitHub? The conclusion of that discussion was

No problems. It is now resolved.

If you follow the advice given there -- to update the node to the most recent version -- and still get errors, please post your flow here or on GitHub so that I can troubleshoot.

This is part 1 of the flow:

[{"id":"a5ed4200.92e43","type":"link in","z":"9b7e7466.a4b698","name":"EVENT OCCURENCE *","links":["46440cf6.959644","5eb89375.770fac"],"x":2620,"y":3440,"wires":[["261ee7e6.1ddd68","7bc998b7.b8c538"]],"l":true,"info":"This is input from local flows."},{"id":"4217b62a.013ed8","type":"inject","z":"9b7e7466.a4b698","name":"Next","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CONTROL","payload":"trigger","payloadType":"str","x":2680,"y":3480,"wires":[["7bc998b7.b8c538"]],"icon":"node-red/trigger.svg"},{"id":"9c9a1676.59684","type":"inject","z":"9b7e7466.a4b698","name":"RESET","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CONTROL","payload":"reset","payloadType":"str","x":2680,"y":3520,"wires":[["7bc998b7.b8c538"]],"icon":"font-awesome/fa-eject"},{"id":"7bc998b7.b8c538","type":"q-gate","z":"9b7e7466.a4b698","name":"qgate","controlTopic":"CONTROL","defaultState":"queueing","openCmd":"Go","closeCmd":"Stop","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","maxQueueLength":"0","keepNewest":true,"qToggle":false,"persist":false,"x":2850,"y":3480,"wires":[["714a933c.9748f4"]]},{"id":"714a933c.9748f4","type":"debug","z":"9b7e7466.a4b698","name":"Event messages","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":3080,"y":3480,"wires":[]}]

This is part 2

[{"id":"c9fcd7b7.4cf108","type":"function","z":"a1911aa3.c45be8","name":"ID & colour","func":"flow.set(\"REBOOT_DETECTED\",true);\n\nmsg.payload = {who: \"Reboot\",\n       colour: \"red\"};\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":1880,"wires":[["5eb89375.770fac","7c7e2b5.211a954"]]},{"id":"55912407.132434","type":"inject","z":"a1911aa3.c45be8","name":"Test","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":550,"y":1880,"wires":[["c9fcd7b7.4cf108"]]},{"id":"315b5919.ef5426","type":"json","z":"a1911aa3.c45be8","name":"","property":"payload","action":"","pretty":false,"x":550,"y":1730,"wires":[["3705c630.790432","a52dc807.33419","3c727657.fcbca2","c9fcd7b7.4cf108"]]},{"id":"381b69a8.680ffe","type":"mqtt in","z":"a1911aa3.c45be8","name":"Reboot detected","topic":"EVENT/machine_reboot_detected/#","qos":"2","datatype":"auto","broker":"1ecd3a9e.dc5bfd","x":360,"y":1730,"wires":[["315b5919.ef5426"]]},{"id":"1ecd3a9e.dc5bfd","type":"mqtt-broker","name":"TelePI MQTT","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"SOM","birthQos":"0","birthPayload":"TelePi comms up","closeTopic":"EOM","closePayload":"TelePi shutting down","willTopic":"EOM","willQos":"0","willPayload":"TelePi Comms Failure"}]

Part 3:

[{"id":"46440cf6.959644","type":"link out","z":"c56bddee.ca0a18","name":"EVENT Occurance","links":["a5ed4200.92e43"],"x":3550,"y":2290,"wires":[],"l":true},{"id":"afb48eb6.7d73d","type":"link in","z":"c56bddee.ca0a18","name":"EVENT occurance","links":["249bd751.15e768","45aa95da.115414","ad31a68b.9c7a8","e9365858.269aa","94bb5512.ace278"],"x":3255,"y":2290,"wires":[["970addfe.43d85","31e10d27.18be62","46440cf6.959644","93d25089.579ef8"]]},{"id":"45aa95da.115414","type":"link out","z":"c56bddee.ca0a18","name":"","links":["afb48eb6.7d73d"],"x":3175,"y":2290,"wires":[]},{"id":"6ace3fd4.677748","type":"function","z":"c56bddee.ca0a18","name":"ID & colour","func":"//      2019-9-20\n//      Attempt to stop erroneous event logging\n//      of wifi status.\n\nif (msg.topic == \"TIMESTAMP\")\n{\n    return;\n}\n\nmsg.payload = {who: \"SOM message\",\n       colour: \"yellow\"};   // 2020 11 19 changed `payload` to `colour`\nreturn msg;","outputs":1,"noerr":0,"x":3060,"y":2290,"wires":[["45aa95da.115414"]]},{"id":"3198aea7.53cb3a","type":"inject","z":"c56bddee.ca0a18","name":"Test","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"TEST","payloadType":"str","x":3040,"y":2250,"wires":[["6ace3fd4.677748"]]}]

I hope the link nodes connect to one another.

event occurrence nodes are all linked.

Is that enough of the flow?
(the rest is big - so don't say I didn't say)

But I hope you can see what it is doing and used for.

Add a debug node showing what is going into the node (complete message) and see what is in the message causing the problem. There is probably something wrong with that message.

Yes, I do agree. But this seems to happen on boots. I think.

I have a debug node as shown.

But if it is happening on boot, will that message be shown?
Yeah, ok the debug node isn't active now. I could activate it and reboot/restart node-red and see what happens I guess

Configure the debug to send to console then you will see it in the node red log after boot.

Thanks.

I don't want to do it just now. A bit later.

So when it "saves it to the log"...... Sorry, but which log and where is it stored?

node-red-log

(path?) /user/sys/log?

Rebooted, and typically no error happened. :frowning:

Run the command I posted or look in /var/log/syslog

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