I have a flow where I do some HTTP post using axios library (in function node). I attached a debug node to output. Function node makes http call, and sets the result object as payload and sends it forward to debug node. That debug node is set to display full msg object.
However, randomly I see following error on node-red side debug pane. This error points to "debug" node (not function node). Instead of debug node title "msg : Object" it is "msg: error" and then it shows following error
remaining part is followed by json representation of full message object.
This doesn't seem to originate from my function node because
The debug message points to debug node and not function node (it carries name of debug node, and when I hover over name , debug node gets highlighted in center pane and not function node)
I do not have any property called "reading" in my function node.
Any ideas what could be wrong ? Is there some kind of race condition (unresolved promise?) in debug node which is not able to handle some thing in incoming payload ? Mind you that result payload generated in function node is generated using 'await axios..' so any network IO related to axios would have already resolved.
Try puttting some node.warn() statements in your function node to display what is being used to build the msg being sent out.
example: node.warn("xxx="+xxx); if xxx = '34, you should see xxx=34 in the debug sidebar.
Also, could you post your function and a screenshot of the debug please?
What hardware/OS are you running on and what version of node red and nodejs?
The node red version is at the bottom of the menu dropdown and the nodejs version by node -v
in a terminal
With function and axios I can do lot more complex logic. Using http node will make it very laborious (will have to use function node anyways to process cookies and data before next call)
Also AFAIK, async/await is just syntactic sugar over promise/then so not sure if it will make any difference. I am leaning towards hunch that some of promises within response object may have not resolved fully or there might be a stream/socket which is not fully closed by the time it gets to debug node