Node.js v24 fails to establish HTTPS connections over IPv6/IPv4 fallback in Docker Desktop on Windows (ENETUNREACH)
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.3k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 283
説明
Version
Node.js version: v24.16.0
Platform
Operating system: Windows 11 Docker: Docker Desktop (latest) Container images tested: node:24-alpine node:24-bookworm node:22-bookworm Network: Docker Desktop IPv4 only networking enabled
Subsystem
It was a n8n Container in Docker Desktop.
What steps will reproduce the bug?
Run:
docker run --rm node:24-bookworm node -e "require('https').get('https://login.microsoftonline.com',r=>console.log(r.statusCode)).on('error',console.error)"
or
docker run --rm node:24-alpine node -e "require('https').get('https://login.microsoftonline.com',r=>console.log(r.statusCode)).on('error',console.error)"
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The HTTPS request should succeed.
Node 22 returns HTTP 302.
What do you see instead?
AggregateError [ENETUNREACH]
connect ENETUNREACH 2603:1027:...
Node attempts multiple IPv6 addresses and never falls back to IPv4.
Additional information
Additional investigation:
- nslookup login.microsoftonline.com returns both IPv4 (A) and IPv6 (AAAA) records.
- DNS resolution inside the container is working correctly.
- Direct TCP connections to IPv4 addresses succeed.
Example:
node -e "require('net').connect({host:'20.190.159.130',port:443}).on('connect',()=>console.log('OK')).on('error',console.error)"
returns:
OK
However:
node -e "require('https').get('https://login.microsoftonline.com',r=>console.log(r.statusCode)).on('error',console.error)"
fails with ENETUNREACH.
Testing official Node images:
node:22-bookworm
-> HTTP 302 (works)
node:24-bookworm
-> ENETUNREACH
node:24-alpine
-> ENETUNREACH
The same behavior was observed in the official n8n Docker image, which currently ships with Node.js 24.
Rebuilding n8n using Node.js 22 completely resolves the issue.
This appears to be related to address selection or Happy Eyeballs behavior.
Node 24 seems to only attempt IPv6 connections although IPv4 connectivity is available and works.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
node:24-bookworm と node:24-alpine で HTTPS コマンドを再現し、その後、Windows 上の Docker Desktop で node:22-bookworm と比較します。まず、A レコードと AAAA レコードの両方が存在する場合の Node 24 のアドレス選択または Happy Eyeballs の動作を調査します。IPv4 の接続性が利用可能な場合に、その接続を介してリクエストが成功し、ENETUNREACH で終了しないことを完了条件とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, javascript, node.js
- 領域
- networking
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100