-
Notifications
You must be signed in to change notification settings - Fork 3k
npm 2.5 and 2.6 fails with getaddrinfo EAI_FAIL when only loopback IP available #7508
Comments
This is definitely a bug, but the problem is, I'm not sure where to start looking to track it down. I believe the underlying problem is with the Are you building |
It looks like FreeBSD might have different error handling from Linux hosts; where Linux getaddrinfo() returns EAI_NONAME, FreeBSD returns EAI_FAIL (see this comment from |
That makes two of us. At first I figured the bug might be in dns.js, but in poking around in there, I'm not so sure. |
No, it definitely is dns.js. I think it must have landed with this commit: nodejs/node-v0.x-archive@ca9eb71 and where EAI_NONAME, EAI_NODATA are being handled, a case for EAI_FAIL should be added too. Can you build iojs in your FreeBSD image, or is that untenable? |
My guess as to the offending line: nodejs/node-v0.x-archive@ca9eb71#diff-4cce137cb8157852360b2884ec408341R34 |
I'm going to open a case on iojs to see if they have any ideas. |
I asked at io.js and they pointed out where Unfortunately that's not going to fix the problem for you, @msimerson, since the problem for you is that Do you have a |
Hmm, I wasn't aware that one could run FreeBSD under Docker. Google wasn't helpful there, got a link on how to do that? The "test" setup in this case is a Mac running VMware 7 with a stock FreeBSD 10.1 amd64 installed. Then I create a jail with a loopback address, turn on PF with that NAT rule shown above, fire up the jail and install node with |
Sorry, I am speaking without knowledge. I mean, is there a way you could provide someone unskilled w/ virtual machines (me) an environment where I can reproduce this? On Sun, Mar 1, 2015 at 10:18 AM, Matt Simerson notifications@github.com
|
I'll see if I can't do that. Do you have a public SSH key I can install for you to access it? Thanks for all your effort to provide a resolution for this. |
bcd4722 adds this to the error handler, and I think handles the bit that is relevant to npm. Feel free to continue discussing this here, but I'm closing the issue, as it's a joyent/node / iojs/io.js problem with FreeBSD, looks like. BTW, I like the sound of small VirtualBox images containing vms exhibiting particular problems, even though the logistics seem a little challenging. If people have access to AWS, we could just pass them around as AMIs, maybe? |
I bumped into this too today. Looks strange to me - @msimerson, were you using FreeBSD node port? Current FreeBSD node port has a little patch to lib/dns.js: https://svnweb.freebsd.org/ports/head/www/node/files/patch-lib_dns.js?revision=378937&view=markup @msimerson do you have this patch in your node? cc: @pct |
Yes.
Yes. I can confirm that it doesn't fix the problem. See iojs #337, iojs #1011, node #8540. The state in current ports hasn't improved yet.
require('http').get("http://www.google.com/", function(res) {
console.log("Got response: " + res.statusCode);
}).on('error', function(e) {
console.log("Got error: " + e.message);
}); |
What does |
[root@smtp ~]# pkg install -y node
FreeBSD repository is up-to-date.
[smtp] [1/1] Extracting node-0.12.0_1: 100%
[root@smtp ~]# node
> os.networkInterfaces()
{ lo0:
[ { address: '127.0.0.9',
netmask: '255.255.255.255',
family: 'IPv4',
mac: '00:00:00:00:00:00',
internal: true } ] }
> Which is quite accurate. # ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:0c:29:09:12:e8
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.0.0.9 netmask 0xffffffff Networking is handled via PF rules outside the jail.
|
And |
% cat /etc/resolv.conf (A few jails over, unbound is listening on 127.0.0.3.) |
I suppose the case is in address from 127/8 space. I tried to bind jail on my real interface (em0 instead of lo0) without success. Then I change address to 192.168.1.1 and it works like a charm |
Giving my jail an 192.168.* address fixed this for me too. |
I can confirm that giving my jail an 192.168.* address fixed this for me too. Thanks! |
I've tried installing iojs 1.2 instead but get the same error when trying to do a
npm install
.Having only a single loopback address is because this FreeBSD instance is actually a FreeBSD jail running under VMWare on my Mac. The jail host is running PF with NAT and provides each of the jails with networking:
This failure is something new in the way node is now handling DNS, as this was working just fine with node 0.10 and below. As I showed with
host
andcurl
above, DNS and networking are obviously working. In fact, they work just fine for all these other apps:Here's some tcpdump output with more interesting info.
The text was updated successfully, but these errors were encountered: