-
Notifications
You must be signed in to change notification settings - Fork 834
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
Github cloning error in wsl2 (driver MTU) #4253
Comments
Note: from the trace, it looks like git makes a lot of progress, writing out a lot of the .git dir until it gets to this point(ish): https://gist.github.com/CyrusNajmabadi/17ca72e2018196185fd885a84e5c6011#file-clone-failure-L7879 So we're able to make the network calls and communicate with github for much of hte process. But at some point things go bad, and can never proceed. |
Attempting to clone using https also fails:
Gist is here: https://gist.github.com/CyrusNajmabadi/349ca0d2968d82f3a1d45c363e3112c6 |
Note: this is a wsl2 issue. If i convert back to wsl1 then things work: Windows:
Ubuntu:
So there is something going wrong with wsl2 here... |
Great report; you've tried a number of sensible things here. This is going to be a case of finding the external variable; and I am unfortunately not guessing it right away. What makes this one especially tricky is you've started clean. Needless to say you can do a So what's the variable.... There are plenty of hits on your Confirm: There wasn't a "installed my usual VPN / AV / proxy / etc" software somewhere inbetween steps 1/2/3/4 at the top. [Take as given "no" but it needs asking.] One thing you can try while I sleep on it is install the Ubuntu-18.04 (contrast Ubuntu) version from the store. First thing out of the gate after you convert WSL2:
We can cross the
Indeed. But that it is working for you on WSL1 unfortunately isn't hinting at the external variable that is causing a simple |
Correct. The only thing I installed outside of ubuntu was Firefox (and I really hope that's not the factor!) |
Will try in an hour or so! |
More info (with hugely suggestive information)! I went to work and still had the same problem. I even tried on a different machine and had the same problem. So i then tried switching from wifi to ethernet, and the problem cleared up. Both machines have an Intel Wireless-AC9560 chipset. So there is something super wonky there. I'm going to try seeing if there are updated drivers for this chipset to see if that might help things out. No clue how/why that would be an issue for wsl2. Maybe something with hyperv and how it does networking? Based on this info, is there anything i could collect to help make the situation clearer? |
Ok. So updating my wifi chipset drivers fixed the issue. In case anyone else runs into the above, the drivers i updated to were found here: https://downloadcenter.intel.com/download/28794/Windows-10-Wi-Fi-Drivers-for-Intel-Wireless-Adapters?product=99446 @therealkenc I think i'm personally back in a good space. I'm guessing there was some sort of hyperv incompatibility with those drivers. Given that it seems to be working now, i'm personally ok if you want to close this. Or, if you want me to collect more info, def let me know! |
@CyrusNajmabadi - We are working on getting WSL / networking traces added to feedback hub to make trace collection easier. I'll update this thread once we have the correct traces enabled. |
I almost asked you to try varying your network connection given some of the Hyper-V + driver related hits linked previously, but thought that cruel and unusual. [I also considered asking if you tried rebooting, but thought better of that too ;).]
Very happy you are unblocked with the updated drivers. Excellent dive on finding the cause 👍. Let's hold it open on Ben's update, which will definitely make trace collection easier in the future. |
I can confirm both the issue and the solution (updating intel wifi driver). BTW, Windows Update couldn't find that updated driver by itself, which is sad. |
Praise the sweet baby jesus this worked! I have been fighting with this for 5 days. Everything on the internet is a lie. This is a nightmare to figure out. Thank you so much for documenting how you resolved it! |
Yeah let's chalk this tag external. I like to think these driver updates eventually flow through Windows Update (but shrug). If/when the trace improvements land, so much the better for the next one. Thanks again @CyrusNajmabadi for finding the cause and fix.
That plus Sturgeon's Law. |
@smashedtoatoms I'm really happy to hear this helped you out. It was so frustrating just dealing with this for a day. It sucks that you went a week fighting this! |
I had exactly the same issue on a lenovo x1 using Windows 10 version 2004 Build 19041.172 ! Updating all drivers solved the problem. |
Same issue, same solution, Windows 10 build 19041.208 |
Same issue with 9560 and Windows 2004. |
Confirming 👍 Razer Blade 15 The system is fully up-to-date with Windows Update and the OS Upgrade tool, so a manual driver download and install is necessary. |
Thanks for this discussion, I just want to mention that if you run into the following az login ssl issues on WSL2 on Ubuntu... request failed: Error occurred in request., ConnectionError: HTTPSConnectionPool(host='management.azure.com', port=443): Max retries exceeded with url: /tenants?api-version=2019-06-01 (Caused by ProtocolError(' Updating your wifi driver on Windows will resolve that as well. I suppose the underlying issue is regarding SSL authentication/handshake which gets fixed by the driver update. |
I have the same issue, but I have an ASUS wifi adapter. |
This work for me: |
I wanted to go ahead and also say this fixed my SSH issue as well as my git cloning issue. I set my MTU to match the VPN interface that I'm attempting to SSH over (1400) and it worked afterwards. #5244 was marked as a duplicate of this issue for people experiencing SSH issues for a similar reason. The individuals in that issue mentioned that they were using Killer WiFi, but I wanted to mention that I'm using the most recent stock driver for my Intel 9560 wifi card and still experienced this issue until changing my WSL2 instance's MTU to match the VPN interface's MTU. |
A million thanks! Still works till today with the link you provided. Just curious why the 'PC manager' shipped with my laptop wouldn't keep the chipset driver updated yet says it's 'updated' :/ |
The solutions of this issue feel a lot of hocus-pokus, copy-pasty "it works in my machine"! but no explanations. I'll try to address that, and hopefully help the ones who have had no luck so far. Until this issue I never had heard of MTU, and it was hard for me to believe that was the cause, well it is.
Try upgrading your drivers first, that thidn't work for me. First open a PowerShell prompt and type:
You will get an output like the following:
The key is in the Local Area Connection 13 MTU* (The name and value can change from machine to machine), that is the VPN interface. In my case it's 1200 which is why
didn't work for me... and I didn't know how to get the VPN Interface MTU. (I also hated to install ifconfig which is deprecated in favor of ip). Now that we know, you can change the VPN MTU from Windows it in a PowerShell with Elevated Privileges,
If you want to skip the next step, you can set it to 1500, but you are leaving no room for the VPN to wrap the packets, for example I have had trouble with Github because of setting it to 1500. Then, inside your WSL2 distro, you can check your current MTU values with:
We care about eth0 (the virtual ethernet connection to Windows), you have to set a matching MTU to where you left it in the previous step.
Sadly both settings get resetted every time you start a new VPN session, or restart the WSL2, or even switch from WLAN to LAN. There are ways to work around and alleviate the hassle, but that's beyond the scope of this issue. I hope this helps much cleverer people into coming up with a more sustainable solution, this is good enough for me, for now. Hopes this clarifies a bit why the solution works, there's still a lot I don't get. |
Thank’s a bunch❤️ |
THIS WAS MAGIC :) |
Manually update Wi-Fi drivers, problem fixed! Update driver using auto search in device manager resulted in "The best driver is already installed". Ignore that message, and just get the latest Intel WiFi package from the link above. To think that in 2021, a fix from 2019 is still required to use SSH on WSL2. |
But… I use cabled Ethernet 🤯 |
Aside from just Ethernet/WiFi Adapter drivers, I encountered this issue when connected to a VPN. The combination of VPN and network drivers didn't work out super well. To solve the issue, I had to follow the above recommendation, and set the MTU of the WSL instance lower than the MTU of the VPN network adapter. @baamenabar has a great comment above (#4253 (comment)) that explains how to check the MTU of your interfaces. You'll notice in the example output above that there is a network card with an MTU of 1300 and on with an MTU of 1200. The standard MTU of an interface is normally 1500, so if your WSL interface is set to an MTU higher than the interface that you're using for internet, you can run into the issue mentioned here. They then show you how to use netsh to set the MTU of the WSL interface to match. |
Indeed, I wrote my comment just to underline that it's not possible that this issue is directly related to WiFi network driver or that it's the root cause. |
Hello, now drop in this topic... after reinstalling my system to Windows 11. I've been using WSL for a while and I've never had problems with the network. And after reinstalling the whole system was facing problem downloading packages and accessing internet via WSL. In summary: I ended up discovering that there was an interference in my network, as I use Wifi to access the Internet, the ethernet cable was connected to my local storage for backups. After removing this ethernet cable connected to the storage, everything worked, I believe it is a conflict between adapters, so this is a suggestion for those who are facing this type of problem with Wifi + Cable. Try to check if you are not using 2 networks, if you are, try to use only the internet (close and open the terminal again) and check if it works. |
Your solution to the problem was similar to mine, however I changed the Ethernet MTU inside on my WSL2 to the same numbering I saw in windows power shell(Ethernet WSL), and that way it worked for me :) |
thank you so much! |
I just encountered the same issue - but here is the strange thing (and I don't know if it is by design or not), but I use ExpressVPN and if you are connected to that, WSL will not work. Any ideas how to fix that? |
This worked for my WSL1 machine. Thank you so much! |
This trick solved to me! Windows 11, using a Gitlab on my company intranet through a vpn. Thanks a lot! |
This only happens for me during the day. Late at night, about midnight, it does not. (Testing an Ansible role with Molecule via docker.) Configuring /etc/resolv.conf to only contain |
WSL should probably set the MTUs to match the adapters it is virtualising. |
@baamenabar isn't "vEthernet (WSL)" the one you should be looking at? In this case it also has an MTU of 1300. If you have a VPN installed, it has reduced the MTU in order to give it space to wrap the packets (the MTU on the general Internet is 1500). Raising the MTU back up will degrade your performance due to all your VPN traffic getting split. You always want to instead reduce the MTU inside WSL to match. |
me too |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Never got it to work on my machine. Instead, I uninstalled Windows and installed Linux. |
Important: these steps work from Wsl1. They don't work on wsl2. So something seems to have changed here for the worse.
Specifically: I've been unable to clone from github using wsl2. I've completely wiped my windows machine and the issue still reproes. Here are the steps i've taken:
I then upgraded to wsl2 using:
Logging into Ubuntu, i did the following to update/upgrade Ubuntu:
I then created an ssh key like so:
I then uploaded this key to my github account.
I then tried to clone like so:
I've been completely unable to get cloning to work.
Please use the following bug reporting template to help produce issues which are actionable and reproducible, including all command-line steps necessary to induce the failure condition. Please fill out all the fields! Issues with missing or incomplete issue templates will be closed.
If you have a feature request, please post to the UserVoice.
If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.
Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to [email protected]. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".
Please fill out the below information:
ver
at a Windows Command Prompt)Microsoft Windows [Version 10.0.18922.1000]
Trying to clone a github repo produces:
Cloning should actually succeed.
some_command
is failing, then runstrace -o some_command.strace -f some_command some_args
, and link the contents ofsome_command.strace
in a gist here).https://gist.github.com/CyrusNajmabadi/17ca72e2018196185fd885a84e5c6011
Any help would be very appreciated.
The text was updated successfully, but these errors were encountered: