It looks like this:
So yes, the path is from a known Http In node, which is queried every 10 seconds
A new error appeared today (in the same endpoint):
kaalut-node-red | RangeError: Maximum call stack size exceeded
kaalut-node-red | at write (console.js:168:9)
kaalut-node-red | at Console.log (console.js:200:3)
kaalut-node-red | at trim_prefix (/usr/src/node-red/node_modules/express/lib/router/index.js:289:13)
kaalut-node-red | at /usr/src/node-red/node_modules/express/lib/router/index.js:284:7
kaalut-node-red | at Function.process_params (/usr/src/node-red/node_modules/express/lib/router/index.js:336:12)
kaalut-node-red | at next (/usr/src/node-red/node_modules/express/lib/router/index.js:275:10)
kaalut-node-red | at compression (/data/node_modules/compression/index.js:220:5)
kaalut-node-red | at Layer.handle [as handle_request] (/usr/src/node-red/node_modules/express/lib/router/layer.js:95:5)
kaalut-node-red | at trim_prefix (/usr/src/node-red/node_modules/express/lib/router/index.js:318:13)
kaalut-node-red | at /usr/src/node-red/node_modules/express/lib/router/index.js:284:7
kaalut-node-red | RangeError: Maximum call stack size exceeded
kaalut-node-red | at Object.formatWithOptions (util.js:75:27)
kaalut-node-red | at Console.(anonymous function) (console.js:191:15)
kaalut-node-red | at Console.log (console.js:202:31)
kaalut-node-red | at trim_prefix (/usr/src/node-red/node_modules/express/lib/router/index.js:289:13)
kaalut-node-red | at /usr/src/node-red/node_modules/express/lib/router/index.js:284:7
kaalut-node-red | at Function.process_params (/usr/src/node-red/node_modules/express/lib/router/index.js:336:12)
kaalut-node-red | at next (/usr/src/node-red/node_modules/express/lib/router/index.js:275:10)
kaalut-node-red | at Layer.handle_error (/usr/src/node-red/node_modules/express/lib/router/layer.js:67:12)
kaalut-node-red | at trim_prefix (/usr/src/node-red/node_modules/express/lib/router/index.js:316:13)
kaalut-node-red | at /usr/src/node-red/node_modules/express/lib/router/index.js:284:7
It happened after I made some changes in the flow:
In the flow, there's a KV store read, result was sent to a function node that deleted some req.query.headers fields.
I set up another function node after the KV read, and that part stopped working, most probably because it was not using a copy of msg, so some headers where now missing in the second part.
But according this, messages are cloned by default so this should not happen ? Removing the delete msg.req.headers in the first part solved the problem in the second.
Now this is confusing:
I tried to pass the message in the "node.send()" node in 3 ways:
- return msg;
- node.send(msg, false);
- node.send(msg, true);
The "Delete" node deletes msg.req.query.uid. In all the cases, msg.red.query.uid is removed in the "Do nothing" node.
The flow:
[{"id":"14cd7d66.588e33","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8968cc4c.3244f8","type":"http in","z":"14cd7d66.588e33","name":"","url":"/test","method":"get","upload":false,"swaggerDoc":"","x":260,"y":200,"wires":[["ce86c557.c1991","e41bebf2.226108","a40ad3ef.06da1"]]},{"id":"e41bebf2.226108","type":"debug","z":"14cd7d66.588e33","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":450,"y":140,"wires":[]},{"id":"ce86c557.c1991","type":"http response","z":"14cd7d66.588e33","name":"","statusCode":"","headers":{},"x":450,"y":260,"wires":[]},{"id":"c6d0808c.2d4e08","type":"debug","z":"14cd7d66.588e33","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":810,"y":160,"wires":[]},{"id":"4d7be408.6d20d4","type":"debug","z":"14cd7d66.588e33","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":810,"y":240,"wires":[]},{"id":"a40ad3ef.06da1","type":"function","z":"14cd7d66.588e33","name":"node.send()","func":"// node.send(msg, false);\n\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":200,"wires":[["3e7d50ce.e7d1d","6689df7f.67ad18"]]},{"id":"6689df7f.67ad18","type":"function","z":"14cd7d66.588e33","name":"Delete","func":"delete msg.req.query.uid;\n\nreturn msg;","outputs":1,"noerr":0,"x":630,"y":160,"wires":[["c6d0808c.2d4e08"]]},{"id":"3e7d50ce.e7d1d","type":"function","z":"14cd7d66.588e33","name":"Do nothing","func":"\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":240,"wires":[["4d7be408.6d20d4"]]}]
msg.req
never gets cloned - it is a special edge case in all the cloning logic because it includes unclonable objects from the underlying HTTP library.
Ok, good to know. Maybe need some documentation about the edge cases ? Thanks !
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.