GitHub login failed - Persists after #160649
Problem Description
I encountered the same issue as #160649, but the suggested solutions didn't resolve it on my system.
Environment
- VS Code Version: Code 1.97.2 (2025-02-12T23:20:35.343Z)
- OS Version: Linux x64 6.8.0-54-generic snap (Ubuntu 22.04)
- Steps to Reproduce:
1.Trigger GitHub login in VS Code
·Click "Sign in to GitHub" in VS Code's account menu (or through extensions like GitHub pull and request).
2.Browser authentication completes successfully
·VS Code opens the default browser automatically.
·Log in to GitHub via the browser
3.Browser redirects back to VS Code
4.VS Code hangs indefinitely ·The status in VS Code remains stuck on "Signing in to github.com..." . ·No error messages appear, and the process never completes (waited over 10 minutes).
What I've Tried
- 1.Attempted to cancel and trigger alternative login methods Clicked "Cancel" during the stuck login process, but no prompt appeared to switch to other authentication methods (e.g., device code or local server).
- 2.Disabled proxy support in VS Code settings Modified "http.proxySupport": "off" in settings.json Result: The login process still hung indefinitely on "Signing in to github.com...".
- 3.Disabled strict SSL verification for proxy Unchecked the "http.proxyStrictSSL" option (which controls proxy certificate validation against CAs). Result: No change — login remained stuck.
- 4.Modified hosts file and attempted local server login
Commented out the top two lines in /etc/hosts (likely related to GitHub domain mappings).
After clicking "Cancel", VS Code finally prompted: "Try signing in using the local server?".
Selected "Yes", and the browser displayed:
However:Returned to VS Code, but the login failed silently (no error message).VS Code then asked to try the device code flow.
Attempted device code login, which ultimately reported:
Can you follow these steps so that we can get more information on what's going on?
Enable trace logging
- Open the Command Palette (cmd/ctrl+shift+p)
- Run the
Developer: Set Log Level...command - To the right of
Trace, click the double check mark button. ✔️ ✔️ (enables trace logging as the default)
Now wait for the issue to happen or trigger it...
Getting the logs
- Open the Command Palette again (cmd/ctrl+shift+p)
- Run the
Output: Show Output Channels...command - Choose
GitHub Authentication - Copy and paste the contents of what opens in the panel in this issue (if the contents is too large, you may need to upload it as a file)
Reverting trace logging (optional)
When we're done here, to revert the log level back to the default:
- Open the Command Palette
- Run the
Developer: Set Log Level...command - To the right of
Info, click the double check mark button. ✔️ ✔️ (to set the default back to info)
Logs Collected
I've enabled trace logging and reproduced the issue. Below are the logs from the GitHub Authentication channel:
2025-03-06 16:08:42.185 [info] Logging in with 'any' account...
2025-03-06 16:08:42.185 [info] Logging in for the following scopes: read:user repo user:email workflow
2025-03-06 16:08:42.201 [info] Trying without local server... (read:user repo user:email workflow)
2025-03-06 16:08:50.019 [info] Exchanging code for token...
2025-03-06 16:10:07.922 [info] Logging in with 'any' account...
2025-03-06 16:10:07.922 [info] Logging in for the following scopes: read:user repo user:email workflow
2025-03-06 16:10:07.927 [info] Trying without local server... (read:user repo user:email workflow)
2025-03-06 16:10:16.147 [info] Exchanging code for token...
2025-03-06 16:11:39.311 [info] Getting sessions for codespace,read:user,repo,user:email...
2025-03-06 16:11:39.311 [info] Got 0 sessions for codespace,read:user,repo,user:email...
2025-03-06 16:11:39.570 [info] Getting sessions for codespace,read:user,repo,user:email...
2025-03-06 16:11:39.570 [info] Got 0 sessions for codespace,read:user,repo,user:email...
2025-03-06 16:11:42.850 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-06 16:11:42.850 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-06 16:11:44.302 [info] Logging in with 'any' account...
2025-03-06 16:11:44.302 [info] Logging in for the following scopes: read:user repo user:email workflow
2025-03-06 16:11:44.309 [info] Trying without local server... (read:user repo user:email workflow)
2025-03-06 16:11:52.164 [info] Exchanging code for token...
Additional Context
- Browser Used for Login: Microsoft Edge 133.0.3065.92
- Proxy/VPN: proxy used
Please let me know if further details are needed.
The logs you've shared are from correct channel, but they don't seem complete... are you sure you copied everything?
Because you have a proxy, can you open the Command Palette (cmd/ctrl+shift+p) and run the following command:
>Developer: GitHub Copilot Chat Diagnostics
Please share the output here. Cc @chrmarti
@chrmarti Thanks for the follow-up. Here are the updated details:
1. Complete GitHub Authentication Logs (2025-03-07)
I re-collected the logs today, and they now show more entries. Below is the full output:
2025-03-07 12:26:29.080 [info] Reading sessions from keychain...
2025-03-07 12:26:29.080 [info] Getting sessions for all scopes...
2025-03-07 12:26:29.080 [info] Getting sessions for all scopes...
2025-03-07 12:26:29.080 [info] Getting sessions for all scopes...
2025-03-07 12:26:29.080 [info] Getting sessions for all scopes...
2025-03-07 12:26:29.080 [info] Getting sessions for all scopes...
2025-03-07 12:26:29.080 [info] Getting sessions for all scopes...
2025-03-07 12:26:29.080 [info] Getting sessions for all scopes...
2025-03-07 12:26:29.080 [info] Getting sessions for all scopes...
2025-03-07 12:26:31.074 [info] Got 0 sessions for ...
2025-03-07 12:26:31.074 [info] Got 0 sessions for ...
2025-03-07 12:26:31.074 [info] Got 0 sessions for ...
2025-03-07 12:26:31.074 [info] Got 0 sessions for ...
2025-03-07 12:26:31.074 [info] Got 0 sessions for ...
2025-03-07 12:26:31.074 [info] Got 0 sessions for ...
2025-03-07 12:26:31.074 [info] Got 0 sessions for ...
2025-03-07 12:26:31.074 [info] Got 0 sessions for ...
2025-03-07 12:26:31.114 [info] Getting sessions for all scopes...
2025-03-07 12:26:31.114 [info] Got 0 sessions for ...
2025-03-07 12:26:31.824 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-07 12:26:31.824 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-07 12:26:33.169 [info] Getting sessions for project,read:org,read:user,repo,user:email,workflow...
2025-03-07 12:26:33.169 [info] Got 0 sessions for project,read:org,read:user,repo,user:email,workflow...
2025-03-07 12:26:33.213 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-07 12:26:33.213 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-07 12:26:33.263 [info] Getting sessions for read:user,repo,user:email...
2025-03-07 12:26:33.263 [info] Got 0 sessions for read:user,repo,user:email...
2025-03-07 12:26:33.266 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-07 12:26:33.266 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-07 12:28:12.105 [info] Logging in with 'any' account...
2025-03-07 12:28:12.105 [info] Logging in for the following scopes: read:user repo user:email workflow
2025-03-07 12:28:12.140 [info] Trying without local server... (read:user repo user:email workflow)
2025-03-07 12:28:25.111 [info] Exchanging code for token...
2025-03-07 13:02:14.125 [info] Reading sessions from keychain...
2025-03-07 13:02:14.125 [info] Getting sessions for all scopes...
2025-03-07 13:02:14.125 [info] Got 0 sessions for ...
2025-03-07 13:02:14.125 [info] Getting sessions for all scopes...
2025-03-07 13:02:14.125 [info] Got 0 sessions for ...
2025-03-07 13:02:14.125 [info] Getting sessions for all scopes...
2025-03-07 13:02:14.125 [info] Got 0 sessions for ...
2025-03-07 13:02:14.644 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:14.644 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:16.690 [info] Getting sessions for project,read:org,read:user,repo,user:email,workflow...
2025-03-07 13:02:16.690 [info] Got 0 sessions for project,read:org,read:user,repo,user:email,workflow...
2025-03-07 13:02:16.698 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:16.698 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:16.796 [info] Getting sessions for read:user,repo,user:email...
2025-03-07 13:02:16.796 [info] Got 0 sessions for read:user,repo,user:email...
2025-03-07 13:02:16.919 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:16.919 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:41.245 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:41.246 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:41.247 [info] Getting sessions for all scopes...
2025-03-07 13:02:41.247 [info] Got 0 sessions for ...
2025-03-07 13:02:41.247 [info] Getting sessions for all scopes...
2025-03-07 13:02:41.247 [info] Got 0 sessions for ...
2025-03-07 13:02:41.288 [info] Getting sessions for read:user...
2025-03-07 13:02:41.288 [info] Got 0 sessions for read:user...
2025-03-07 13:02:41.288 [info] Getting sessions for user:email...
2025-03-07 13:02:41.288 [info] Got 0 sessions for user:email...
2025-03-07 13:02:41.288 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:41.288 [info] Got 0 sessions for read:user,repo,user:email,workflow...
2025-03-07 13:02:41.289 [info] Getting sessions for user:email...
2025-03-07 13:02:41.289 [info] Got 0 sessions for user:email...
2025-03-07 13:02:41.289 [info] Getting sessions for all scopes...
2025-03-07 13:02:41.289 [info] Got 0 sessions for ...
2025-03-07 13:02:41.343 [info] Getting sessions for user:email...
2025-03-07 13:02:41.343 [info] Got 0 sessions for user:email...
2025-03-07 13:02:41.344 [info] Getting sessions for all scopes...
2025-03-07 13:02:41.344 [info] Got 0 sessions for ...
2025-03-07 13:02:41.346 [info] Getting sessions for user:email...
2025-03-07 13:02:41.346 [info] Got 0 sessions for user:email...
2025-03-07 13:02:49.468 [info] Logging in with 'any' account...
2025-03-07 13:02:49.469 [info] Logging in for the following scopes: user:email
2025-03-07 13:02:49.494 [info] Trying without local server... (user:email)
2025-03-07 13:02:54.674 [info] Exchanging code for token...
2. Running Developer: GitHub Copilot Chat Diagnostics
- Executed the command, but no direct output was generated in the panel.
- However, I noticed logs related to GitHub Copilot/Chat in the
Outputchannels.
3. GitHub Copilot & Copilot Chat Logs
- GitHub Copilot
2025-03-07 13:02:41.311 [info] [certificates] Removed 1 expired certificates - GitHub Copilot Chat
2025-03-07 13:02:41.288 [info] Using the Electron fetcher. 2025-03-07 13:02:41.288 [info] Initializing Git extension service. 2025-03-07 13:02:41.288 [info] Successfully activated the vscode.git extension. 2025-03-07 13:02:41.288 [info] Enablement state of the vscode.git extension: true. 2025-03-07 13:02:41.288 [info] Successfully registered Git commit message provider. 2025-03-07 13:02:41.348 [warning] GitHub login failed 2025-03-07 13:02:41.348 [info] copilot token chat_enabled: undefined, sku: 2025-03-07 13:02:41.348 [debug] onDidChangeSessionsHandler has token: false
@WaterWhisperer the output of Developer: GitHub Copilot Chat Diagnostics actually shows up in the editor. It should open an editor and write stuff into it. Do you not see that?
@TylerLeonhardt Here's the updated information based on your guidance:
1. Clean Environment Test Results
- Tested with a fresh VS Code instance:
code --user-data-dir /tmp/vscode-test --disable-extensions
- Result: The same issue persists.
2. Command Execution Behavior
- Command Availability:
TheDeveloper: GitHub Copilot Chat Diagnosticsoption is visible in the command palette. - Post-Execution Behavior:
- After selecting the command, no editor window opens.
- No output files are generated in
/tmp(e.g.,vscode-diags-*).
https://github.com/user-attachments/assets/7ee7e8b8-34c8-4955-9540-92f0d79d0408
3. Log Analysis
- Logs Directory:
/tmp/vscode-test/logs - No errors related to Copilot diagnostics found in
main.log.
Environment Details
- OS: Ubuntu 22.04 LTS
- VS Code: 1.98.0
- GitHub Copilot: v1.277.0
- GitHub Copilot Chat: v0.25.0
- Proxy/VPN: proxy used
Could you install the Network Proxy Test extension (https://marketplace.visualstudio.com/items?itemName=chrmarti.network-proxy-test) and check the output of F1 > Network Proxy Test: Test Connection in VS Code?
I have installed the Network Proxy Test extension and performed the connection test. Details below:
1. Test Output Log: Note: Make sure to replace all sensitive information with dummy values before sharing this output.
VS Code 1.98.1 (2fc07b811f760549dab9be9d2bedd06c51dfcb9a) Network Proxy Test 0.0.17 linux 6.8.0-56-generic x64
DNS:
- Servers: 127.0.0.53
- Result Order: ipv4first
- Auto Select Family: true
- Auto Select Family Attempt Timeout: 250
- Lookup: 140.82.112.21 (8 ms)
Proxy:
- URL: http://127.0.0.1:7897 (7 ms)
- Connection: 200 Connection established (2 ms)
Sending GET request to https://api.githubcopilot.com... Received response:
- Status: 404 Not Found Certificate chain:
- Subject: .githubcopilot.com Subject alt: DNS:.githubcopilot.com, DNS:githubcopilot.com Validity: Aug 1 00:00:00 2024 GMT - Aug 1 23:59:59 2025 GMT Fingerprint: 8D:C4:7D:28:E8:BF:72:45:F8:F8:C1:40:90:93:7F:09:EC:6B:3D:6F
- Subject: Sectigo RSA Domain Validation Secure Server CA (Sectigo Limited) Validity: Nov 2 00:00:00 2018 GMT - Dec 31 23:59:59 2030 GMT Fingerprint: 33:E4:E8:08:07:20:4C:2B:61:82:A3:A1:4B:59:1A:CD:25:B5:F0:DB
- Subject: USERTrust RSA Certification Authority (The USERTRUST Network) Validity: Mar 12 00:00:00 2019 GMT - Dec 31 23:59:59 2028 GMT Fingerprint: D8:9E:3B:D4:3D:5D:90:9B:47:A1:89:77:AA:9D:5C:E3:6C:EE:18:4C
- Subject: AAA Certificate Services (Comodo CA Limited) Validity: Jan 1 00:00:00 2004 GMT - Dec 31 23:59:59 2028 GMT Fingerprint: D1:EB:23:A4:6D:17:D6:8F:D9:25:64:C2:F1:F1:60:17:64:D8:E3:49 Self-signed Local root certificates:
- Subject: C=GB ST=Greater Manchester L=Salford O=Comodo CA Limited CN=AAA Certificate Services (built-in and OS) Validity: Jan 1 00:00:00 2004 GMT - Dec 31 23:59:59 2028 GMT Fingerprint: D1:EB:23:A4:6D:17:D6:8F:D9:25:64:C2:F1:F1:60:17:64:D8:E3:49 Issuer: C=GB ST=Greater Manchester L=Salford O=Comodo CA Limited CN=AAA Certificate Services
Sending GET request to https://api.githubcopilot.com using fetch from Electron... Received response:
- Status: 404
Sending GET request to https://api.githubcopilot.com using fetch from Node.js... Received response:
- Status: 404 Not Found
Sending GET request to https://api.githubcopilot.com using fetch from Node.js (allow HTTP2)... Received response:
- Status: 404
2. Environment Info:
- VS Code Version: 1.98.1
- Proxy Used: Yes
3. Notes:
- Test URL used:
https://api.githubcopilot.com(no additional paths).
That seems to work.
When you run the diagnostics command from Copilot Chat in your recording the extension seems to wait on the login that is still pending. Could you rerun that command without the login?
I have rerun the diagnostic command (without triggering the login process) as per your suggestion and recorded a new operation screen recording.
https://github.com/user-attachments/assets/bf3c43da-a638-4440-9fe4-c32689cd60b1
@lramos15 Not sure why the diagnostics command doesn't work. That shouldn't depend on being signed in.
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!
Diagnostics does not work for me either.
Update & Resolution
Hi @chrmarti and VS Code team,
I wanted to provide an update on this issue. After some time, the GitHub login in VS Code suddenly started working for me without any explicit changes on my end. Earlier, I tried switching from the Snap package to the official .deb installation (as a troubleshooting step), but the problem persisted at that time. It’s unclear what exactly resolved it, but it might have been a combination of system updates or network configuration adjustments.
While the root cause remains ambiguous, I’m sharing this in case others encounter similar behavior. Sometimes waiting for background updates (or retrying after a system reboot) might help.
Thank you for your initial support, and apologies for the delayed resolution update!