abreits / node-red-contrib-amqp

Node-RED AMQP input and output nodes
16 stars 18 forks source link

Cannot assign to read only property 'writeQueueSize' of object '#<TCP>' module=amqp-ts #23

Open faisalthaheem opened 5 years ago

faisalthaheem commented 5 years ago

Hello Thank you for this excellent node. Whenever connecting more than 1 nodes to the output of AMQP Input node the subject error is thrown.

Here is a more descriptive output from nodered nodered_1 | error: Queue.onMessage consumer function returned error: Cannot assign to read only property 'writeQueueSize' of object '#' module=amqp-ts

Here is some more when connected differently nodered_1 | 11 Jun 00:05:27 - [error] [switch:d903e45c.b0b468] TypeError: Cannot assign to read only property 'writeQueueSize' of object '#' nodered_1 | at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:16) nodered_1 | at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18) nodered_1 | at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18) nodered_1 | at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18) nodered_1 | at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18) nodered_1 | at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18) nodered_1 | at clone (/usr/src/node-red/node_modules/clone/clone.js:202:10) nodered_1 | at Object.cloneMessage (/usr/src/node-red/node_modules/@node-red/util/lib/util.js:90:13) nodered_1 | at SwitchNode.Node.send (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:199:61) nodered_1 | at applyRules (/usr/src/node-red/node_modules/@node-red/nodes/core/logic/10-switch.js:441:42) nodered_1 | at applyRule (/usr/src/node-red/node_modules/@node-red/nodes/core/logic/10-switch.js:224:17) nodered_1 | at getV2 (/usr/src/node-red/node_modules/@node-red/nodes/core/logic/10-switch.js:199:17) nodered_1 | at getV2 (/usr/src/node-red/node_modules/@node-red/nodes/core/logic/10-switch.js:168:13) nodered_1 | at getV1 (/usr/src/node-red/node_modules/@node-red/nodes/core/logic/10-switch.js:181:13) nodered_1 | at /usr/src/node-red/node_modules/@node-red/nodes/core/logic/10-switch.js:141:21 nodered_1 | at Object.evaluateNodeProperty (/usr/src/node-red/node_modules/@node-red/util/lib/util.js:540:9)

Thanks

nivg1992 commented 4 years ago

Hi, I tried to investigate the error, the cause of the problem is because of the NodeRed clone the object that "node.send" delivered. the problematic variable amqpMessage: msg on AmqpIn function, this is a complex variable and the clone fails on it. I deleted the variable and it starts receiving messages.

faisalthaheem commented 4 years ago

Thank you for the fix. I tried with the newer version (in docker) but am getting this error after building my image [node-red-contrib-amqp/amqp] Error: /usr/src/node-red/node_modules/node-red-contrib-amqp/lib/amqp.html does not exist

As there is already an issue open for the above, I'll try again once I'm able to install and run