HTTP request fails depending on message origin?

I have a flow that sends events to ntfy.sh. I have a certain type of event that fails most of the time with "no response from server".

Using wireshark I have confirmed that the TCP connection is established, but no request is ever sent.

Other types of messages (including a message reporting the above failure, picked up with the catch node) seem to work fine.

It looks like I have narrowed it down to be reproduced, such that:

  • It fails when the message originates from a Shelly node, and passes through a few other nodes before being prepared in a change node.
  • It seems to succeed when the same change node, that constructs the HTTP payload is triggered with an inject node.

These two messages logged to the debug console (as full message objects) are identical. Could there be something more on the message objects, which is not logged in the console, but that could cause this issue.

Using Node-RED 4.0.9

Before doing anything else I suggest updating the latest release, which is 4.1.5 I think. It may well not make any difference, but you will feel silly if you waste a lot of time then it turns out to be this problem.

So sometimes it works? If so then perhaps it is a timing problem? Has the previous message you sent to node completed?

It actually looks like - at first glance - that upgrading to 4.1.5 solved the issue.

Normally I am reluctant to upgrade, if there is no mention of something that might fix a specific issue that I am having, as this can be considered a production system.

So it looks like maybe there was something wrong in the HTTP request node in v4.0.9, which is fixed now.

The other thing that may trip things up is if the output of the first node includes things like

  • msg.headers
  • msg.method
  • msg.url

msg.headers is the usual problem, e.g. http-in -> function node -> http-request -> http-reponse

The http-in node output msg.headers which get passed to the http-request node, which changes how the request works.

Or the headers that come the http-request node get passed to the http-reponse node and mess up the response to the client that triggered the flow.

Thanks for the input.

In my case the origin of the messages in question was never HTTP, so this issue was not applicable.

And since upgrading Node-RED fixed it instantly, it seems to be a bug in 4.0.9, even though I never found out exactly why it only (or almost only?) appeared for a certain message path.