Issue with node-red-context-monitor and Node-RED 5

Just switched to this (on previous install that was running the beta) and getting an error message with my q-gate nodes (node-red-contrib-queue-gate) that I've not noticed before.

Not declaring a fault just yet with NR5 but just putting it here in case someone else is seeing the same.

Doing further testing.
[edit] It's throwing an error when I send it a control queue command. open/close work fine. Doesn't happen in a NR 4.1.10 install

This could be related to node-red-context-monitor. I'll check...

[edit] @cymplecy Could you please post the full error message? What's the version of node-red-context-monitor running on this system?

2.0.0.

Looking back in my logs - I did update this after I upgraded to NR 5

TypeError: Cannot read properties of undefined (reading 'length')
    at /home/simon/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:171:68
    at callback_wrapper (/home/simon/.node-red/node_modules/@ralphwetzel/node-red-context-monitor/lib/monitor.js:212:25)
    at Memory.get (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/context/memory.js:81:18)
    at LocalFileSystem.get (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/context/localfilesystem.js:256:27)
    at Object.value (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/context/index.js:328:33)
    at Proxy.value (/home/simon/.node-red/node_modules/@ralphwetzel/node-red-context-monitor/lib/monitor.js:215:29)
    at QueueGateNode._inputCallback (/home/simon/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:83:21)
    at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:214:26
    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
    at Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:206:11)
    at Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:190:25)
    at Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:506:10)
    at deliverMessageToDestination (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:824:40)
    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:840:21)
    at process.processImmediate (node:internal/timers:504:21)

I can confirm this is related to node-red-context-monitor. A fix will be available within the next day(s)...

NB: Someone with appropriate privileges should push this exchange into a dedicated topic...

I removed node-red-context-monitor (as wasn't actually using it AFAICT) and issue has gone away

Quick update: Issue due to the fact that node-red-contrib-queue-gate gets/sets multiple context keys in one function call. I wasn't aware - until today - this is possible!

I've just pushed an update (v2.1.0) for node-red-context-monitor. It would be great if you find a moment to check if this version fixes the issue you saw.

BTW: v2.1.0 adds, among other features, as well context store awareness.

Just installed it - restarted node-red - got this in log after install
image
restarted NR - got this after I added the node to a flow


Uninstalled - restarted NR - reinstalled - same problem - currently uninstalled again

Thank you for your support and your patience.
v2.1.1 is available addressing this latest issue.
Feedback welcome!

2.1.1 has loaded OK :slight_smile:

I've added one of them to a flow and q-gate is still working OK :slight_smile:
[edit]Might have spoken too soon ...

I just tried sending a trigger message to a q-gate node in queue mode and got this error message

ReferenceError: previous_value is not defined
    at Object.deleteProperty (/home/simon/.node-red/node_modules/@ralphwetzel/node-red-context-monitor/lib/monitor.js:388:89)
    at Reflect.deleteProperty (<anonymous>)
    at Object.deleteProperty (/home/simon/.node-red/node_modules/@ralphwetzel/node-red-context-monitor/lib/monitor.js:374:52)
    at Proxy.shift (<anonymous>)
    at Proxy.prop_chain (/home/simon/.node-red/node_modules/@ralphwetzel/node-red-context-monitor/lib/monitor.js:260:76)
    at /home/simon/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:130:49
    at callback_wrapper (/home/simon/.node-red/node_modules/@ralphwetzel/node-red-context-monitor/lib/monitor.js:422:29)
    at Memory.get (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/context/memory.js:81:18)
    at LocalFileSystem.get (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/context/localfilesystem.js:256:27)
    at Object.value (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/context/index.js:328:33)
    at Proxy.value (/home/simon/.node-red/node_modules/@ralphwetzel/node-red-context-monitor/lib/monitor.js:430:29)
    at QueueGateNode._inputCallback (/home/simon/.node-red/node_modules/node-red-contrib-queue-gate/q-gate.js:83:21)
    at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:214:26
    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
    at Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:206:11)
    at Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:190:25)
    at Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:506:10)
    at deliverMessageToDestination (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:824:40)
    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:840:21)
    at process.processImmediate (node:internal/timers:504:21)

Normal open/close/queuing seems to be working OK

Looks like your node is a perfect test bench for node-red-context-monitor. :+1:
I've fixed this issue - and a few others on top. => v2.1.2

Trigger issue sorted :slight_smile: