microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
221 stars 10 forks source link

[BUG] C# language server fails to start with ArgumentException: filePath from telemetry subsystem #1354

Open karolz-ms opened 1 month ago

karolz-ms commented 1 month ago

Describe the Issue

I am getting the following error message when VS Code is started with C# Dev Kit extension isntalled

Using dotnet configured on PATH
Dotnet path: C:\Program Files\dotnet\dotnet.exe
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stderr] Unhandled exception: System.ArgumentException: filePath
   at Microsoft.VisualStudio.Telemetry.CommonProperty.CommonPropertyParserFactory.GetCommonPropertyParser(TelemetrySessionInternalBase session)
   at Microsoft.VisualStudio.Telemetry.TelemetrySessionInternalBase.LoadCommonProperties()
   at Microsoft.CodeAnalysis.LanguageServer.Logging.VSCodeTelemetryLogger.InitializeSession(String telemetryLevel, String sessionId, Boolean isDefaultSession)
   at Microsoft.CodeAnalysis.LanguageServer.Logging.RoslynLogger.Initialize(ITelemetryReporter reporter, String telemetryLevel, String sessionId) in /_/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Logging/RoslynLogger.cs:line 41
   at Program.<<Main>$>g__RunAsync|0_0(ServerConfiguration serverConfiguration, CancellationToken cancellationToken) in /_/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Program.cs:line 100
   at System.CommandLine.CliCommand.<>c__DisplayClass32_0.<<SetAction>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
Language server process exited with 1
[Error - 9:25:35 AM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
Error: Language server process exited unexpectedly
    at ChildProcess.<anonymous> (C:\Users\karolz\scoop\persist\vscode\data\extensions\ms-dotnettools.csharp-2.41.26-win32-x64\dist\extension.js:2:1264544)
    at ChildProcess.emit (node:events:531:35)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12)

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

lifengl commented 1 month ago

loop in @jonathanjyi

jonathanjyi commented 1 month ago

Thanks for reporting @karolz-ms, I'll start taking a look.

In the meantime, can you check if deleting the files under %Temp%\csdevkit and restarting, resolves your issue?

karolz-ms commented 1 month ago

@jonathanjyi thank you. Deleting files under TEMP\csdevkit did in fact resolve the issue, now the output from the extension is as below, which I assume is normal:

Using dotnet configured on PATH
Dotnet path: C:\Program Files\dotnet\dotnet.exe
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stdout] {"pipeName":"\\\\.\\pipe\\672de537"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 2:57:33 PM] [Program] Language server initialized
[Info  - 2:57:40 PM] [WorkspaceProjectFactoryService] Project C:\Users\karolz\code\usvc-apiserver\.azure\DcpNuGet\DcpNuGet.csproj loaded by C# Dev Kit
[Info  - 2:57:40 PM] [WorkspaceProjectFactoryService] Project C:\Users\karolz\code\usvc-apiserver\.azure\ArcadeManifest\ArcadeManifest.csproj loaded by C# Dev Kit
mjrousos commented 2 weeks ago

I'm running into the same error when starting VS Code from WSL. I've tried uninstalling C# Dev Kit, deleting files from ~/.vscode-server/extensions, and re-installing, but I continue to get the error. I've also tried deleting files in %Temp%\csdevkit and that didn't help.

Is there a path similar to %Temp%\csdevkit for WSL that I should be clearing?

This is the error I'm getting:

Using dotnet configured on PATH
Dotnet path: /usr/share/dotnet/dotnet
Activating C# + C# Dev Kit...
waiting for named pipe information from server...
[stderr] Unhandled exception: [stderr] System.ArgumentException: filePath
   at Microsoft.VisualStudio.Telemetry.CommonProperty.CommonPropertyParserFactory.GetCommonPropertyParser(TelemetrySessionInternalBase session)
   at Microsoft.VisualStudio.Telemetry.TelemetrySessionInternalBase.LoadCommonProperties()
   at Microsoft.CodeAnalysis.LanguageServer.Logging.VSCodeTelemetryLogger.InitializeSession(String telemetryLevel, String sessionId, Boolean isDefaultSession)
   at Microsoft.CodeAnalysis.LanguageServer.Logging.RoslynLogger.Initialize(ITelemetryReporter reporter, String telemetryLevel, String sessionId) in /_/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Logging/RoslynLogger.cs:line 41
   at Program.<<Main>$>g__RunAsync|0_0(ServerConfiguration serverConfiguration, CancellationToken cancellationToken) in /_/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Program.cs:line 100
   at System.CommandLine.CliCommand.<>c__DisplayClass32_0.<<SetAction>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
Language server process exited with 1
[Error - 4:43:56 PM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
Error: Language server process exited unexpectedly
    at ChildProcess.<anonymous> (/home/mike/.vscode-server/extensions/ms-dotnettools.csharp-2.39.29-linux-x64/dist/extension.js:2:1263868)
    at ChildProcess.emit (node:events:531:35)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12)
jonathanjyi commented 2 weeks ago

Hi @mjrousos, what versions of C# Dev Kit are you using?

If you're running VSCode from inside WSL, then you may need to delete the folders inside the linux instance itself under /tmp/csdevkit.

Let me know if that helps.

mjrousos commented 2 weeks ago

Thanks, @jonathanjyi. Unfortunately, I'm still seeing the failure even after clearing /tmp/csdevkit. Same error as before. Version: 1.9.55.

jonathanjyi commented 1 week ago

This is still being investigated.

jonathanjyi commented 5 days ago

Hi @mjrousos can you let us know if you're still hitting this error after the latest updates?