WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Git & Packagemanager Issues

Open carensbak opened this issue 7 months ago • 8 comments

Windows Version

Microsoft Windows [Version 10.0.26100.4349]

WSL Version

2.5.7.0

Are you using WSL 1 or WSL 2?

WSL 2 Kernel version: 6.6.87.1-1

Distro Version

Ubuntu 24.04.2 LTS

Repro Steps

run sudo apt update or run any git command that targets remote, i.e. git push, git pull or git clone

Expected Behavior

Successfully update packages or run the remote git commands.

Actual Behavior

apt: Hangs with message 0% [Waiting for headers]. Image

git: Also hangs / fails, even cloning a public repo does not work, and fails with message fatal: unable to access 'https://github.com/Foo/PublicRepo': Recv failure: Connection reset by peer Image

Other information:

At work I have a virtual PC running Windows. Here I run WSL, and it has been working fine until this Monday. At the moment I am not able to use git, apt and curl (probably more).

I have tried pinging google, which works, so I have internet access in WSL. Image

When using curl against google I get connectivity issues. Image

It seems to be a WSL related issue, since I can use my remote git commands just fine using powershell outside of WSL. Image Same for curl. Image

I have tried reinstalling my Ubuntu WSL distro, but the issue persists.

Any ideas or possible solutions would be much appreciated.

carensbak avatar Jun 18 '25 08:06 carensbak

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

github-actions[bot] avatar Jun 18 '25 08:06 github-actions[bot]

Here are the WSL logs:

WslLogs-2025-06-18_10-54-25.zip

carensbak avatar Jun 18 '25 09:06 carensbak

Diagnostic information
Detected appx version: 2.5.7.0

github-actions[bot] avatar Jun 18 '25 09:06 github-actions[bot]

For some reason I cannot upload the network logs, so I have mailed them to [email protected].

carensbak avatar Jun 18 '25 09:06 carensbak

I have tried the steps here: https://github.com/microsoft/WSL/issues/8358 Still no luck.

carensbak avatar Jun 18 '25 10:06 carensbak

Do you happen to be using a corporate VPN?

sirredbeard avatar Jun 18 '25 12:06 sirredbeard

@sirredbeard I have a virtual PC that I connect to through RDP, I don't use a VPN directly.

I should mention that I am able to do everything normally on the VPC outside WSL, using PowerShell. It is just WSL, on the VPC that broke for me.

carensbak avatar Jun 18 '25 15:06 carensbak

@Christiansgh I asked because you mentioned At work and I have seen these same issues on VPNs before in my own experience.

You disabled IPv6.

Can I ask what hypervisor you are running your virtual PC on? I am wondering if it's something off with the virtual network adapters. Should always consider DNS.

Not to keep harping on it, but to rule it out, is there a chance, the virtual PC host is connected to a VPN?

sirredbeard avatar Jun 18 '25 16:06 sirredbeard

@sirredbeard Sorry if I sounded too aggressive, it wasn't my intention at all. I really appreciate you taking the time to help me out.

I don't know a lot about networking, so I asked our ops department and they said they use NUTANIX, which should be QEMU / KVM based, and it is not connected to a VPN.

carensbak avatar Jun 19 '25 06:06 carensbak

@Christiansgh I've been keeping an eye on this issue since yesterday because I was experiencing something similar. I'm on Windows 11 with WSL2 Ubuntu 24.04 and apt update wouldn't connect. For a few days I tried debugging the WSL part, and had partial luck by enabling IPv6, but IPv4 port 80 still wouldn't work.

What fixed my issue was rebooting my router 🤷 I wish I would have done this a few days ago when the issues first started.

avacaru avatar Jun 19 '25 09:06 avacaru

@Christiansgh No worries, you're all good, I just like detailing my thought process here.

I am leaning towards this being an odd edge-case with the networking in the VM setting.

There's just no rhyme or reason to what gets blocked, for example, it appear some https connections work just fine, others don't.

I am curious, do you have the virtio network (and other) drivers installed on your Windows guest?

I would be interested if you got detailed logs curling certain URLs, to compare.

Also, setting the DNS server on your virtual adapter to something generic like 8.8.8.8 over what is given by the host to the guest networking adapter.

sirredbeard avatar Jun 20 '25 13:06 sirredbeard

@sirredbeard Sorry for the delay, I have been a bit busy.

I am curious, do you have the virtio network (and other) drivers installed on your Windows guest?

I am not sure. Is there a powershell command that I can run to figure that out? Otherwise I can also ask the ops department. Image Is it this?

I would be interested if you got detailed logs curling certain URLs, to compare.

Absolutely, what should I curl and with what flags?

Also, can I send you a wireshark capture?

carensbak avatar Jun 24 '25 12:06 carensbak