dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.88k stars 676 forks source link

LanguageServer: connection to server is erroring. Shutting down server. #6277

Open bobombolo opened 1 year ago

bobombolo commented 1 year ago

Type: Bug

Issue Description

Steps to Reproduce

fresh install of vsc

Expected Behavior

highlighting and code completion to work

Actual Behavior

none of that works

Logs

Using dotnet configured on PATH Dotnet path: /usr/lib/dotnet/dotnet Activating C# + C# Dev Kit + C# IntelliCode... [Info - 09:00:56] [Program]Language server initialized [Error - 09:01:15] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server. [Error - 09:01:15] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server. [Error - 09:01:15] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server. [Error - 09:01:15] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server. [Error - 09:01:15] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server. [Error - 09:01:15] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server. [Error - 09:01:17] Stopping server timed out [Error - 09:01:17] Stopping server failed Error: Stopping the server timed out at /home/owner/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2252653 [Error - 09:01:17] Stopping server failed Error: Stopping the server timed out at /home/owner/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2252653 [Error - 09:01:17] Stopping server failed Error: Stopping the server timed out at /home/owner/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2252653 [Error - 09:01:17] Stopping server failed Error: Stopping the server timed out at /home/owner/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2252653 [Error - 09:01:17] Stopping server failed Error: Stopping the server timed out at /home/owner/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2252653 [Error - 09:01:17] Stopping server failed Error: Stopping the server timed out at /home/owner/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2252653 [Error - 09:01:19] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server. Using dotnet configured on PATH

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires `dotnet.server.trace` to be set to `Trace`

Environment information

VSCode version: 1.81.1 C# Extension: 2.0.436 Using OmniSharp: false

Dotnet Information .NET SDK: Version: 7.0.110 Commit: ba920f88ac Runtime Environment: OS Name: linuxmint OS Version: 21.2 OS Platform: Linux RID: ubuntu.22.04-x64 Base Path: /usr/lib/dotnet/sdk/7.0.110/ Host: Version: 7.0.10 Architecture: x64 Commit: a6dbb800a4 .NET SDKs installed: 6.0.121 [/usr/lib/dotnet/sdk] 7.0.110 [/usr/lib/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.21 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.10 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.21 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.10 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Other architectures found: None Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
Visual Studio Code Extensions |Extension|Author|Version|Folder Name| |---|---|---|---| |csdevkit|ms-dotnettools|0.4.10|ms-dotnettools.csdevkit-0.4.10-linux-x64| |csharp|ms-dotnettools|2.0.436|ms-dotnettools.csharp-2.0.436-linux-x64| |vscode-dotnet-runtime|ms-dotnettools|1.7.2|ms-dotnettools.vscode-dotnet-runtime-1.7.2| |vscodeintellicode-csharp|ms-dotnettools|0.1.26|ms-dotnettools.vscodeintellicode-csharp-0.1.26-linux-x64|;

Extension version: 2.0.436 VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:18:39.991Z) OS version: Linux x64 5.15.0-82-generic Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 6600H with Radeon Graphics (12 x 1800)| |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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|14.84GB (7.37GB free)| |Process Argv|--unity-launch --crash-reporter-id b44ea91b-4122-46c5-b5a6-f10a82d6673f| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|mate| |XDG_CURRENT_DESKTOP|MATE| |XDG_SESSION_DESKTOP|mate| |XDG_SESSION_TYPE|x11|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 vscaat:30438848 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vsccc:30803844 3biah626:30602489 f6dab269:30613381 vscrpc:30673769 showlangstatbar:30737416 0bi6i642:30823812 03d35959:30757346 7ij38806:30736111 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxptcf:30805731 pythonnoceb:30805159 dsvsc013:30795093 dsvsc014:30804076 diffeditorv1:30821571 dsvsc015cf:30823818 ```
bobombolo commented 1 year ago

actually the first time i opened a file it worked, after that it was broken.

bobombolo commented 1 year ago

i also tried changing the settings.json "dotnetAcquisitionExtension.existingDotnetPath" to /usr/share/dotnet or /usr/lib/dotnet/dotnet to no avail

dibarbet commented 1 year ago

@bobombolo two requests -

  1. can you set the dotnet.server.trace configuration to Trace and post the contents of the C# log here?
  2. It looks like the process is still active and failing to shutdown, so a process dump here would be useful. The instructions to collect a dump via dotnet-dump are here - https://github.com/dotnet/diagnostics/blob/main/documentation/dotnet-dump-instructions.md#installing-dotnet-dump . Generally it would be dotnet-dump collect --process-id <PID of Microsoft.CodeAnalysis.LanguageServer here> after you install the tool. Can either upload here (if its small enough), or email me (listed in my github profile).
bobombolo commented 1 year ago

owner@navi:~$ dotnet-dump Required command was not provided.

Usage: dotnet-dump [options] [command]

Options: --version Show version information -?, -h, --help Show help and usage information

Commands: collect Capture dumps from a process analyze Starts an interactive shell with debugging commands to explore a dump ps Lists the dotnet processes that dumps can be collected from.

dibarbet commented 1 year ago

The command needs to be run with the following arguments (with the appropriate processid) dotnet-dump collect --process-id <put the PID of Microsoft.CodeAnalysis.LanguageServer here>

bobombolo commented 1 year ago

i'm sorry i'm so dense but where do i get the PID?

bobombolo commented 1 year ago

i tried ls /proc but it's not there

dibarbet commented 1 year ago

With vscode running and the folder open, you can try dotnet-dump ps It should output something like 4148 Microsoft.CodeAnalysis.LanguageServer /home/dibarbet/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/.roslyn/Microsoft.CodeAnalysis.LanguageServer ... where the number at the beggining (4148 for me) is the process id.

If it isn't listed, that means the server isn't running and we'll have to figure out another way to get the information.

bobombolo commented 1 year ago

14301 lysis.LanguageServer lysis.LanguageServer -dotnettools.csharp

this one maybe

dibarbet commented 1 year ago

Yup! That's the one (probably truncated because the window is small).

bobombolo commented 1 year ago

what i get from that when i cat it appears to be a gigantic binary file

bobombolo commented 1 year ago

which i cannot attach here or open in a text editor

dibarbet commented 1 year ago

what i get from that when i cat it appears to be a gigantic binary file

Yup that is eactly what I need. A couple options for sending it

  1. If its small enough to attach via email - you can send it to me at dabarbet@microsoft.com
  2. If you have a cloud storage anywhere that you can upload it to, and share that link via email with me

Unfortunately we don't have a great process yet for collecting these large dump files via github :(. If none of the above options work, let me know and I'll try and figure something else out.

bobombolo commented 1 year ago

sending now but holy crap why is a dump file 1GB?!

dibarbet commented 1 year ago

sending now but holy crap why is a dump file 1GB?!

Got it - thank you! 1GB is actually on the low side for dotnet process dumps... they can get into the 20-50 GB range depending 😆

bobombolo commented 1 year ago

any insights now?

dibarbet commented 8 months ago

Apologies for the late reply, unfortunately the dump wasn't particularly illuminating here. However we've made a very large number of changes to how we start the server. Could you try the latest versions of the extension and see if you're still having issues (feel free to tag me directly in your reply)?

TheVons commented 7 months ago

I am having a similar issue. Will send an email with link.

khoiCodeDump commented 7 months ago

Hello I am also having this issue. Mine wasnt a fresh install but the problem occurs right when I was working on my project