got Error: getaddrinfo ENOTFOUND from http request node

1,101 views
Skip to first unread message

Pierre-André Liné

unread,
Feb 27, 2017, 2:38:18 AM2/27/17
to Node-RED
Hi,

I send a http request to my server (cloud) and sometimes (about one for ten request), I get "Error: getaddrinfo ENOTFOUND". When I replace in the URL the domain name by the server's IP, it works perfect.
I read in nodejs docs/forums that it could be a IPV4 / IPV6 issue in DNS resolution, and then I should set request's option 'family' to 4, to be sure that it will use IPV4.
I added this option value in a function before the http request node :

```
var newMsg = {
    payload: msg,
    family: 4,
    headers: {
        "Content-type" : "application/json"
    }
};
return newMsg;
```

But same result (ENOTFOUND errors sometimes).

Is there a better way to specify the `family` option of the http request node ?
Is there another explication ?
Thanks.

Dave C-J

unread,
Feb 27, 2017, 2:30:11 PM2/27/17
to node...@googlegroups.com
the other way is to disable ipv6 on your box (if you don't actually need it for anything else)

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/a5da0c09-2c66-406e-98d8-a11b89be8b9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
regards

Dave Conway-Jones

Pierre-André Liné

unread,
Feb 28, 2017, 1:48:18 AM2/28/17
to Node-RED
Hi Dave, thanks for advice. 
I've checked the box and ipV6 is not enabled (no inet6 IP displayed with ifconfig and no ipv6 configuration in box panel app).
So I woold like to find a way to set the 'family' property of the 'option' object of the http request.
Thanks for help.

Reply all
Reply to author
Forward
0 new messages