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

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

Closed
karolz-ms opened this issue Aug 9, 2024 · 9 comments
Assignees
Labels
area-telemetry bug Something isn't working

Comments

@karolz-ms
Copy link

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

  • Windows 11 fully patched (MS corp machine)
  • VS Code 1.92.1 (latest stable)
  • C# Dev Kit v1.9.55 (latest stable, have seen the same issue with a couple of previous versions too)
@karolz-ms karolz-ms added the bug Something isn't working label Aug 9, 2024
@lifengl
Copy link
Member

lifengl commented Aug 9, 2024

loop in @jonathanjyi

@jonathanjyi
Copy link

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
Copy link
Author

@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
Copy link
Member

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
Copy link

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
Copy link
Member

mjrousos commented Aug 26, 2024

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

@jonathanjyi
Copy link

This is still being investigated.

@jonathanjyi
Copy link

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

@jonathanjyi
Copy link

Fixed with release 1.10.18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-telemetry bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants