Skip to content
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

In WSL intermittently VS Code is not able to connect to different extensions requiring access to Github APIs like Github Copilot, Gitlens Launchpad #1577

Closed
NehalDamania opened this issue Jun 20, 2024 · 32 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@NehalDamania
Copy link

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: Version: 1.90.2 (user setup)
  • OS Version: Windows 11

Steps to Reproduce:

  1. Open VSCode add folder from WSL
  2. Install Github copilot, Gitlens
  3. Intermittently Github copilot chat or copilot or Gitlens Launchpad, or other will stop working or will not start intermittently
  4. VS Code without WSL works without any issues.

Why I think this might be VS Code issue and not plugin issue:

  1. Different plugins like Github Copilot as well as Gitlens launchpad, Github Pull requests all stop working.
  2. However, these all work fine in normal windows environment without WSL.
  3. Sometimes the above plugin works, when Wi-Fi network is changed, but intermittently it stops working on the changed network too. It continues to work seemlessly in VSCode without WSL
  4. This was working fine without any issues till few days back on WSL. I think maybe before this update everything was working fine.
@vscodenpa vscodenpa added the triage-needed Issues needing to be assigned to the prospective feature owner label Jun 20, 2024
@copdips
Copy link

copdips commented Jun 24, 2024

I have similar issue, copilot worked well previously, but it seems that sinice one month or two, it doesn't work anymore in WSL.

  • From the output of Github Copilot: empty (but without WSL, open VSCode in a normal Windows 11, there're some output here, and all work, only WSL is KO)

  • From the output of Github Copilot Chat:

2024-06-24 11:11:11.714 [info] [FetcherService] Using the Helix fetcher.
2024-06-24 11:11:11.714 [info] [gitExtensionService] Initializing Git extension service.
2024-06-24 11:11:11.714 [info] [gitExtensionService] Successfully activated the vscode.git extension.
2024-06-24 11:11:11.714 [info] [gitExtensionService] Enablement state of the vscode.git extension: true.
2024-06-24 11:11:11.714 [info] [gitExtensionService] Successfully registered Git commit message provider.
2024-06-24 11:11:11.714 [info] [auth] Logged in as copdips

@copdips
Copy link

copdips commented Jun 24, 2024

Very strange, I retested by changing my internet access to mobile phone, and it worked.
Changing back to home internet, the issue arises agains.

It seems to be an internet firewall issue, which is very strange.
Either my home internet box is blocking copilot, or github copilot is blocking my home internet IP (I'm not using any VPN, just a simple direct connection).

Can we check the IP? I can share it with you with a private message.

please find hereunder the outputs when using mobile phone internet which worked:

Github Copilot output:

2024-06-24 14:58:10.644 [error] [auth] Extension activation failed: "FetchError"
2024-06-24 14:58:14.316 [error] [default] Error sending telemetry FetchError: 
    at fetch (/home/xiang/.vscode-server/extensions/github.copilot-1.206.0/node_modules/@adobe/helix-fetch/src/fetch/index.js:99:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at listOnTimeout (node:internal/timers:540:9)
    at processTimers (node:internal/timers:514:7)
    at cachingFetch (/home/xiang/.vscode-server/extensions/github.copilot-1.206.0/node_modules/@adobe/helix-fetch/src/fetch/index.js:288:16)
    at xq.fetch (/home/xiang/.vscode-server/extensions/github.copilot-1.206.0/lib/src/network/helix.ts:88:22) {
  type: 'system',
  _name: 'FetchError',
  code: 'ETIMEDOUT',
  errno: undefined,
  erroredSysCall: undefined
}
2024-06-24 14:58:15.853 [error] [auth] Retrying auth
2024-06-24 14:58:31.586 [info] [fetcher] Using Helix fetcher, Electron fetcher is not available.
2024-06-24 14:58:31.586 [info] [code-referencing] Public code references are enabled.
2024-06-24 14:58:31.594 [info] [fetcher] Using Helix fetcher, Electron fetcher is not available.
2024-06-24 14:58:31.594 [info] [code-referencing] Public code references are enabled.
2024-06-24 14:58:31.599 [info] [fetcher] Using Helix fetcher, Electron fetcher is not available.
2024-06-24 14:58:31.599 [info] [code-referencing] Public code references are enabled.

Github Copilot Chat output:

2024-06-24 14:58:08.996 [info] [FetcherService] Using the Helix fetcher.
2024-06-24 14:58:08.996 [info] [gitExtensionService] Initializing Git extension service.
2024-06-24 14:58:08.996 [info] [gitExtensionService] Successfully activated the vscode.git extension.
2024-06-24 14:58:08.996 [info] [gitExtensionService] Enablement state of the vscode.git extension: true.
2024-06-24 14:58:08.996 [info] [gitExtensionService] Successfully registered Git commit message provider.
2024-06-24 14:58:08.996 [info] [auth] Logged in as copdips
2024-06-24 14:58:10.785 [info] [extension] GitHub Copilot could not connect to server. Extension activation failed: "ate"
2024-06-24 14:58:14.438 [info] [auth] Logged in as copdips
2024-06-24 14:58:15.619 [info] [chat] copilot token chat_enabled: true
2024-06-24 14:58:15.619 [info] [githubTitleAndDescriptionProvider] Initializing GitHub PR title and description provider provider.
2024-06-24 14:58:15.659 [info] [auth] Got Copilot token for copdips
2024-06-24 14:58:15.994 [info] [auth] Logged in as copdips
2024-06-24 14:58:16.010 [info] [chat] copilot token chat_enabled: true
2024-06-24 14:58:16.010 [info] [auth] Got Copilot token for copdips
2024-06-24 14:58:17.499 [info] [RemoteAgents] Failed to load remote slash commands: ate
2024-06-24 14:58:17.718 [info] [githubTitleAndDescriptionProvider] Successfully activated the GitHub.vscode-pull-request-github extension.
2024-06-24 14:58:17.718 [info] [githubTitleAndDescriptionProvider] Successfully registered GitHub PR title and description provider.
2024-06-24 14:58:30.678 [info] [auth] Logged in as copdips
2024-06-24 14:58:30.684 [info] [auth] Logged in as copdips
2024-06-24 14:58:31.427 [info] [chat] copilot token chat_enabled: true
2024-06-24 14:58:31.428 [info] [auth] Got Copilot token for copdips
2024-06-24 14:58:31.459 [info] [chat] copilot token chat_enabled: true
2024-06-24 14:58:31.459 [info] [auth] Got Copilot token for copdips

And please find the diag info:

Details ## Copilot
  • Version: 1.206.0
  • Build: prod
  • Editor: vscode/1.90.2

Environment

  • http_proxy: n/a
  • https_proxy: n/a
  • no_proxy: n/a
  • SSL_CERT_FILE: n/a
  • SSL_CERT_DIR: n/a
  • OPENSSL_CONF: n/a

Feature Flags

Node setup

  • Number of root certificates: 146
  • Operating system: Linux
  • Operating system version: 5.15.153.1-microsoft-standard-WSL2
  • Operating system architecture: x64
  • NODE_OPTIONS: n/a
  • NODE_EXTRA_CA_CERTS: n/a
  • NODE_TLS_REJECT_UNAUTHORIZED: n/a
  • tls default min version: TLSv1.2
  • tls default max version: TLSv1.3

Network Configuration

  • Proxy host: n/a
  • Proxy port: n/a
  • Kerberos SPN: n/a
  • Reject unauthorized: disabled
  • Fetcher: HelixFetcher

Reachability

  • github.com: The operation was aborted.
  • copilot-proxy.githubusercontent.com: The operation was aborted.
  • api.githubcopilot.com: The operation was aborted.
  • default.exp-tas.com: The operation was aborted.

VS Code Configuration

  • HTTP proxy:
  • HTTP proxy authentication: n/a
  • Proxy Strict SSL: true
  • Extension HTTP proxy support: override

Extensions

  • Is win-ca installed?: false
  • Is mac-ca installed?: false

Authentication

  • GitHub username: copdips

@vscodenpa vscodenpa removed the triage-needed Issues needing to be assigned to the prospective feature owner label Jun 24, 2024
@NehalDamania
Copy link
Author

NehalDamania commented Jun 25, 2024

I am getting exactly the same issue. Sometimes it works on mobile internet. And on Wi-Fi it stops. Rarely it connects via wifi. But the issue happens only on WSL.

@copdips
Copy link

copdips commented Jun 26, 2024

let me recap some tests from the same laptop (Windows 11):

Internet \ OS Windows WSL
Fixed OK Failed
Mobile OK OK

@copdips
Copy link

copdips commented Jun 26, 2024

ok, I just did more tests, it seems to be a WSL DNS issue.

> cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 10.255.255.254
search home

I added nameserver 1.1.1.1 before nameserver 10.255.255.254 then the issue was resolved.
In WSL, to make this change valid, I must also edit the file /etc/wsl.conf as explained by the output of cat /etc/resolv.conf

Now, I have.

> cat /etc/resolv.conf 
nameserver 1.1.1.1
nameserver 10.255.255.254
search home
> cat /etc/wsl.conf 
[boot]
systemd=true

[user]
default=xiang

[network]
generateResolvConf = false

With nameserver 10.255.255.254 only, it can resolve github.com, but github copilot might use other domains too that I'm not aware, the extension output doesn't provide such details.

@TylerLeonhardt
Copy link
Member

Well this is very bizarre. @aeschli or @connor4312 with your WSL experience, have you seen something like this before/have any ideas?

@NehalDamania
Copy link
Author

NehalDamania commented Jun 27, 2024

let me recap some tests from the same laptop (Windows 11):

Internet \ OS Windows WSL
Fixed OK Failed
Mobile OK OK

Exactly same for me, it works on Mobile internet connection, but does not work on Fixed Internet connection.
Unfortunately the etc/resolv.conf fix given above is not working for me. On fixed connection it still does not work.

In fact, once I restart wsl, by running the wsl --shutdown command and then starting a new wsl terminal, And, then with generateResolvConf = false line in the /etc/wsl.conf file, wsl is not even recreating resolv.conf. And the saved one before is getting deleted.
May be some WSL issue.

@copdips
Copy link

copdips commented Jun 27, 2024

yes you need to generate by yourself the file resolv.conf after altering wsl.conf

@NehalDamania
Copy link
Author

NehalDamania commented Jun 27, 2024

yes you need to generate by yourself the file resolv.conf after altering wsl.conf

Thank you. Do I need to regenerate manually everytime wsl is restarted?

@copdips
Copy link

copdips commented Jun 27, 2024

no just once

@copdips
Copy link

copdips commented Jun 27, 2024

I notice that, the DNS server 10.255.255.254 is a secondary IP bound to my loopback interface inside WSL set automatically by WSL (when generateResolvConf = false is not set in /etc/wsl.conf ).

Meanwhile, my Windows OS' DNS server is the one of my home internet box (WIFI with DHCP) which is 192.168.111.1.

What're the default contents of your /etc/resolv.conf ?

WSL:

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 10.255.255.254/32 brd 10.255.255.254 scope global lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:4c:0d:65 brd ff:ff:ff:ff:ff:ff
    inet 172.27.15.111/20 brd 172.27.15.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe4c:d65/64 scope link 
       valid_lft forever preferred_lft forever

Windwos OS:

PS C:\Users\xiang> Get-NetIPConfiguration

InterfaceAlias       : Wi-Fi
InterfaceIndex       : 4
InterfaceDescription : Intel(R) Wi-Fi 6 AX201 160MHz
NetProfile.Name      : poslsfmwianciq
IPv6Address          : 2a01:xxxxxxxxxxx
IPv4Address          : 192.168.111.47
IPv6DefaultGateway   : fe80::d6f8:29ff:fe80:78c0
IPv4DefaultGateway   : 192.168.111.1
DNSServer            : 2a01:cb08:e25:1700:d6f8:29ff:fe80:78c0
                       fe80::d6f8:29ff:fe80:78c0
                       192.168.111.1

InterfaceAlias       : Ethernet 2
InterfaceIndex       : 5
InterfaceDescription : Realtek USB GbE Family Controller microsoft/vscode#2
NetAdapter.Status    : Disconnected

InterfaceAlias       : Connexion réseau Bluetooth
InterfaceIndex       : 8
InterfaceDescription : Bluetooth Device (Personal Area Network)
NetAdapter.Status    : Disconnected

InterfaceAlias       : Connexion au réseau local 2
InterfaceIndex       : 23
InterfaceDescription : OpenVPN Data Channel Offload
NetAdapter.Status    : Disconnected

InterfaceAlias       : Astrill VPN
InterfaceIndex       : 25
InterfaceDescription : Wintun Userspace Tunnel
NetAdapter.Status    : Disconnected

@NehalDamania
Copy link
Author

Hi,
My default /etc/resolv.conf is

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 10.255.255.254
search hgu_lan

Same as yours.
ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 10.255.255.254/32 brd 10.255.255.254 scope global lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:f3:59:96 brd ff:ff:ff:ff:ff:ff
    inet 172.30.31.161/20 brd 172.30.31.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fef3:5996/64 scope link
       valid_lft forever preferred_lft forever

@connor4312 connor4312 assigned alexdima and unassigned connor4312 Jun 27, 2024
@alexdima alexdima assigned chrmarti and unassigned alexdima Jun 28, 2024
@alexdima
Copy link
Member

@copdips It looks like you've found a workaround to the DNS problem and are unblocked.

@NehalDamania Is your fixed connection configured to use proxies or something special? Can you try to run from inside WSL curl https://api.githubcopilot.com/_ping

@chrmarti
Copy link

We have seen reports suggesting that something with ipv6 changed in WSL. Could you run these commands to see if they use (or see) ipv6 addresses:

  • curl -v my.ip.fi (this is known to support ipv6, note that this will include your public IP in its response, maybe omit that when posting here)
  • curl -v https://api.githubcopilot.com/_ping (some, but not all, of the hosts behind this name support ipv6)

@copdips
Copy link

copdips commented Jun 28, 2024

hello,

I tested in the 2 senarios (DNS handled by /ect/wsl.conf, and DNS handled manually by me), after a diff check, they got the same ouputs, I will show you the bad one (DNS handled by /etc/wsl.conf) below:

10:55 $ curl -v my.ip.fi
*   Trying 91.198.120.42:80...
* TCP_NODELAY set
* Connected to my.ip.fi (91.198.120.42) port 80 (#0)
> GET / HTTP/1.1
> Host: my.ip.fi
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.18.0
< Date: Fri, 28 Jun 2024 08:55:46 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 12
< Connection: keep-alive
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Strict-Transport-Security: max-age=3600
< Upgrade-Insecure-Requests: 1
<
[my public IPv4 (not IPv6) masked]
* Connection #0 to host my.ip.fi left intact
✔ /mnt/c/Users/xiang
10:55 $ curl -v https://api.githubcopilot.com/_ping
*   Trying 140.82.114.21:443...
* TCP_NODELAY set
* Connected to api.githubcopilot.com (140.82.114.21) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=*.githubcopilot.com
*  start date: Aug 16 00:00:00 2023 GMT
*  expire date: Aug 16 23:59:59 2024 GMT
*  subjectAltName: host "api.githubcopilot.com" matched cert's "*.githubcopilot.com"
*  issuer: C=US; O=DigiCert Inc; CN=DigiCert Global G2 TLS RSA SHA256 2020 CA1
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55b34f4a50e0)
> GET /_ping HTTP/2
> Host: api.githubcopilot.com
> user-agent: curl/7.68.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 200
< date: Fri, 28 Jun 2024 08:55:59 GMT
< content-length: 2
< content-type: text/plain; charset=utf-8
< x-github-backend: Kubernetes
< x-github-request-id: CF04:18C6F0:1182239:1870D88:667E7A9F
<
* Connection #0 to host api.githubcopilot.com left intact
OK✔ /mnt/c/Users/xiang
10:55 $ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 10.255.255.254
search home

@NehalDamania
Copy link
Author

NehalDamania commented Jun 28, 2024

curl https://api.githubcopilot.com/_ping

it is returning OK, on fixed line.

> curl https://api.githubcopilot.com/_ping                                                                                                                                                                    
OK

But VS Code Copilot plugin not working though inside WSL

@NehalDamania
Copy link
Author

  • curl -v my.ip.fi
> curl -v my.ip.fi                                                                                                                                                                                            
*   Trying 91.198.120.42:80...
* TCP_NODELAY set
* Connected to my.ip.fi (91.198.120.42) port 80 (#0)
> GET / HTTP/1.1
> Host: my.ip.fi
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.18.0
< Date: Fri, 28 Jun 2024 13:01:55 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 16
< Connection: keep-alive
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Strict-Transport-Security: max-age=3600
< Upgrade-Insecure-Requests: 1
<
x.x.x.x
* Connection #0 to host my.ip.fi left intact

@chrmarti
Copy link

Could you install the latest VS Code Insiders (https://code.visualstudio.com/insiders/) and the latest GitHub Copilot Chat pre-release (currently v0.17.2024062801), run F1 > Developer: GitHub Copilot Chat Diagnostics and share the output here?

@NehalDamania
Copy link
Author

Github Copilot Chat and Github copilot is working perfectly fine in VS Code Insiders.
Here is the diagnostics output:

GitHub Copilot Chat

  • Extension Version: 0.17.2024062801 (prod)
  • VS Code: vscode/1.91.0-insider
  • OS: Linux
  • Remote Name: wsl

Network

User Settings:

  "github.copilot.advanced": {
    "debug.useElectronFetcher": false,
    "debug.useNodeFetcher": false
  }

DNS Lookup api.githubcopilot.com: 140.82.113.21

Fetching https://api.githubcopilot.com/_ping:

  • Electron Fetcher: Unavailable
  • Node Fetcher: HTTP 200
  • Helix Fetcher (configured): HTTP 200

@chrmarti
Copy link

chrmarti commented Jul 1, 2024

@NehalDamania Not sure what might make the difference. VS Code 1.91 is expected later this week. Maybe you can use VS Code Insiders until then. If it then doesn't work in 1.91 it might be a configuration issue or maybe another extension causing it.

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jul 1, 2024
@NehalDamania
Copy link
Author

@NehalDamania Not sure what might make the difference. VS Code 1.91 is expected later this week. Maybe you can use VS Code Insiders until then. If it then doesn't work in 1.91 it might be a configuration issue or maybe another extension causing it.

Thank you @chrmarti . Yes, I am using insiders now. It is working fine. Once, 1.91 releases, I will post an update on whether the issue gets resolved or not. Once again thanks

@copdips
Copy link

copdips commented Jul 4, 2024

Hello,

Just installed the latested vscode v1.91.0, the issue persists, I must set by myself a public DNS server to workaround.

@chrmarti
Copy link

chrmarti commented Jul 8, 2024

@copdips Are you getting different IP addresses from the two DNS servers? (Sorry if I missed that above.)

@copdips
Copy link

copdips commented Jul 8, 2024

both resolve to the same ip:

$ ping api.githubcopilot.com
PING glb-db52c2cf8be544.github.com (140.82.112.22) 56(84) bytes of data.
64 bytes from lb-140-82-112-22-iad.github.com (140.82.112.22): icmp_seq=1 ttl=47 time=90.8 ms
64 bytes from lb-140-82-112-22-iad.github.com (140.82.112.22): icmp_seq=2 ttl=47 time=91.7 ms
^C
--- glb-db52c2cf8be544.github.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 90.840/91.245/91.650/0.405 ms

@arnabbiswas1
Copy link

This is really a strange issue.

For me Github Copilot Chat is working when connected to one fixed internet connection where as it's not working when connected to the other one (both are from different internet service providers).

@chrmarti
Copy link

We have seen differences when connecting with ipv6 vs. ipv4. Could you run the following commands from within WSL both when Copilot is working and when it is not working:

nslookup -type=A api.githubcopilot.com
nslookup -type=AAAA api.githubcopilot.com
curl -4 -v https://api.githubcopilot.com/_ping
curl -6 -v https://api.githubcopilot.com/_ping

@arnabbiswas1
Copy link

When it's working:

(venv) arnabb:~$ nslookup -type=A api.githubcopilot.com
Server:         172.23.240.1
Address:        172.23.240.1#53

Non-authoritative answer:
api.githubcopilot.com   canonical name = glb-db52c2cf8be544.github.com.
Name:   glb-db52c2cf8be544.github.com
Address: 140.82.113.22

(venv) arnabb:~$ nslookup -type=AAAA api.githubcopilot.com
Server:         172.23.240.1
Address:        172.23.240.1#53

Non-authoritative answer:
api.githubcopilot.com   canonical name = glb-db52c2cf8be544.github.com.

(venv) arnabb:~$ curl -4 -v https://api.githubcopilot.com/_ping
*   Trying 140.82.113.22:443...
* Connected to api.githubcopilot.com (140.82.113.22) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.githubcopilot.com
*  start date: Aug  1 00:00:00 2024 GMT
*  expire date: Aug  1 23:59:59 2025 GMT
*  subjectAltName: host "api.githubcopilot.com" matched cert's "*.githubcopilot.com"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* Using Stream ID: 1 (easy handle 0x55e4d57bdeb0)
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> GET /_ping HTTP/2
> Host: api.githubcopilot.com
> user-agent: curl/7.81.0
> accept: */*
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
< HTTP/2 200 
< date: Fri, 30 Aug 2024 14:21:51 GMT
< content-length: 2
< content-type: text/plain; charset=utf-8
< x-github-backend: Kubernetes
< x-github-request-id: 3C38:F1A4B:280A56:3258EC:66D1D57E
< 
* Connection #0 to host api.githubcopilot.com left intact
OK(venv) arnabb:~curl -6 -v https://api.githubcopilot.com/_pingng
* Closing connection 0
curl: (7) Couldn't connect to server

When it's NOT working

(venv) arnabb:~$ nslookup -type=A api.githubcopilot.com
Server:         172.23.240.1
Address:        172.23.240.1#53

Non-authoritative answer:
api.githubcopilot.com   canonical name = glb-db52c2cf8be544.github.com.
Name:   glb-db52c2cf8be544.github.com
Address: 140.82.114.21
Name:   dns1.p08.nsone.net
Address: 198.51.44.8
Name:   dns2.p08.nsone.net
Address: 198.51.45.8
Name:   dns4.p08.nsone.net
Address: 198.51.45.72
Name:   ns-1283.awsdns-32.org
Address: 205.251.197.3
Name:   ns-1707.awsdns-21.co.uk
Address: 205.251.198.171
Name:   dns1.p08.nsone.net
Address: 2620:4d:4000:6259:7:8:0:1
Name:   dns3.p08.nsone.net
Address: 2620:4d:4000:6259:7:8:0:3
Name:   ns-421.awsdns-52.com
Address: 2600:9000:5301:a500::1
Name:   ns-520.awsdns-01.net
Address: 2600:9000:5302:800::1

(venv) arnabb:~$ nslookup -type=AAAA api.githubcopilot.com
Server:         172.23.240.1
Address:        172.23.240.1#53

Non-authoritative answer:
api.githubcopilot.com   canonical name = glb-db52c2cf8be544.github.com.

(venv) arnabb:~$ curl -4 -v https://api.githubcopilot.com/_ping
*   Trying 140.82.112.22:443...
* Connected to api.githubcopilot.com (140.82.112.22) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.githubcopilot.com
*  start date: Aug  1 00:00:00 2024 GMT
*  expire date: Aug  1 23:59:59 2025 GMT
*  subjectAltName: host "api.githubcopilot.com" matched cert's "*.githubcopilot.com"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* Using Stream ID: 1 (easy handle 0x55c1a5ad9eb0)
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> GET /_ping HTTP/2
> Host: api.githubcopilot.com
> user-agent: curl/7.81.0
> accept: */*
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
< HTTP/2 200 
< date: Fri, 30 Aug 2024 14:30:19 GMT
< content-length: 2
< content-type: text/plain; charset=utf-8
< x-github-backend: Kubernetes
< x-github-request-id: FE76:193E6:5E25D2:7A0F0A:66D1D77B
< 
* Connection #0 to host api.githubcopilot.com left intact
OK(venv) arnabb:~curl -6 -v https://api.githubcopilot.com/_pingng
*   Trying 2620:4d:4000:6259:7:8:0:1:443...
* Immediate connect fail for 2620:4d:4000:6259:7:8:0:1: Network is unreachable
*   Trying 2620:4d:4000:6259:7:8:0:3:443...
* Immediate connect fail for 2620:4d:4000:6259:7:8:0:3: Network is unreachable
*   Trying 2600:9000:5301:a500::1:443...
* Immediate connect fail for 2600:9000:5301:a500::1: Network is unreachable
*   Trying 2600:9000:5302:800::1:443...
* Immediate connect fail for 2600:9000:5302:800::1: Network is unreachable
* Closing connection 0
curl: (7) Couldn't connect to server
(venv) arnabb:~$ 

@chrmarti
Copy link

chrmarti commented Sep 2, 2024

@arnabbiswas1 Thanks, that seems to confirm that the ipv6 connectivity might be part of the problem. Could you also share the output of F1 > Developer: GitHub Copilot Chat Diagnostics from when it is not working?

Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@Rajvardhan222
Copy link

type: 'system',
_name: 'FetchError',
code: 'ETIMEDOUT',
errno: undefined,
erroredSysCall: undefined
}

I am not able to connect to the copilot getting this error

in WSL

@chrmarti
Copy link

@Rajvardhan222 Please check the output of F1 > Developer: GitHub Copilot Chat Diagnostics in VS Code and append it here.

I'm adding an ipv6 address lookup to this command to get better insight into the network setup.

@chrmarti chrmarti transferred this issue from microsoft/vscode Sep 16, 2024
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests