... so it was failing to connect - then retrying ? in a tight loop ? If so then ideally an issue should be raised against the node so it can be fixed to only retry at a sensible rate.
Thanks Dave,
It was a very tight loop, errors were basically being streamed very rapidly, seemingly many times a second. I had it on my list to do today after I had repeated the problem.
EDIT: Done
Was the loop in your flow or was the node misbehaving?
The Node was misbehaving. No loop involved in the flow.
When configured correctly, debug showed a message on the expected cycle. Misconfigured Node, Catch errorās were jamming up the Debug display, couldnāt see the cycle time, but I estimated in excess of 50 per second, but that was just by counting the Debug messages. I was not able to open any Debug Message to see what the actual error was.
Was the catch node wired to anything other than the debug node? If so are you sure your flow was not feeding back and retrying?
Because of the problem, I had isolated down to a single flow that ended with in InfluxDB In Node connected to nothing on the output.
I think you are trying this as you appear to have identified something that I missed!
[{"id":"f1e27c71266aabbd","type":"change","z":"2257036dd7be6bb0","name":"flow/msg","rules":[{"t":"set","p":"pzem","pt":"flow","to":"payload","tot":"msg"},{"t":"set","p":"pzem","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":240,"wires":[["3d392665a28e9ee8","ac2da185aa281f7b"]]},{"id":"3d392665a28e9ee8","type":"function","z":"2257036dd7be6bb0","name":"pzem/elecCurrentRate","func":"flow.set('resetTimeFlag', 0); //Resets reset flag\nlet pzem = flow.get('pzem');\nlet logTime = flow.get('pzem.Time');\n\n//Calibration\nlet total = pzem.ENERGY.Total;\nglobal.set('energy.Total', total)\nlet voltsOffset = pzem.ENERGY.Voltage; //.toFixed(3)\nlet freqOffset = pzem.ENERGY.Frequency; //.toFixed(3);\ntotal = (total - 88.29) * 1.02225225; //201013 reading\nvoltsOffset = voltsOffset * 0.9923;\nfreqOffset = freqOffset + 0.06;\nfreqOffset = freqOffset;\nglobal.set('energy.Power', pzem.ENERGY.Power);\nglobal.set('yesterday', pzem.ENERGY.Yesterday);\nglobal.set('energy.Yesterday', pzem.ENERGY.Yesterday);\nglobal.set('energy.Today', pzem.ENERGY.Today);\n\n/*\nlet validFrom;\nlet validTo;\nlet elecAgileRate;\nlet elecCurrentRate;\nlet goCurrentRate;\nlet currentSlotTime;\nlet index;\n\nlet goTariffResults = global.get('goTariffResults', \"storeInFile\");\n\nlet now = new Date().getTime();\nlet i;\n\nfor(i = 0; i < goTariffResults.length; i++){\n validFrom = Date.parse(goTariffResults[i].valid_from);\n validTo = Date.parse(goTariffResults[i].valid_to);\n \n if (now >= validFrom && now < validTo) {\n elecCurrentRate = goTariffResults[i].value_inc_vat;\n }\n}\n\nglobal.set('goElecCurrentRate', elecCurrentRate, 'storeInFile')\nmsg.payload = elecCurrentRate;\n\n\nlet slotsDay = global.get('slotsDay', 'storeInFile');\n//elecAgileCurrent\nfor(i = 0; i < slotsDay.length; i++){\n validFrom = slotsDay[i].valid_from;\n validTo = slotsDay[i].valid_to;\n if (now >= validFrom && now < validTo) {\n elecAgileRate = slotsDay[i].value_inc_vat;\n }\n}\n\nglobal.set('agileCurrentRate', elecAgileRate, 'storeInFile')\n*/\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":260,"wires":[["0e2f69062a85133e","501cc6719f336812","1efbcfc7173caa90"]]},{"id":"0e2f69062a85133e","type":"link out","z":"2257036dd7be6bb0","d":true,"name":"Current Rate","mode":"link","links":[],"x":765,"y":220,"wires":[]},{"id":"501cc6719f336812","type":"debug","z":"2257036dd7be6bb0","name":"debug 7","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"pzem","targetType":"msg","statusVal":"","statusType":"auto","x":600,"y":220,"wires":[]},{"id":"d41b7ee5a9d9513a","type":"debug","z":"2257036dd7be6bb0","name":"debug 75","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1000,"y":220,"wires":[]},{"id":"9c64ae4c5be0bcbe","type":"catch","z":"2257036dd7be6bb0","name":"Mon Energy Catch All","scope":["1efbcfc7173caa90"],"uncaught":false,"x":760,"y":160,"wires":[["aa8898682a91de89","9c23b6362320ba9e"]]},{"id":"aa8898682a91de89","type":"debug","z":"2257036dd7be6bb0","name":"Mon NRG","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":960,"y":160,"wires":[]},{"id":"9c23b6362320ba9e","type":"function","z":"2257036dd7be6bb0","d":true,"name":"Log2Context","func":"var contextname = \"Monitor Energy_log\";\n\nvar log = flow.get(contextname) || [];\n\nvar logEntry = {\n msg: RED.util.cloneMessage(msg),\n time: new Date()\n}\n\nlog.push(logEntry);\n\nflow.set(contextname, log);\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":160,"wires":[[]]},{"id":"1efbcfc7173caa90","type":"influxdb in","z":"2257036dd7be6bb0","influxdb":"10f615662504d919","name":"Get pzem last 1","query":"SELECT * FROM power GROUP BY * ORDER BY DESC LIMIT 1","rawOutput":false,"precision":"s","retentionPolicy":"","org":"","x":860,"y":260,"wires":[["d41b7ee5a9d9513a"]]},{"id":"de24a989dbd9d2b4","type":"debug","z":"2257036dd7be6bb0","name":"PZEM","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":250,"y":220,"wires":[]},{"id":"e54a91bba1bbe72b","type":"link in","z":"2257036dd7be6bb0","name":"PZEM In","links":["554a46ec0b3f4817"],"x":175,"y":260,"wires":[["de24a989dbd9d2b4","3121d908e2a3f225","c4a7d8710f9f352d"]]},{"id":"3121d908e2a3f225","type":"switch","z":"2257036dd7be6bb0","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"tele/PZEM004/SENSOR","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":260,"wires":[["f1e27c71266aabbd"],[]]},{"id":"933695eca5ec17f2","type":"inject","z":"2257036dd7be6bb0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":820,"y":200,"wires":[["1efbcfc7173caa90"]]},{"id":"10f615662504d919","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"meters","name":"","usetls":false,"tls":"","influxdbVersion":"1.x","url":"","timeout":"","rejectUnauthorized":false},{"id":"8d53d7c0337da6d3","type":"global-config","env":[],"modules":{"node-red-contrib-influxdb":"0.7.0"}}]
Although I disconnected the Node from any other Nodes in the Flow, I did not point the Catch Node at ONLY the InfluxDB Input Node, it was still able to āseeā the other Nodes. Setting the Catch Node to only the InfluxdB Node gives one error per input message, what I would have expected.
{"topic":"tele/PZEM004/SENSOR","payload":{"Time":"2026-02-24T09:54:49","ENERGY":{"TotalStartTime":"2020-05-13T18:49:31","Total":21764.275,"Yesterday":12.848,"Today":5.034,"Period":1,"Power":301,"ApparentPower":495,"ReactivePower":392,"Factor":0.61,"Frequency":50,"Voltage":245.1,"Current":2.018}},"qos":0,"retain":false,"_msgid":"a32d2649c68dd11a","_event":"node:554a46ec0b3f4817","pzem":{"Time":"2026-02-24T09:54:49","ENERGY":{"TotalStartTime":"2020-05-13T18:49:31","Total":21764.275,"Yesterday":12.848,"Today":5.034,"Period":1,"Power":301,"ApparentPower":495,"ReactivePower":392,"Factor":0.61,"Frequency":50,"Voltage":245.1,"Current":2.018}},"influx_error":{"statusCode":503},"error":{"message":"Error: connect ECONNREFUSED 127.0.0.1:8086","source":{"id":"1efbcfc7173caa90","type":"influxdb in","name":"Get pzem last 1","count":1},"code":"ECONNREFUSED","stack":"Error: connect ECONNREFUSED 127.0.0.1:8086\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16)"}}
I donāt understand how the Error Message is repeated many times by the Catch Node when it is seeing the other Nodes, but not when only one selected? I have repeated this many times to try to find the error, so I know the error is real.
OK, I am really confused now. Just gone back (after defining single InfluxDB In Node for the Catch Node) to get a snapshot of the repeating Error Messages when misconfigured and all is behaving as I would expect, one error per input message!
This error was repeatable when only changing from valid InfluxDB server to invalid Server with the Catch Node pointing at all Nodes. Now, after selecting a single Node in the Catch Node, going to an invalid Server acts as I think it should - one error message per input. Tested several times! Why?
It now appears this is a none issue, but I am completely confused as to why!
EDIT: Correction and note written on Nodeās Github.
Just to clarifyā¦
OK, I am really confused now. Just gone back (after defining single InfluxDB In Node for the Catch Node) to get a snapshot of the repeating Error Messages when misconfigured and all is behaving as I would expect, one error per input message!
I pointed the Catch Node to all Nodes again to show the repeating error messages. Things now work as they should!