Closed trentm closed 1 year ago
Is it possible for the system to be IPv6 only or less drastic case when list of addresses to which localhost
resolves does not include 127.0.0.1
?
(Sorry for not having opened this as draft to start.)
Is it possible for the system to be IPv6 only or less drastic case when list of addresses to which
localhost
resolves does not include127.0.0.1
?
IPv6-only is likely possible yes. I’ve no encountered it. I think it would be rare, but am not sure.
I can try to look at the Go lang docs to see if we think APM server would even listen on the IPv6 localhost by default in that case.
Re: ‘localhost’ not resolving to 127.0.0.1. Oof, I would think that would be very unlikely but possible. I am not sure if some RFC has a “MUST” statement about “localhost” resolving so. If some user had this case, I am not sure we would feel the need to have the default agent and server configs successfully reach each other. I may be missing a legitimate use case though?
The change makes sense 👍 .
(On a side note, I'm just wondering though:
- how many applications will be impacted by this change of behavior in Node v17?
@z1c0 Possibly a lot. Here is the core node issue, which shows a number of incoming links from impacted projects. Also the links in that issue's description point to a number of back issues related to this.
- why APM Server binds only to IPv4?
There is some discussion in https://github.com/elastic/apm-server/issues/1405 I suspect it is mainly just because that's what Go lang's native net library works and just binding to IPv4 has always mostly been fine.
Interestingly https://pkg.go.dev/net#Listen says:
The address can use a host name, but this is not recommended, because it will create a listener for at most one of the host's IP addresses.
So it might be worth asking APM Server devs. I'll ask separately.
APM server will be making the same change in https://github.com/elastic/apm-server/issues/9749
The current default APM server URL -- 'http://localhost:8200' -- is ambiguous. "localhost" can resolve to a '127.0.0.1' (IPv4) or '[::1]' (IPv6).
At least in Node v17 the default
dns.lookup()
ordering of results was changed to no longer explicitly sort IPv4 addresses first. That means that on systems where the default resolver returns '[::1]' first for "localhost" will result in a broken attempt to talk to a default-configured local APM server: https://github.com/elastic/apm-agent-nodejs/issues/3045 This is because APM server only binds to the IPv4 port: https://github.com/elastic/apm-server/issues/1405Checklist
sanitize_field_names
)CODEOWNERS
)/
schedule YYYY-MM-DD
to the PR description./schedule 2022-12-13