Http response node "Error: Callback called multiple times"

Hi everyone,

I have a somewhat lengthy- and complex flow that I am willing to share if the troubleshooting process requires it; but for now I will do a simplification/get rid of the unimportant details.

Basically I have a flow

  1. http in node
  2. that forwards the incoming request into some function nodes
  3. that then call some http request and validate their response
  4. and then return the original msg with a payload (obtained from steps [2/3]) to a http response node (this response node being "the pair" of the http in of step [1])

For no apparent reason; after the application has been running for a while; the http response node of step [4] starts reporting the error. The error happens 100% of the time/for each message.

Error: Callback called multiple times

The error DOES NOT cause the http response to stop working: the node is still returning the http request to the requester. It is just annoying, is polluting logs and I suspect (can't confirm) is causing some kind of resource leak that causes the application to break/crash after some time.

What gives? Is there any known reason that may cause this behavior?

Some additional info:
1- The http response is indeed only being called once (at the end of the flow).
2- The original message from http in (with properties _msgid, req, res) is the same message that goes into http response node.

There was an issue in certain versions of NodeJS - what version are you running?

PS, welcome to the forum & great first question (well structured, just the right amount of detail :wink: )

Oh, that could be it. A lot of google searches suggested so; but then it was a rabbit hole because 1000s different people had 1000s different fixes/workaround.

This specific environment is running NR 1.3.55 with DockerImage FROM node:12, so yea, quite outdated. I will see if I can upgrade it without a major headache and I will see if that does the trick.

But at the same time, worth stating, we also have 6~ other environments that are also running the same version for node and NodeRED and they are NOT triggering the error (all of them do have similar flows with http in/http response).

(Thanks for the welcome message!)