You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DNS failures (EAI_FAIL) on FreeBSD when only one loopback addr #1011
Okay, what I think happens here is that npm (in lib/utils/error-handler.js) expects ENOTFOUND but instead it gets EAI_FAIL.
lib/dns.js remaps some EAI errors to ENOTFOUND. It's debatable whether that should be done for EAI_FAIL because it means the DNS request failed altogether, not that no DNS entry exists.
On the other hand, lib/dns.js also remaps EAI_MEMORY for reasons I'm not entirely clear on. I probably just carried that over when libuv started returning error codes directly.
@bnoordhuis I'm +0 on closing this; the fact that this behavior is inconsistent between OSes is surprising / mildly annoying, but that's just how libuv is, I guess.
@othiym23 Libuv just passes on the error from the system library. Other operating systems can return it as well (in theory - it's not a very common error but e.g. OS X's libresolv sometimes returns it.)
Activity
bnoordhuis commentedon Mar 1, 2015
Okay, what I think happens here is that npm (in lib/utils/error-handler.js) expects ENOTFOUND but instead it gets EAI_FAIL.
lib/dns.js remaps some EAI errors to ENOTFOUND. It's debatable whether that should be done for EAI_FAIL because it means the DNS request failed altogether, not that no DNS entry exists.
On the other hand, lib/dns.js also remaps EAI_MEMORY for reasons I'm not entirely clear on. I probably just carried that over when libuv started returning error codes directly.
smikes commentedon Mar 1, 2015
Thanks for finding where
npmis expecting a specific error code. I will see if we can fix it (or at least, work around it) on thenpmside.othiym23 commentedon Mar 2, 2015
npm/npm@bcd4722 pulls that into the error handler. I'm helping! In a very very tiny way!
bnoordhuis commentedon Mar 11, 2015
@smikes @othiym23 Do you think io.js needs to do something here? If not, I move to close the issue.
othiym23 commentedon Mar 11, 2015
@bnoordhuis I'm +0 on closing this; the fact that this behavior is inconsistent between OSes is surprising / mildly annoying, but that's just how libuv is, I guess.
bnoordhuis commentedon Mar 11, 2015
So moved, closing.
@othiym23 Libuv just passes on the error from the system library. Other operating systems can return it as well (in theory - it's not a very common error but e.g. OS X's libresolv sometimes returns it.)