nodejs / nodejs/node

Node.js v24 fails to establish HTTPS connections over IPv6/IPv4 fallback in Docker Desktop on Windows (ENETUNREACH)

Đang mở
#64,652 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
JavaScript
Star
122k
Fork
37.3k
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
283

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện lệnh HTTPS trong node:24-bookworm và node:24-alpine, sau đó so sánh với node:22-bookworm trong Docker Desktop trên Windows. Trước tiên, hãy điều tra cơ chế chọn địa chỉ của Node 24 hoặc hành vi Happy Eyeballs khi tồn tại cả bản ghi A và AAAA. Được xem là hoàn tất khi yêu cầu thành công thông qua kết nối IPv4 hiện có thay vì kết thúc với ENETUNREACH.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, javascript, node.js
Lĩnh vực
networking
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.