microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.29k stars 814 forks source link

git clone not working #10615

Open SilkArt opened 11 months ago

SilkArt commented 11 months ago

Windows Version

Microsoft Windows [Version 10.0.22621.2283]

WSL Version

0.0.0.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.90.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

  1. Open the Ubuntu app
  2. Run git clone (url)

Expected Behavior

I expected it to clone the git repo

Actual Behavior

It gave a connection timeout error

Diagnostic Logs

No response

benhillis commented 11 months ago

/logs

SilkArt commented 11 months ago

This is the error:

Cloning into 'MagiskOnWSALocal'... fatal: unable to access 'https://github.com/LSPosed/MagiskOnWSALocal.git/': Failed to connect to github.com port 443 after 134002 ms: Connection timed out

SilkArt commented 11 months ago

And here are the log files: bcdedit.txt optional-components.txt wpr.txt acl.txt appxpackage.txt HKCU.txt HKLM.txt P9NP.txt Winsock2.txt

SilkArt commented 11 months ago

WslLogs-2023-10-09_21-45-52.zip

SilkArt commented 11 months ago

@benhillis Any update on this?

keith-horton commented 11 months ago

Hi there. I took a look at the trace. There isn't anything from this view that looks incorrect. Please collect the state within Linux with https://github.com/microsoft/WSL/blob/master/diagnostics/networking.sh.

Then if you can get a packet mon capture, we can see if we can follow this through the NAT. pktmon start -c --flags 0x1a

pktmon stop
kmanoj845 commented 11 months ago

I am also facing this issue. I have Windows 10 Enterprise, Version : 22H2, OS build : 19045.3570. I installed Ubuntu (Ubuntu 22.04.2 LTS) by following instructions provided on this page: https://learn.microsoft.com/en-us/windows/wsl/install. I have WSL2. I have git installed for windows. git clone https://github.com/AI4Bharat/indic-punct.git works in git bash.

It does not work in WSL.
$ git clone https://github.com/AI4Bharat/indic-punct.git Cloning into 'indic-punct'... fatal: unable to access 'https://github.com/AI4Bharat/indic-punct.git/': Could not resolve host: github.com

Can someone help me with this?

ilovin commented 11 months ago

i can clone by ssh, but not by https, which results in

fatal: unable to connect to github.com:
github.com[0: 20.205.243.166]: errno=Resource temporarily unavailable
keith-horton commented 10 months ago

If you are having name resolution issues, please look at troubleshooting documentation we just added here: https://github.com/MicrosoftDocs/WSL/blob/main/WSL/troubleshooting.md#troubleshooting-dns-in-wsl.

It walks through some configurations which can break name resolution from the WSL container - as well as a work around for an HNS issue which can also break connectivity.

Thanks!