-
Notifications
You must be signed in to change notification settings - Fork 312
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
Firefox support broken (Node 17?) #467
Comments
Alright so, this is not strictly related to Firefox, it's a consequence of a new change introduced in Node.js 17 (nodejs/node#39987). And can be reproduced as easily as: const http = require('http');
const server = http.createServer((req, res) => {
res.end('OK\n');
});
server.listen(4444, '127.0.0.1', () => {
let url;
url = 'http://127.0.0.1:4444'; // works
url = 'http://localhost:4444'; // doesn't; it just tries ::1 (IPv6)
http.get(url, (res) => {
res.pipe(process.stdout);
server.close();
});
}); This behaviour kind of surprises me, not the fact that IPv6 is preferred over IPv4, which is commonplace nowadays, rather the fact that Node.js stops after the first (IPv6) attempt. AFAIK it's unique in this, for example in Python 3.9.8 the following code tries both IPv6 and IPv4 addresses (in that order): import http.client
http.client.HTTPConnection('localhost:4444').request('GET', '/') Having said that, the Now for the solution, since the implementations never (?) listen on IPv6, I think we can safely instruct Node.js to prefer IPv4 with |
Preferring IPv4 sounds like a very reasonable default, I'm sure than 95%+ of the time users connect to a local browser, and as you said both Chrome and FF don't even bind on the An alternative approach could be to rewrite |
Former it is. It really escapes me why Node.js doesn't go on and try IPv4 after an |
Thanks for the fix! There's some background and more info here: nodejs/node#40702 (comment) I still fail to see why the Node team thought it was a good idea to change the default, I'm sure this will break quite a few other packages. |
Node.js 17, which as of writing is the most recent version, contains a breaking change in its DNS resolver, causing Firefox not to start anymore in our test framework. The inline comment together with the following resources provide more background: - nodejs/node#40702 - nodejs/node#39987 - cyrus-and/chrome-remote-interface#467 - https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V17.md#other-notable-changes - DeviceFarmer/adbkit#209 - https://nodejs.org/api/dns.html#dnssetdefaultresultorderorder This commit ensures that versions both older and newer than Node.js 17 work as expected. This is mainly necessary since the bots as of writing run Node.js 14.17.0 which is from before this API got introduced and for example Node.js 12 LTS is only end-of-life in April 2022, so we have to keep support for those older versions unfortunately.
The preferred solution would indeed be to rewrite it to
The solution you're referring to is called "Happy Eyeballs". This is also good solution when multi-homing. However, NodeJS never implemented happy eyeballs. Thus, yes, it has always been this way but the other way round. It's also the reason why resorting by default was abandoned.
Because it was causing more and more problems with people on IPv6-enabled connections in other settings. So there was good reason to go back to respecting the DNS sorting order of the OS. v17 is also only an intermediate release. v14 and v16 (and soon v18) are the LTS releases. It's expected to encounter problems when upgrading to a new NodeJS version. |
Node.js 17, which as of writing is the most recent version, contains a breaking change in its DNS resolver, causing Firefox not to start anymore in our test framework. The inline comment together with the following resources provide more background: - nodejs/node#40702 - nodejs/node#39987 - cyrus-and/chrome-remote-interface#467 - https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V17.md#other-notable-changes - DeviceFarmer/adbkit#209 - https://nodejs.org/api/dns.html#dnssetdefaultresultorderorder This commit ensures that versions both older and newer than Node.js 17 work as expected. This is mainly necessary since the bots as of writing run Node.js 14.17.0 which is from before this API got introduced and for example Node.js 12 LTS is only end-of-life in April 2022, so we have to keep support for those older versions unfortunately.
Node.js 17, which as of writing is the most recent version, contains a breaking change in its DNS resolver, causing Firefox not to start anymore in our test framework. The inline comment together with the following resources provide more background: - nodejs/node#40702 - nodejs/node#39987 - cyrus-and/chrome-remote-interface#467 - https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V17.md#other-notable-changes - DeviceFarmer/adbkit#209 - https://nodejs.org/api/dns.html#dnssetdefaultresultorderorder This commit ensures that versions both older and newer than Node.js 17 work as expected. This is mainly necessary since the bots as of writing run Node.js 14.17.0 which is from before this API got introduced and for example Node.js 12 LTS is only end-of-life in April 2022, so we have to keep support for those older versions unfortunately.
Thanks for this hint! This is indeed problematic and we are going to fix this problem in Firefox via https://bugzilla.mozilla.org/show_bug.cgi?id=1769994. Reporting the actual resolved local IP via stderr or the DevToolsActivePort seems to be the right way for various affected clients. |
Node.js 17, which as of writing is the most recent version, contains a breaking change in its DNS resolver, causing Firefox not to start anymore in our test framework. The inline comment together with the following resources provide more background: - nodejs/node#40702 - nodejs/node#39987 - cyrus-and/chrome-remote-interface#467 - https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V17.md#other-notable-changes - DeviceFarmer/adbkit#209 - https://nodejs.org/api/dns.html#dnssetdefaultresultorderorder This commit ensures that versions both older and newer than Node.js 17 work as expected. This is mainly necessary since the bots as of writing run Node.js 14.17.0 which is from before this API got introduced and for example Node.js 12 LTS is only end-of-life in April 2022, so we have to keep support for those older versions unfortunately.
Is Chrome running in a container? No
Since recently, CRI can no longer connect to Firefox. After starting firefox with
firefox --remote-debugging-port 41000
, i can run alist
andversion
command, butinspect
fails:I think the issue is that
-t 127.0.0.1
is not working properly with theinspect
command, it seems to try to connect to the IPv6 interface as::1
which Firefox doesn't listen on.The text was updated successfully, but these errors were encountered: