Skip to content
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

Closed
smikes opened this issue Mar 1, 2015 · 6 comments
Closed

DNS failures (EAI_FAIL) on FreeBSD when only one loopback addr #1011

smikes opened this issue Mar 1, 2015 · 6 comments
Labels
freebsd Issues and PRs related to the FreeBSD platform.

Comments

@smikes
Copy link
Contributor

smikes commented Mar 1, 2015

This surfaced as a problem with npm install, npm/npm#7508

The 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)

@brendanashworth brendanashworth added the freebsd Issues and PRs related to the FreeBSD platform. label Mar 1, 2015
@bnoordhuis
Copy link
Member

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
Copy link
Contributor Author

smikes commented Mar 1, 2015

Thanks for finding where npm is expecting a specific error code. I will see if we can fix it (or at least, work around it) on the npm side.

@othiym23
Copy link
Contributor

othiym23 commented Mar 2, 2015

npm/npm@bcd4722 pulls that into the error handler. I'm helping! In a very very tiny way!

@bnoordhuis
Copy link
Member

@smikes @othiym23 Do you think io.js needs to do something here? If not, I move to close the issue.

@othiym23
Copy link
Contributor

@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
Copy link
Member

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
freebsd Issues and PRs related to the FreeBSD platform.
Projects
None yet
Development

No branches or pull requests

4 participants