-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS failures (EAI_FAIL) on FreeBSD when only one loopback addr #1011
Comments
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. |
Thanks for finding where |
npm/npm@bcd4722 pulls that into the error handler. I'm helping! In a very very tiny way! |
@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. |
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.) |
This surfaced as a problem with
npm install
, npm/npm#7508The bug seems to have been introduced in the 0.11 (now 0.12) node line, which
io.js
inherits.I found some evidence that FreeBSD returns different error codes than Linux (EAI_FAIL instead of EAI_NONAME) on certain conditions, see this thread from the samba bug tracker: https://bugzilla.samba.org/attachment.cgi?id=8563&action=edit
I don't have a FreeBSD box to test this on. @msimerson has the FreeBSD box with the unusual setup (only using loopback network addresses)
The text was updated successfully, but these errors were encountered: