azuredatastudio
azuredatastudio copied to clipboard
Failed to get copilot token due to 401 status. Please sign out and try again
Type: Bug
Hi, I've tried signing out and back in from VS STudio, I'm still facing this issue. It was working fine on my perssonal account when on a trial period.
My organization has given me a license now my activation is failing on Data Studio , but is OK on VS STudio
[INFO] [auth] [2023-10-04T08:52:42.704Z] Failed to get copilot token due to 401 status. Please sign out and try again. [ERROR] [default] [2023-10-04T08:52:42.706Z] GitHub Copilot could not connect to server. Extension activation failed: "Your GitHub token is invalid. Please sign out from your GitHub account using VSCode UI and try again."
Azure Data Studio version: azuredatastudio 1.46.0 (39449bbe88a0bc4092c9b205cad10d0a556beffd, 2023-09-16T01:40:10.706Z) OS version: Windows_NT x64 10.0.19045 Restricted Mode: No Preview Features: Enabled Modes:
System Info
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz (12 x 2712) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
Load (avg) | undefined |
Memory (System) | 31.61GB (20.33GB free) |
Process Argv | |
Screen Reader | no |
VM | 0% |
Extensions (12)
Extension | Author (truncated) | Version |
---|---|---|
copilot | Git | 1.95.239 |
admin-pack | Mic | 0.0.2 |
agent | Mic | 0.49.0 |
arc | Mic | 1.8.0 |
azcli | Mic | 1.8.0 |
dacpac | Mic | 1.14.0 |
import | Mic | 1.5.5 |
machine-learning | Mic | 0.12.0 |
profiler | Mic | 0.14.0 |
schema-compare | Mic | 1.21.0 |
sql-database-projects | Mic | 1.3.1 |
sql-migration | Mic | 1.4.9 |
I am currently experiencing the same issue. I tried many different methods to log off and log back in (via VSCode UI) but alas, nothing works.
I have the same issue on one device but on another, it works as expected.
Got this today on the VS Code Insiders and the regular VS Code version. As this is an extension for a paid feature (GitHub Copilot individual/ enterprise) I would expect to get a (hot-)fix for this asap and not in February @kisantia. Co-Pilot is practically not usable.
I tried rm -Rf ~/.vscode
and a fresh installation: nothing works.
@lewis-sanchez please take a look into this when you get a chance
Hi I am using Cursor and experienced with same issue. I tried to log off from VS code and log in again but nothing worked.
Same issue in my local
[INFO] [auth] [2023-11-17T19:04:58.191Z] Failed to get copilot token due to 401 status. Please sign out and try again.
[ERROR] [default] [2023-11-17T19:04:58.194Z] Extension activation failed: "Failed to get copilot token due to 401 status. Please sign out and try again."
Solution:
I realized that my Visual Studio Code was already signed in to my existing account. Therefore, I needed to log out in order to sign back in with the account where my Copilot subscription is enabled.
I have the same issue, and try to sign in again but not working
Same issue in my local
[INFO] [auth] [2023-11-17T19:04:58.191Z] Failed to get copilot token due to 401 status. Please sign out and try again. [ERROR] [default] [2023-11-17T19:04:58.194Z] Extension activation failed: "Failed to get copilot token due to 401 status. Please sign out and try again."
Solution:
I realized that my Visual Studio Code was already signed in to my existing account. Therefore, I needed to log out in order to sign back in with the account where my Copilot subscription is enabled.
Here's how I got this working on my machine:
- In the left bar at the bottom, there's an icon above the settings icon that looks like a little person (this is the "Accounts" icon). Click on this.
- Click on "username (GitHub)" then "Sign Out"
- Click on the Github Copilot icon in the tray at the bottom, and pick "Sign in to GitHub". This will either open a browser to make you sign in, or it might make an alert popup with a buttom that will let you sign into GitHub (inexplicably requiring two clicks).
- After signing in, the Copilot icon should lose the "!" and copilot should start working.
VS code remove the Account icon. Hence, I removed the authentication from my github account. Since then I am logged out, but I can no longer sign-in with my github work account. If I 1) click on the "settings" icon, 2)click on "Backup and Settings" 3) click on "Sign in" it suggests me my legacy github account and there is no way to sign in with another account. Is there any way to log in with my new work github account?
Hi I am using Cursor and experienced with same issue. I tried to log off from VS code and log in again but nothing worked.
Have you managed to resolve it on Cursor? I have the same issue for a month. Even weirder on VS code it works fine, it's just cursor.
Here's how I got this working on my machine:
- In the left bar at the bottom, there's an icon above the settings icon that looks like a little person (this is the "Accounts" icon). Click on this.
- Click on "username (GitHub)" then "Sign Out"
- Click on the Github Copilot icon in the tray at the bottom, and pick "Sign in to GitHub". This will either open a browser to make you sign in, or it might make an alert popup with a buttom that will let you sign into GitHub (inexplicably requiring two clicks).
- After signing in, the Copilot icon should lose the "!" and copilot should start working.
![]()
Thanks! It works for me!
I was signed in to two different github accounts. signed out of one and restart fixed the problem
install an older version of copilot that works, I currently have v1.168.0
Here's how I got this working on my machine:
- In the left bar at the bottom, there's an icon above the settings icon that looks like a little person (this is the "Accounts" icon). Click on this.
- Click on "username (GitHub)" then "Sign Out"
- Click on the Github Copilot icon in the tray at the bottom, and pick "Sign in to GitHub". This will either open a browser to make you sign in, or it might make an alert popup with a buttom that will let you sign into GitHub (inexplicably requiring two clicks).
- After signing in, the Copilot icon should lose the "!" and copilot should start working.
![]()
@jwalton this doesn't work for Cursor. I have the same issue as @blushvoid Cursor doesn't have the "Profile icon" on the bottom left. Clicking on the copilot on the bottom right and "signin" doesn't open a window but show two error toasts: "Your GitHub token is invalid. Please sign out from your GitHub account using the VS Code accounts menu and try again." and "Extension activation failed: "Failed to get copilot token due to 401 status. Please sign out and try again.""
@realcaldeira in Cursor Installing the older version of copilot didn't help.
Anyone has been able to fix this in Cursor ?
Addendum: 2024-03-10 14:43:49 I was able to find a fix @jwalton @realcaldeira @blushvoid @abiyevseymur:
- Change Activity Bar Orientation:
- Open your VS Code User Settings (JSON) by typing "json settings" in the command palette and selecting "Preferences: Open Settings (JSON)".
- Add the following line to your settings:
"workbench.activityBar.orientation": "vertical"
- Click "Restart" when prompted to apply the change.
- Sign in to GitHub Copilot:
- Locate the Activity Bar, now on the left side of the screen.
- Click the account icon at the bottom of the Activity Bar.
- Select "Sign in with GitHub to use GitHub Copilot."
- Follow the prompts to copy your authorization code, continue to GitHub, log in, and authorize Copilot access.
- Upon returning to VS Code, the Copilot icon should now be working correctly.
Open your VS Code User Settings (JSON) by typing "json settings" in the command palette and selecting "Preferences: Open Settings (JSON)".
Add the following line to your settings: "workbench.activityBar.orientation": "vertical"
Click "Restart" when prompted to apply the change.
Click the account icon at the bottom of the Activity Bar and select "Sign in with GitHub to use GitHub Copilot."
Follow the prompts to copy your authorization code, continue to GitHub, log in, and authorize Copilot access.
the Copilot icon should now be working correctly
Type: Bug
Hi, I've tried signing out and back in from VS STudio, I'm still facing this issue. It was working fine on my perssonal account when on a trial period.
My organization has given me a license now my activation is failing on Data Studio , but is OK on VS STudio
[INFO] [auth] [2023-10-04T08:52:42.704Z] Failed to get copilot token due to 401 status. Please sign out and try again. [ERROR] [default] [2023-10-04T08:52:42.706Z] GitHub Copilot could not connect to server. Extension activation failed: "Your GitHub token is invalid. Please sign out from your GitHub account using VSCode UI and try again."
Azure Data Studio version: azuredatastudio 1.46.0 (39449bb, 2023-09-16T01:40:10.706Z) OS version: Windows_NT x64 10.0.19045 Restricted Mode: No Preview Features: Enabled Modes:
System Info Extensions (12)
I log out and re log in the github account of visual studio code and it works.
Type: Bug
Hi, I've tried signing out and back in from VS STudio, I'm still facing this issue. It was working fine on my perssonal account when on a trial period.
My organization has given me a license now my activation is failing on Data Studio , but is OK on VS STudio
[INFO] [auth] [2023-10-04T08:52:42.704Z] Failed to get copilot token due to 401 status. Please sign out and try again. [ERROR] [default] [2023-10-04T08:52:42.706Z] GitHub Copilot could not connect to server. Extension activation failed: "Your GitHub token is invalid. Please sign out from your GitHub account using VSCode UI and try again."
Azure Data Studio version: azuredatastudio 1.46.0 (39449bb, 2023-09-16T01:40:10.706Z) OS version: Windows_NT x64 10.0.19045 Restricted Mode: No Preview Features: Enabled Modes:
System Info Extensions (12)
- I encountered this problem and I tried to uninstall azure... and folder in C:\Users{Username}\AppData\Roaming\Azuredatastudio. Then I reinstalled azure and the problem was solved !
Simply reloading my window from the command palette "> Developer: Reload Window" resolved my issue.