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: provide additional info for ENOTFOUND errors #26903

Closed
bnoordhuis opened this issue Mar 25, 2019 · 5 comments
Closed

dns: provide additional info for ENOTFOUND errors #26903

bnoordhuis opened this issue Mar 25, 2019 · 5 comments
Labels
dns Issues and PRs related to the dns subsystem. feature request Issues that request new features to be added to Node.js. stale

Comments

@bnoordhuis
Copy link
Member

Refs: #5436 - and plenty of other issues.

That issue attracts comments from befuddled users to this day so I think it highlights a real issue, namely that the ENOTFOUND error code on its own is not very helpful.

History/background/context:

  1. It's an artificial error that was introduced for $reasons in Node.js v0.2.0.1

  2. It's been around long enough that simply removing it won't fly.

  3. It's returned when getaddrinfo() fails with EAI_NODATA or EAI_NONAME.

  4. It nearly always indicates some transient or environmental error condition: out of file descriptors, no network connectivity, upstream DNS server timing out, etc.

It would be nice to provide a better error message, perhaps through an additional status property if necessary for backwards compatibility.

The problem: there might not be sufficient metadata to provide a better message.

For example, glibc returns EAI_NONAME when there is no IPv6 connectivity and the host only has an IPv6 address. There is no way to dinstinguish that particular condition from a real NXDOMAIN error apart from opting out from glibc's default behavior (see libuv/libuv#2225 - probably has wider-ranging consequences.)

1 For the curious: it maps directly to ARES_ENOTFOUND, the c-ares error code. That's from before Node.js supported getaddrinfo().

@bnoordhuis bnoordhuis added the dns Issues and PRs related to the dns subsystem. label Mar 25, 2019
@sagitsofan
Copy link
Contributor

sagitsofan commented Apr 13, 2019

I think the best way is to retrieve the error description directly from the V8 engine like made in the this #22995 PR using the uvExceptionWithHostPort function.

@bnoordhuis
Copy link
Member Author

@sagitsofan What exactly do you propose? The core issue is not enough context to construct a good error message.

@techieshark
Copy link

It nearly always indicates some transient or environmental error condition: out of file descriptors…

@bnoordhuis thanks for this very helpful context!

Do you have any recommendations for how to determine if the underlying issue is related to a failed IPv6 lookup (as suggested in in comments like this #5436 (comment)) vs something like a lack of file descriptors etc?

@jasnell jasnell added the feature request Issues that request new features to be added to Node.js. label Jun 26, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2022

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Mar 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2022

There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dns Issues and PRs related to the dns subsystem. feature request Issues that request new features to be added to Node.js. stale
Projects
None yet
Development

No branches or pull requests

4 participants