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

Logging into C# Dev Kit causes 401 with individual license #1512

Open
kroppt opened this issue Oct 4, 2024 · 8 comments
Open

Logging into C# Dev Kit causes 401 with individual license #1512

kroppt opened this issue Oct 4, 2024 · 8 comments
Assignees
Labels
area-identity Issues around subscription login/identification bug Something isn't working high-priority
Milestone

Comments

@kroppt
Copy link

kroppt commented Oct 4, 2024

Type: Bug

  1. Install C# Dev Kit
  2. Open a solution with C# Dev Kit running
  3. Log into C# Dev Kit with an individual license
  4. See error logged under "C# Dev Kit": IdeBenefitsSource: Failed to fetch entitlements. Error: 'Error: Request to https://api.subscriptions.visualstudio.microsoft.com/Me/Entitlements/IDEBenefits?api-version=2023-03-26&caller=vscode failed with status code: 401 and response ""'
  5. The language server does not function

The following did not help:

  • Ungrant and regrant account access to C# Dev Kit
  • Sign out and sign back in
  • Double check I can sign in on visualstudio.microsoft.com
  • Uninstall C# Dev Kit and C# extensions and re-install them

Extension version: 1.10.18
VS Code version: Code 1.94.0 (d78a74bcdfad14d5d3b1b782f87255d802b57511, 2024-10-02T13:08:12.626Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs AMD Ryzen 9 7950X 16-Core Processor (32 x 4492)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 63.74GB (52.09GB free)
Process Argv --crash-reporter-id a10ff85b-4c8a-4979-96cf-e564dec7cc0f
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
9c06g630:31013171
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
impr_priority:31102340
nativerepl1:31139838
refactort:31108082
pythonrstrctxt:31112756
flighttreat:31134774
wkspc-onlycs-t:31132770
wkspc-ranged-t:31151552
cf971741:31144450
autoexpandse:31146404
iacca2:31150323
5fd0e150:31146321

@Li-su0
Copy link

Li-su0 commented Oct 7, 2024

Try these methods here; they can help alleviate your urgent needs. 1384

@kroppt
Copy link
Author

kroppt commented Oct 7, 2024

Try these methods here; they can help alleviate your urgent needs. 1384

Thank you for the suggestion. Yes, I worked with only the C# extension, which does not need login. I disabled C# Dev Kit until this problem is fixed.

@phil-allen-msft phil-allen-msft added the area-identity Issues around subscription login/identification label Oct 8, 2024
@webreidi webreidi added bug Something isn't working high-priority labels Oct 14, 2024
@AyrtonAlbuquerque
Copy link

I'm also having this problem but on Ubuntu only. In my windows 11 setup it works fine but in the Ubuntu this error occurs.

@arunchndr arunchndr added this to the Oct2024 milestone Oct 29, 2024
@arunchndr
Copy link
Member

@AndreyTretyak would you please take a look? Related is #1384

@kroppt
Copy link
Author

kroppt commented Oct 30, 2024

I just tested this with the latest VSCode 1.95.0, C# 2.50.27, and C# Dev Kit 1.11.14.

The error shows up in the C# Dev Kit logs, but the behavior is a bit different. The LSP functionality appears to be working, but it's not clear whether the C# extension is falling back to Omnisharp or sticking with C# Dev Kit (somehow). It seems like it's working with the C# Dev Kit LSP.

C# logs:

Using dotnet configured on PATH
Dotnet path: C:\Program Files\dotnet\dotnet.exe
Activating C# + C# Dev Kit...
waiting for named pipe information from server...
[stdout] {"pipeName":"\\\\.\\pipe\\bab8c11a"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 8:06:16 PM] [Program] Language server initialized
[Info  - 8:06:18 PM] [WorkspaceProjectFactoryService] Project --snip--.csproj loaded by C# Dev Kit
[Info  - 8:06:18 PM] [WorkspaceProjectFactoryService] Project --snip--.csproj loaded by C# Dev Kit

C# Dev Kit logs:

Starting Spawn .NET server...
Starting opening a solution...
Starting processing the solution file "--snip--.sln" in Dev Kit server...
Using preinstalled .NET runtime at "C:\Program Files\dotnet\dotnet.exe" to load Dev Kit processes.
Found installed dotnet location "C:\Program Files\dotnet\dotnet.exe" to load projects.
.NET server started and IPC established in 695ms
Completed Spawn .NET server (1042ms)
Completed processing the solution file "--snip--.sln" in Dev Kit server (1458ms)
Starting restoring NuGet packages...
Selected configuration: <Default>, active configuration: Debug|Any CPU
Completed opening a solution (1468ms)
Starting command: "dotnet.exe" restore --snip--.sln --interactive...
Completed command: "dotnet.exe" restore --snip--.sln --interactive (539ms)
Completed restoring NuGet packages (542ms)
IdeBenefitsSource: Failed to fetch entitlements. Error: 'Error: Request to https://api.subscriptions.visualstudio.microsoft.com/Me/Entitlements/IDEBenefits?api-version=2023-03-26&caller=vscode failed with status code: 401 and response ""'
Starting Query for all projects...
Completed Query for all projects (42ms)

If it helps, I noticed the Microsoft Authentication logs show the following:

2024-10-29 20:06:17.201 [info] Getting sessions for all scopes...
2024-10-29 20:06:17.201 [info] Got 5 sessions for all scopes...
2024-10-29 20:06:18.524 [info]  for undefined
2024-10-29 20:06:18.524 [info] [--snip--/.default VSCODE_TENANT:organizations email offline_access openid profile] Got 1 sessions

Even though things are currently "working", I'd rather keep this open until we know it's fixed.

@AndreyTretyak
Copy link

We have an ongoing problem with https://api.subscriptions.visualstudio.microsoft.com service accessibility due to increased security requirements, but there is fallback https://app.vssps.visualstudio.com that we are calling for getting license that supposed to work and provider correct license.

So having this error in logs should not be blocking in any way.

Are you seeing incorrect licensing displayed by C# Dev Kit?
Are there any problems caused aside of this message being in the logs?
Even with us failing to obtain license via both sources you should be able to fully use C# Dev Kit without any blockers.

@AndreyTretyak AndreyTretyak modified the milestones: Oct2024, Dec2024 Nov 14, 2024
@kroppt
Copy link
Author

kroppt commented Nov 16, 2024

@AndreyTretyak

Are you seeing incorrect licensing displayed by C# Dev Kit?

When I click on the C# button in the bottom right, it says, "This software is licensed to --snip-- under an individual license." That is the correct license.

Are there any problems caused aside of this message being in the logs?

No, not currently.

I don't know why it was failing initially and now functions. I don't know whether there was a bug that got fixed or if it was just "fricked". You may close it if you think that the bug does not exist.

@AyrtonAlbuquerque Are you still getting this issue?

@AyrtonAlbuquerque
Copy link

@AndreyTretyak

Are you seeing incorrect licensing displayed by C# Dev Kit?

When I click on the C# button in the bottom right, it says, "This software is licensed to --snip-- under an individual license." That is the correct license.

Are there any problems caused aside of this message being in the logs?

No, not currently.

I don't know why it was failing initially and now functions. I don't know whether there was a bug that got fixed or if it was just "fricked". You may close it if you think that the bug does not exist.

@AyrtonAlbuquerque Are you still getting this issue?

I'm not. everything seems fine now, although i have not changed anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-identity Issues around subscription login/identification bug Something isn't working high-priority
Projects
None yet
Development

No branches or pull requests

7 participants