Skip to content

Could not start language service #3227

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

Closed
BYHITABT opened this issue Mar 5, 2021 · 27 comments
Closed

Could not start language service #3227

BYHITABT opened this issue Mar 5, 2021 · 27 comments
Labels
Bug: VS Code Bugs in VS Code itself. Resolution-External Will close automatically.

Comments

@BYHITABT
Copy link

BYHITABT commented Mar 5, 2021

Issue Type: Bug

When starting Visual Studio Code the powershell extension try to start but abort with "Could not start language service". The log is as following:
5.3.2021 13:02:09 [NORMAL] - Visual Studio Code v1.54.1 64-bit
5.3.2021 13:02:09 [NORMAL] - PowerShell Extension v2021.2.2
5.3.2021 13:02:09 [NORMAL] - Operating System: Windows 64-bit
5.3.2021 13:02:09 [NORMAL] - Language server starting --
5.3.2021 13:02:09 [NORMAL] - PowerShell executable: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
5.3.2021 13:02:09 [NORMAL] - PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\MichlerDetlef.vscode\extensions\ms-vscode.powershell-2021.2.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\MichlerDetlef.vscode\extensions\ms-vscode.powershell-2021.2.2\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.2.2 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\MichlerDetlef.vscode\extensions\ms-vscode.powershell-2021.2.2\logs\1614945729-5a0d4503-6a39-4dec-aeb3-72c88f85c95e1614945727555\EditorServices.log' -SessionDetailsPath 'c:\Users\MichlerDetlef.vscode\extensions\ms-vscode.powershell-2021.2.2\sessions\PSES-VSCode-19924-563080' -FeatureFlags @()
5.3.2021 13:02:09 [NORMAL] - PowerShell Editor Services args: Import-Module 'c:\Users\MichlerDetlef.vscode\extensions\ms-vscode.powershell-2021.2.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\MichlerDetlef.vscode\extensions\ms-vscode.powershell-2021.2.2\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.2.2 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\MichlerDetlef.vscode\extensions\ms-vscode.powershell-2021.2.2\logs\1614945729-5a0d4503-6a39-4dec-aeb3-72c88f85c95e1614945727555\EditorServices.log' -SessionDetailsPath 'c:\Users\MichlerDetlef.vscode\extensions\ms-vscode.powershell-2021.2.2\sessions\PSES-VSCode-19924-563080' -FeatureFlags @()
5.3.2021 13:02:09 [NORMAL] - powershell.exe started.
5.3.2021 13:02:09 [NORMAL] - Waiting for session file
5.3.2021 13:02:11 [NORMAL] - Session file found
5.3.2021 13:02:11 [NORMAL] - Registering terminal close callback
5.3.2021 13:02:11 [NORMAL] - Registering terminal PID log callback
5.3.2021 13:02:11 [NORMAL] - powershell.exe PID: 16004
5.3.2021 13:02:11 [NORMAL] - Language server started.
5.3.2021 13:02:11 [NORMAL] - {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"\\.\pipe\PSES_jpn22lfr.er0","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\.\pipe\PSES_n4mtsiym.yhz"}
5.3.2021 13:02:11 [NORMAL] - Connecting to language service on pipe \.\pipe\PSES_jpn22lfr.er0...
5.3.2021 13:02:11 [NORMAL] - Language service connected.
5.3.2021 13:02:12 [ERROR] - Could not start language service:
5.3.2021 13:02:12 [ERROR] - Error: Connection to server got closed. Server will not be restarted.

Extension version: 2021.2.2
VS Code version: Code 1.54.1 (f30a9b73e8ffc278e71575118b6bf568f04587c8, 2021-03-04T22:38:31.419Z)
OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (8 x 1800)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 7.83GB (0.97GB free)
Process Argv --crash-reporter-id a0fe5d51-f6a9-4285-ba65-0257408f9258
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
pythonvspyt617cf:30253240
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
dockersubset:30265998
pythontb:30265425
vspre833cf:30267465

@ghost ghost added the Needs: Triage Maintainer attention needed! label Mar 5, 2021
@xantari
Copy link

xantari commented Mar 5, 2021

Exact same thing happening for me with the latest powershell extension update. Here is my log:

3/5/2021 10:39:19 AM [NORMAL] - Visual Studio Code v1.54.0 64-bit
3/5/2021 10:39:19 AM [NORMAL] - PowerShell Extension v2021.2.2
3/5/2021 10:39:19 AM [NORMAL] - Operating System: Windows 64-bit
3/5/2021 10:39:19 AM [NORMAL] - Language server starting --
3/5/2021 10:39:19 AM [NORMAL] -     PowerShell executable: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
3/5/2021 10:39:19 AM [NORMAL] -     PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\matto\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\matto\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.2.2 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\matto\.vscode\extensions\ms-vscode.powershell-2021.2.2\logs\1614962359-710d82a9-cea9-4ef4-8d78-2cd8742aa14c1614962356429\EditorServices.log' -SessionDetailsPath 'c:\Users\matto\.vscode\extensions\ms-vscode.powershell-2021.2.2\sessions\PSES-VSCode-10172-964274' -FeatureFlags @() 
3/5/2021 10:39:19 AM [NORMAL] -     PowerShell Editor Services args: Import-Module 'c:\Users\matto\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\matto\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.2.2 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\matto\.vscode\extensions\ms-vscode.powershell-2021.2.2\logs\1614962359-710d82a9-cea9-4ef4-8d78-2cd8742aa14c1614962356429\EditorServices.log' -SessionDetailsPath 'c:\Users\matto\.vscode\extensions\ms-vscode.powershell-2021.2.2\sessions\PSES-VSCode-10172-964274' -FeatureFlags @() 
3/5/2021 10:39:19 AM [NORMAL] - powershell.exe started.
3/5/2021 10:39:19 AM [NORMAL] - Waiting for session file
3/5/2021 10:39:21 AM [NORMAL] - Session file found
3/5/2021 10:39:21 AM [NORMAL] - Registering terminal close callback
3/5/2021 10:39:21 AM [NORMAL] - Registering terminal PID log callback
3/5/2021 10:39:21 AM [NORMAL] - powershell.exe PID: 2640
3/5/2021 10:39:21 AM [NORMAL] - Language server started.
3/5/2021 10:39:21 AM [NORMAL] - {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"\\\\.\\pipe\\PSES_afvvar1y.kya","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\\\.\\pipe\\PSES_b24n44zr.plv"}
3/5/2021 10:39:21 AM [NORMAL] - Connecting to language service on pipe \\.\pipe\PSES_afvvar1y.kya...
3/5/2021 10:39:21 AM [NORMAL] - Language service connected.
3/5/2021 10:39:22 AM [ERROR] - Could not start language service: 
3/5/2021 10:39:22 AM [ERROR] - Error: Connection to server got closed. Server will not be restarted.

@xantari
Copy link

xantari commented Mar 5, 2021

Not sure if this will help anyone else. But I was able to solve this by doing the following:

  1. Ensure there weren't two installs of VS Code installed. I for instance had a User version and the global system version both listed in Add/Remove Programs. I uninstalled the user only version so that all my local accounts would work fine with it.
  2. Uninstalling the user version wiped out the windows shell (Open in VS Code) shortcuts, so I downloaded the latest System X64 install of VS Code and re-installed it (latest version)

After I did that, the errors went away. Not sure if it was the VS Code reinstall that fixed it or what.

@xantari
Copy link

xantari commented Mar 5, 2021

Correction, closed VS Code and re-opened another .ps1 file, and issue is back.

@ghost
Copy link

ghost commented Mar 6, 2021

I'm seeing this similar issue on MacBook (macOS Big Sur 11.2.2) since updating yesterday to VSCode 1.54.1 (not certain if extension also updated at the same time, but it is v2021.2.2). Narrowed my problem down to the setting "workbench.startupEditor": "newUntitledFile". By setting this to "none" or "welcomePage" I do not see the issue. I can open .PS1 etc and the Integrated Console works fine. I am not seeing this issue on any of my Windows machines.

@twest820
Copy link

twest820 commented Mar 6, 2021

Me too. Windows 10, only a user installation of Visual Studio Code with previously open .ps1 files, problem also started after update to 1.5.4.1 and persisted through VS Code restarts. Uninstall and (user) reinstall seems to have cleared the issue.

@InteXX
Copy link

InteXX commented Mar 7, 2021

Issue Type: Bug

Since the most recent VSCode update, PowerShell now fails to load at startup.

VSCode version

Version: 1.54.1 (user setup)
Commit: f30a9b73e8ffc278e71575118b6bf568f04587c8
Date: 2021-03-04T22:38:31.419Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042

PowerShell startup logs

3/5/2021 6:09:39 PM [NORMAL] - Visual Studio Code v1.54.1 64-bit
3/5/2021 6:09:39 PM [NORMAL] - PowerShell Extension v2021.2.2
3/5/2021 6:09:39 PM [NORMAL] - Operating System: Windows 64-bit
3/5/2021 6:09:39 PM [NORMAL] - Language server starting --
3/5/2021 6:09:39 PM [NORMAL] -     PowerShell executable: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
3/5/2021 6:09:39 PM [NORMAL] -     PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\Work\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\Work\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.2.2 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\Work\.vscode\extensions\ms-vscode.powershell-2021.2.2\logs\1615000179-2421435c-f00a-4631-8137-216a2f9766e01615000169526\EditorServices.log' -SessionDetailsPath 'c:\Users\Work\.vscode\extensions\ms-vscode.powershell-2021.2.2\sessions\PSES-VSCode-13416-430208' -FeatureFlags @() 
3/5/2021 6:09:39 PM [NORMAL] -     PowerShell Editor Services args: Import-Module 'c:\Users\Work\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\Work\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.2.2 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\Work\.vscode\extensions\ms-vscode.powershell-2021.2.2\logs\1615000179-2421435c-f00a-4631-8137-216a2f9766e01615000169526\EditorServices.log' -SessionDetailsPath 'c:\Users\Work\.vscode\extensions\ms-vscode.powershell-2021.2.2\sessions\PSES-VSCode-13416-430208' -FeatureFlags @() 
3/5/2021 6:09:39 PM [NORMAL] - powershell.exe started.
3/5/2021 6:09:39 PM [NORMAL] - Waiting for session file
3/5/2021 6:09:41 PM [NORMAL] - Session file found
3/5/2021 6:09:41 PM [NORMAL] - Registering terminal close callback
3/5/2021 6:09:41 PM [NORMAL] - Registering terminal PID log callback
3/5/2021 6:09:41 PM [NORMAL] - powershell.exe PID: 21400
3/5/2021 6:09:41 PM [NORMAL] - Language server started.
3/5/2021 6:09:41 PM [NORMAL] - {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"\\\\.\\pipe\\PSES_zxrkrteq.iku","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\\\.\\pipe\\PSES_se3oujrs.ani"}
3/5/2021 6:09:41 PM [NORMAL] - Connecting to language service on pipe \\.\pipe\PSES_zxrkrteq.iku...
3/5/2021 6:09:41 PM [NORMAL] - Language service connected.
3/5/2021 6:09:42 PM [ERROR] - Could not start language service: 
3/5/2021 6:09:42 PM [ERROR] - Error: Connection to server got closed. Server will not be restarted.

VS Code version: Code 1.54.1 (f30a9b73e8ffc278e71575118b6bf568f04587c8, 2021-03-04T22:38:31.419Z)
OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz (4 x 1995)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.90GB (4.32GB free)
Process Argv --crash-reporter-id e69e24da-8cea-4231-bfc0-80f4f0d6711b
Screen Reader no
VM 0%
Extensions (2)
Extension Author (truncated) Version
powershell ms- 2021.2.2
code-settings-sync Sha 3.4.3
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspyt653:30253241
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vstry914:30256638
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
dockersubsetcf:30265999
pythontb:30265425
vspre833:30267464

@BYHITABT
Copy link
Author

BYHITABT commented Mar 8, 2021 via email

@BYHITABT
Copy link
Author

BYHITABT commented Mar 8, 2021 via email

@RickBankers
Copy link

I can confirm this happens with the zipped version of vscode 1.54.1 as well so it's not an uninstall/install issue. I am reverting back to 1.53 until this is resolved.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Mar 9, 2021

This is likely an issue in VS Code which will be fixed in the next recovery release. As a workaround, you can set this:

"powershell.integratedConsole.showOnStartup": false

That will give you language features (like intellisense and whatnot) but it won't show the PowerShell Integrated Console.

@Tyriar
Copy link
Contributor

Tyriar commented Mar 9, 2021

Here's the issue I'm thinking that's causing this: microsoft/vscode#117649

I also expect restarting the server manually should fix the problem, if that's possible.

@TylerLeonhardt
Copy link
Member

Yeah it's worth trying... hit the trash can and then Yes on the dialog that says "Do you want to restart the server"

@InteXX
Copy link

InteXX commented Mar 9, 2021

@TylerLeonhardt

Pardon me... "trash can?"

@TylerLeonhardt
Copy link
Member

image

The bin! The rubbish!

@InteXX
Copy link

InteXX commented Mar 9, 2021

@TylerLeonhardt

If I could find that I'd feel a lot better 🙂

@TylerLeonhardt
Copy link
Member

image

on the right of the terminal

@InteXX
Copy link

InteXX commented Mar 9, 2021

Funny... I looked everywhere but there.

@InteXX
Copy link

InteXX commented Mar 9, 2021

@TylerLeonhardt

That seems to do the trick.

I'll still roll back to 1.53 at your request, though. Tomorrow.

@TylerLeonhardt
Copy link
Member

At this point, you don't need to. You can if you want, but I think we know the issue.

@InteXX
Copy link

InteXX commented Mar 9, 2021

OK, thanks.

Keep up the good work.

@SydneyhSmith SydneyhSmith added Resolution-External Will close automatically. Bug: VS Code Bugs in VS Code itself. and removed Needs: Triage Maintainer attention needed! labels Mar 9, 2021
@ghost ghost closed this as completed Mar 9, 2021
@andretkachenko
Copy link

Could you give us a hint on when to expect this to be deployed? So I could decide whether to roll back or wait for a patch. Thank you in advance.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Mar 11, 2021
@Tyriar
Copy link
Contributor

Tyriar commented Mar 11, 2021

We're planning on releasing 1.54.2 today

@matt555
Copy link

matt555 commented Sep 7, 2021

Just adding what I had to do for a fix on a new laptop where my entire user profile was migrated from old to new (un-desired btw). To add to confusion, vscode auto-upgrade on old laptop had failed a few weeks prior which left code.exe in a directory starting with an underscore; though still usable.

note: just documenting chain of events, obviously some of these steps are likely unrelated and also i have more areas i need to cleanup.

Problem steps from new windows(corporate) install:

  1. Entire user profile restored from old win10 laptop to new (including $HOME\.vscode).
  2. Installed pwsh 7
  3. Installed WSL2
  4. Installed vscode in user env
  5. Allowed settings sync to run (note: I'm note sure if vscode's setting sync reinstalled the extensions or if setting sync from shan.code-settings-sync did the job).

Language Error encountered.

Steps to resolve:

  1. Uninstalled powershell extension. Note that at this point the powershell extension directory $HOME\.vscode\extensions\ms-vscode.powershell-2021.8.2 had not yet been removed.
  2. Closed VSCode!
  3. Noted that extension directory is now gone in extensions dir.
  4. Reopened vscode
  5. Reset to default all my terminal settings found in @feature:terminal @modified
  6. Reinstalled powershell extension.

fixed!

I spent a good few hours trying to validate my non-default terminal settings (even retyping most of them in setting json), perhaps I missed something or perhaps the extensions directory was all that needed to be cleared after the first few times i uninstalled/reinstalled powershell extension; which in those attempts I did not close vscode.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Sep 7, 2021
@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label Sep 7, 2021
@bvandermeide
Copy link

bvandermeide commented Nov 13, 2021

For what its worth - the root cause I found for this occuring on my machine is that a version mismatch of the powershell version the VS Code extension required and the powershell version installed on the machine.

The extension required powershell core 7, but installed on my machine was powershell core 6

The .net core runtime of powershell 6 vs. 7 was different and therefore the shell was unable to load the "System.Runtime" assemblies when executing import-module @ $HOME.vscode\extensions\ms-vscode.powershell-*/PowerShellEditorServices.psd1

The "could not load file or assembly" error was not having an issue locating the .psd1 module file, but could not load the .net core runtime it depends on because the shell environment was already running in an older .net core runtime.

image

About the screenshot
After noticing the "Could not start language service" error and the same error patterns others have expressed. VS Code would flash an error when I opened a powershell script.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Nov 13, 2021
@ghost
Copy link

ghost commented Nov 13, 2021

Thank you for your comment, but please note that this issue has been closed for over a week. For better visibility, consider opening a new issue with a link to this instead.

@JustinGrote
Copy link
Collaborator

@bvandermeide nice catch! FYI that Powershell 6 is no longer supported or tested, so def get on that 7 train, however you can choose which version the PSIC works with via the green version toggle on the lower right (5.1, 7, 7-preview, etc.)

@andyleejordan
Copy link
Member

I had thought about adding a check to warn users of PowerShell 6, but this confirms my suspicion that it wouldn't really work since it won't even start to begin with. Thanks for following up with us @bvandermeide!

@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label Mar 15, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: VS Code Bugs in VS Code itself. Resolution-External Will close automatically.
Projects
None yet
Development

No branches or pull requests