-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Comments
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 |
@sagitsofan What exactly do you propose? The core issue is not enough context to construct a good error message. |
@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? |
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. |
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. |
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:
It's an artificial error that was introduced for $reasons in Node.js v0.2.0.1
It's been around long enough that simply removing it won't fly.
It's returned when getaddrinfo() fails with EAI_NODATA or EAI_NONAME.
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().The text was updated successfully, but these errors were encountered: