DNS timing issue

On my linux system I have 3 different DNS server entries. For testing purposes the first two are invalid/non-existent servers while the 3rd one is the only valid/working server.

I am using the simple HTTP GET request flow from here Simple GET request : Node-RED (in a loop) but I repeatedly get this error

node[31888]: 8 Mar 09:02:11 - [error] [http request:c3efe083.51344] no response from server

If I change the order of the DNS servers (making the valid server as first option) then the problem goes away and HTTP node works as intended.

I understand name resolution will take a few seconds in this scenario, but I have other apps able to handle this change without disruption with only node-red timing out.

edit: I am using node-red v2.2.2

Can you put a number on this?

You could try setting the requestTimeout property in the msg that triggers the request to 30s or more...

msg.requestTimeout = 30000

(the default is 12000ms / 12s)

When you say "repeatedly" - is this some of the time or all of the time?

When you say "in a loop" - how many requests are you making? Could you benefit from slowing these down by placing a delay node set to rate limin mode (e.g. 1 req per 5 secs) ?

Lastly, could you share your flow?

Hi Steve,

I have copied my flow below.
I just have a 1 sec repeat interval set in the "inject node". If I increase the interval to 5 secs then all requests finish successfully.
If I remove the "repeat" and always make request manually, then also the request is successful.

seems like error is happening only in "1 sec" case.

[{"id":"a8408096.a246a","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"75f4895f.974b98","type":"inject","z":"a8408096.a246a","name":"make request","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":460,"y":300,"wires":[["c3efe083.51344"]]},{"id":"c3efe083.51344","type":"http request","z":"a8408096.a246a","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://nodered.org","tls":"","persist":false,"proxy":"","authType":"","x":614.5,"y":300,"wires":[["483f18d5.f41c08"]]},{"id":"e14ec4ae.ca9dc8","type":"debug","z":"a8408096.a246a","name":"","active":true,"console":"false","complete":"false","x":970,"y":300,"wires":[]},{"id":"483f18d5.f41c08","type":"html","z":"a8408096.a246a","name":"","property":"","tag":".node-red-latest-version","ret":"text","as":"single","x":791.5,"y":300,"wires":[["e14ec4ae.ca9dc8"]]}]

Hi,

Firstly, please do not poll https://nodered.org every one second. Node-red project updates are no where near that frequency. Also, many sites will have spam protection and will end up looking like timeouts to node-red.

Secondly, if you have bad DNS (like you stated) then polling every 1 sec, you will simply create a problem where many thousands of queued up msgs (that are not getting serviced due to the delays caused by DNS issue) end up crashing your instance.

I used nodered flow only as example.

I also used http request with google url with a polling of 10 secs and I get random success/fail behavior.
In case of failure

"Error: ETIMEDOUT : https://google.com"]

and

node[11388]: 8 Mar 11:41:04 - [error] [http request:c8378401.cb4198] no response from server

same setup works when using curl cmdline .

Did you run this CURL on the server with DNS issue (where node-red runs)?

Did you run it with same frequency? e.g. watch -n 10 curl www.google.com

Yes and Yes

As has already been said, if you poll any endpoint with this kind of frequency - unless it is set up specifically to cater for that number of updates - you will be treated as an attacker and temporarily or permanently banned.

If you want to do that kind of testing, set up your own endpoint and don't abuse other people's.

Like I said before, this was just a simple test for the purpose of this post. I have my own setup running into this issue.
You can get the same behavior using the node-red-node-ping

[{"id":"5c866b9d.1efa44","type":"ping","z":"17770dd6.c66fb2","protocol":"Automatic","mode":"timed","name":"","host":"google.com","timer":"10","inputs":0,"x":690,"y":280,"wires":[["6e95d31c.5ecdac"]]}]

and no you dont get treated as attacker or banned for "pinging" a google server.

What exactly do you see when you deploy the ping flow?

Also what version of nodejs are you using?
node -v

Node version
V10.15.3

Output of ping node is

google.com : msg.payload: boolean
false

Node red 2.2.2 requires at least nodejs 12

@ssss have you confirmed whether the nodejs version was the problem?

@Colin i didnt have time but i will test next week and report back

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.