winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

WinGet hangs indefinitely on IPv6 networks - potential CDN connectivity issue + timeout handling

Open manuboek opened this issue 1 year ago • 10 comments

Summary

WinGet hangs indefinitely when attempting to download packages on IPv6-enabled networks, requiring manual termination (Ctrl+C). Initial diagnostics suggest this may be related to IPv6 connectivity issues with Microsoft's CDN infrastructure, combined with WinGet's current timeout handling behavior. Note: IPv6 connectivity to WinGet sources was working normally until recently, suggesting this may be a recent regression.

See #5269 for other users reporting possible PMTUD issues.

Environment

  • OS: Windows (PowerShell 5)
  • Network: IPv6-enabled dual-stack configuration
  • Affected service: cdn.winget.microsoft.com
  • Scope: IPv6 connections only; IPv4 works normally
  • Timeline: IPv6 functionality was working previously; issue appears to be recent

Symptoms

  • WinGet package operations hang indefinitely without timeout or error message
  • Manual HTTPS requests to https://cdn.winget.microsoft.com/cache hang over IPv6
  • IPv4 connections work immediately and reliably
  • Other IPv6 services (Google, Cloudflare) work normally

Diagnostic Findings

After extensive testing, this appears to involve two aspects:

  1. Potential IPv6 connectivity issues with Microsoft's CDN (recent regression)
  2. Opportunity to improve WinGet's timeout handling for network requests

Network Connectivity Analysis

Local Machine:

  • ✅ IPv6 connectivity works to other services (Google, Cloudflare)
  • ✅ IPv4 to cdn.winget.microsoft.com works perfectly
  • ✅ IPv6 ICMP to cdn.winget.microsoft.com succeeds consistently
  • ✅ IPv6 TCP connections to port 443 establish successfully (Test-NetConnection returns TcpTestSucceeded: True)
  • ❌ IPv6 HTTPS requests appear to hang without response

Network Infrastructure:

  • ✅ IPv6 dual-stack configuration appears properly configured
  • ✅ IPv6 forwarding functional
  • ✅ External IPv6 connectivity confirmed to multiple test destinations

Network Path:

  • ✅ IPv6 traceroute reaches Microsoft datacenter successfully
  • ✅ Path routing appears functional through ISP to Microsoft network
  • ✅ Final destination reachable via ICMP

Path MTU Discovery (PMTUD) Investigation

Given the pattern where TCP/TLS connections establish but data transfer fails, this could potentially be related to Path MTU Discovery issues:

  • IPv6 ICMP with various payload sizes (tested up to 1400+ bytes) succeeds
  • TCP connection establishment uses small packets (typically under 100 bytes)
  • HTTP data transfer may involve larger packets that encounter MTU restrictions

PMTUD test results:

IPv6 Path MTU testing to cdn.winget.microsoft.com:
- ICMP payload 1464 bytes: ✅ Success
- TCP connection establishment: ✅ Success  
- TLS handshake (varies ~1-4KB): ✅ Success
- HTTP request/response (varies): ❌ Hangs

This pattern could suggest that larger HTTP response packets are being dropped somewhere in the path due to MTU restrictions, while smaller connection establishment packets succeed. This would be consistent with a PMTUD blackhole scenario where ICMP "Packet Too Big" messages are being filtered.

Application Layer Behavior

Manual HTTPS testing shows the following pattern:

# IPv4 (works as expected)
Try 1 TCP OK 145ms
Try 1 TLS OK 187ms Proto=Tls12
Try 1 HTTP bytes=418 snippet:
HTTP/1.1 404 Not Found
Date: Wed, 27 Aug 2025 14:32:18 GMT
[...content received successfully...]

# IPv6 (appears to hang after TLS)
Try 1 TCP OK 145ms
Try 1 TLS OK 187ms Proto=Tls12
Try 1 HTTP no data (read=0)  # ← No response received

Observed Behavior vs Expected Behavior

Current IPv6 Connectivity Pattern

The diagnostics suggest a pattern where:

  1. TCP handshake completes successfully
  2. TLS handshake completes successfully
  3. HTTP requests don't receive responses from the server
  4. Client waits indefinitely for data that doesn't arrive

This pattern could indicate various issues in the network path or server configuration for IPv6 traffic to Microsoft's CDN infrastructure. Given that this functionality was working previously, this suggests a recent change in either:

  • CDN infrastructure configuration
  • Network path routing or filtering
  • MTU handling along the IPv6 path

Current WinGet Timeout Behavior

# Current observed behavior:
PS> winget search microsoft.powertoys --source winget
# Waits indefinitely without timeout or error message
# No indication of network issue to user
# Requires manual termination (Ctrl+C)

Impact

User Experience

  • Users experience unexplained hangs without clear error messages
  • Package management operations become unreliable on IPv6 networks
  • May impact user confidence in IPv6 networking
  • Regression from previously working functionality

Scope

  • Affects IPv6-enabled networks
  • May impact automated deployment scenarios using WinGet
  • Particularly noticeable on networks with IPv6 preference

Suggested Approaches

Enhanced timeout handling and IPv4 fallback strategies could help mitigate the user impact while the underlying connectivity patterns are investigated.

Workarounds

Users experiencing this issue can temporarily work around it by either:

Hosts File Override

Adding to C:\Windows\System32\drivers\etc\hosts:

40.90.65.187   cdn.winget.microsoft.com     # Force IPv4
13.107.253.44  www.powershellgallery.com    # Force IPv4

Network Configuration Adjustments

  • Temporarily adjusting IPv6 preference on specific interfaces
  • Configuring DNS to prefer IPv4 responses for affected domains

Additional Context

Since IPv6 functionality was working previously, this suggests a recent regression that may warrant investigation. The pattern observed (successful connection establishment but failed data transfer) combined with reports from other users experiencing similar issues indicates this may be affecting multiple users on IPv6-enabled networks.

The current behavior significantly impacts user experience on IPv6 networks, as users encounter silent failures with no indication of the underlying network issue or available

manuboek avatar Aug 27 '25 17:08 manuboek

@manuboek

Thank you for all the detail here!

We've opened an incident with our CDN provider to see if we can get this issue resolved, and make sure we have testing in place, so this doesn't happen again (or at the very least, have an internal alert when it does so we can get it resolved ASAP).

denelon avatar Aug 29 '25 17:08 denelon

@manuboek

Thank you for all the detail here!

We've opened an incident with our CDN provider to see if we can get this issue resolved, and make sure we have testing in place, so this doesn't happen again (or at the very least, have an internal alert when it does so we can get it resolved ASAP).

Thanks for taking action to resolve the root cause.

However, I would recommend to also look into the timeout behavior of winget, as also suggested by @manuboek. Such communication issue should not make winget completely unresponsive.

timovanroermund avatar Aug 29 '25 18:08 timovanroermund

@manuboek

I've been following this issue with our CDN provider. To help me speed up things, could you use Feedback Hub and attach a HAR trace while downloading https://cdn.winget.microsoft.com/cache/source2.msix ? On Choose a category select Apps -> AppInstaller.

msftrubengu avatar Sep 08 '25 20:09 msftrubengu

@msftrubengu No problem, I’ve attached it here.

However, we will see just some timeout there, because HAR files only capture application-layer HTTP data. They don’t include the lower-level network events like ICMP “Packet Too Big” messages or TCP MSS negotiations, which happen below the HTTP layer where this problem actually occurs.

So I would be happier if your CDN provider would have asked for a packet capture, to look at all network traffic. I also inlcuded a pcap file in attached zip just in case

trace_data.zip

You can see the [Malformed Packet] lines quite clearly there, containing detailed info like [IPv6 payload length equals 0 (maybe because of "TCP segmentation offload" (TSO))]:

Image

manuboek avatar Sep 08 '25 21:09 manuboek

@manuboek Sorry this is taking too long. The internal team ask the following:

Can we also get exact timestamps for when the connectivity issues occurred? I'll need the exact timestamps (including timezone) so I can check the Front Door logs to better observe any behavior.

Confirm that cdn.winget.microsoft.com resolves correctly to Azure Front Door IPv6 (AAAA) record, by doing an nslookup or a DIG: Dig web interface - online dns lookup tool

Compare IPv6 vs IPv4 with the following curl commands:

  • curl -6 -v https://cdn.winget.microsoft.com/cache/source2.msix
  • curl -4 -v https://cdn.winget.microsoft.com/cache/source2.msix

msftrubengu avatar Sep 25 '25 18:09 msftrubengu

Sorry this is taking too long.

Indeed, this took quite a long time. I was unable to update packages for about two weeks, until someone suggested disabling IPv6, which immediately resolved the issue. Why was the internal team not able to detect and remediate this problem earlier?

The service seems to work fine over IPv6 now.

jwgn avatar Sep 25 '25 18:09 jwgn

Please reopen if this is still an issue.

msftrubengu avatar Oct 10 '25 18:10 msftrubengu

It's still not working for me

conuaunoc avatar Oct 16 '25 09:10 conuaunoc

Setting MTU and TCP MSS to 1480 on my pfSense router fixed it (it automatically subtracts 40/60 bytes from MSS for IPv4/IPv6); o need to use the IPv4 DNS workaround. I'm on a PPPoE fiber ISP, so MTU would normally be set to 1492.

conuaunoc avatar Nov 11 '25 17:11 conuaunoc

The issue is present once again, MTU 1480 solved it

kodfodrasz avatar Nov 10 '26 05:11 kodfodrasz