PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.69k stars 487 forks source link

Language server startup failed #2417

Closed QuyenLy73 closed 4 years ago

QuyenLy73 commented 4 years ago

Issue Description

PS session fails to start with these errors. I have taken the cert from Start-EditorServices.ps1 and imported into my local machine's Trusted Publisher's store. I confirmed it's there with an expiration date of 5/2/2020. I have also executed this command but nothing happens.

Import-Module $HOME.vscode\extensions\ms-vscode.powershell*\modules\PowerShellEditorServices\PowerShellEditorServices.psd1

1/14/2020 2:47:41 PM [NORMAL] - Language server startup failed. 1/14/2020 2:47:41 PM [ERROR] - The language service could not be started: 1/14/2020 2:47:41 PM [ERROR] - Timed out waiting for session file to appear.

Attached Logs

Follow the instructions in the README about capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.16299
VSCode 1.41.1
PowerShell Extension Version 2019.12.0

PowerShell Information

Name Value
PSVersion 5.1.16299.1146
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.16299.1146
BuildVersion 10.0.16299.1146
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand) |Extension|Author|Version| |---|---|---| |All-Autocomplete|Atishay-Jain|0.0.23| |bracket-pair-colorizer-2|CoenraadS|0.0.29| |powershell|ms-vscode|2019.12.0| |python|ms-python|2020.1.58038| |todo-tree|Gruntfuggly|0.0.162|
doug4772 commented 4 years ago

For what it's worth, I'm having similar issues on my Mac w/ the latest VS Code and PS Core 6.x.

SydneyhSmith commented 4 years ago

@QuyenLy73 thanks that is a helpful piece of information...we will continue to investigate this issue and update as appropriate and ask any questions that come up...in the meantime you may want to investigate PSSA compatibility rules as a way to target 5.1 in your development while running core. More info on that here : https://devblogs.microsoft.com/powershell/using-psscriptanalyzer-to-check-powershell-version-compatibility/

pseudobacon commented 4 years ago

Installing 6.2.3 x64 with the MSI fixed this for me

TylerLeonhardt commented 4 years ago

@doug4772 I don't think you're experiencing the same issue on macOS. Can you add the logs & screenshots here?

rjmholt commented 4 years ago

Ok, I've just managed to spin up a fresh RS3 VM with VSCode 1.14.1 and PS 5.1 to try this out. I wasn't able to reproduce a startup freeze with either the current stable extension or the current master build. That may mean that rather than being a Windows bug this is a policy or antivirus issue.

One last resort is to collect a procdump of the frozen process to see where it's stuck. We've tried that in the past and in cases like this it hasn't shown clear results, but might be worth a try anyway.

ghost commented 4 years ago

This issue is being closed as inactive, if this issue is still occurring it will be re-opened

SlkRck commented 4 years ago

I'm receiving the error mentioned above PLUS the fact I cannot open a terminal. I uninstalled VSCode completely, rebooted, reinstalled and before installing any PowerShell extensions, tried to open a terminal and it failed with the error:

The terminal process command 'C:\Program Files\PowerShell\7\pwsh.exe' failed to launch (exit code: {2})

davesbrown commented 4 years ago

Happening on all my PROD api servers now

erobillard commented 4 years ago

Same issue. Started when Code was updated. Neither the last stable version nor the Preview work. Username obfuscated below.

4/22/2020 7:06:42 PM [NORMAL] - Visual Studio Code v1.44.2 64-bit 4/22/2020 7:06:42 PM [NORMAL] - PowerShell Extension v2020.4.0 4/22/2020 7:06:42 PM [NORMAL] - Operating System: Windows 64-bit 4/22/2020 7:06:42 PM [NORMAL] - Language server starting -- 4/22/2020 7:06:42 PM [NORMAL] - PowerShell executable: C:\Users\myself.dotnet\tools\pwsh.exe 4/22/2020 7:06:42 PM [NORMAL] - PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\myself.vscode\extensions\ms-vscode.powershell-2020.4.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.4.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\myself.vscode\extensions\ms-vscode.powershell-2020.4.0\modules' -EnableConsoleRepl -LogLevel 'Normal' -LogPath 'c:\Users\myself.vscode\extensions\ms-vscode.powershell-2020.4.0\logs\1587596802-25479203-0f29-4890-bbd5-951e79fadd981587596783837\EditorServices.log' -SessionDetailsPath 'c:\Users\myself.vscode\extensions\ms-vscode.powershell-2020.4.0\sessions\PSES-VSCode-17948-194532' -FeatureFlags @() 4/22/2020 7:06:42 PM [NORMAL] - PowerShell Editor Services args: Import-Module 'c:\Users\myself.vscode\extensions\ms-vscode.powershell-2020.4.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.4.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\myself.vscode\extensions\ms-vscode.powershell-2020.4.0\modules' -EnableConsoleRepl -LogLevel 'Normal' -LogPath 'c:\Users\myself.vscode\extensions\ms-vscode.powershell-2020.4.0\logs\1587596802-25479203-0f29-4890-bbd5-951e79fadd981587596783837\EditorServices.log' -SessionDetailsPath 'c:\Users\myself.vscode\extensions\ms-vscode.powershell-2020.4.0\sessions\PSES-VSCode-17948-194532' -FeatureFlags @() 4/22/2020 7:06:42 PM [NORMAL] - pwsh.exe started. 4/22/2020 7:06:42 PM [NORMAL] - Waiting for session file 4/22/2020 7:08:42 PM [NORMAL] - Error occurred retrieving session file: Timed out waiting for session file to appear. 4/22/2020 7:08:42 PM [NORMAL] - Language server startup failed. 4/22/2020 7:08:42 PM [ERROR] - The language service could not be started: 4/22/2020 7:08:42 PM [ERROR] - Timed out waiting for session file to appear.

TylerLeonhardt commented 4 years ago

Do you run any privilege management software like BeyondTrust?

ahohenschuh commented 4 years ago

I have the same problem that Posh 5.1 crashes with "The language service could not be started" in vscode. Posh7 works.

vscode-powershell.log

TylerLeonhardt commented 4 years ago

I have the same problem that Posh 5.1 crashes with "The language service could not be started" in vscode. Posh7 works.

vscode-powershell.log

Do you run any privilege management software like BeyondTrust?

mkanet commented 3 years ago

So.. what's the solution to this issue? It just started happening today on my main PC. Surely with this many people having this issue, there has to be a way to fix it.

I'm using Windows 10 Version 2004 (OS Build 19041.630) using PowerShell 5.1. I've tried both the PowerShell Preview extension as well as the regular PowerShell Extension.

sweenb1 commented 3 years ago

Also getting this issue in VS Code: 10/2/2021 12:15:52 [NORMAL] - Visual Studio Code v1.53.1 64-bit 10/2/2021 12:15:52 [NORMAL] - PowerShell Extension v2020.6.0 10/2/2021 12:15:52 [NORMAL] - Operating System: Windows 64-bit 10/2/2021 12:15:52 [NORMAL] - Language server starting -- 10/2/2021 12:15:52 [NORMAL] - PowerShell executable: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe 10/2/2021 12:15:52 [NORMAL] - PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users*.vscode\extensions\ms-vscode.powershell-2020.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users**.vscode\extensions\ms-vscode.powershell-2020.6.0\modules' -EnableConsoleRepl -StartupBanner "=====> PowerShell Integrated Console v2020.6.0 <===== " -LogLevel 'Normal' -LogPath 'c:\Users**.vscode\extensions\ms-vscode.powershell-2020.6.0\logs\1612959352-1492f77d-a1fb-4083-82da-059fc7ae41d31612959230672\EditorServices.log' -SessionDetailsPath 'c:\Users*.vscode\extensions\ms-vscode.powershell-2020.6.0\sessions\PSES-VSCode-19512-642239' -FeatureFlags @() 10/2/2021 12:15:52 [NORMAL] - PowerShell Editor Services args: Import-Module 'c:\Users*.vscode\extensions\ms-vscode.powershell-2020.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users*.vscode\extensions\ms-vscode.powershell-2020.6.0\modules' -EnableConsoleRepl -StartupBanner "=====> PowerShell Integrated Console v2020.6.0 <===== " -LogLevel 'Normal' -LogPath 'c:\Users*.vscode\extensions\ms-vscode.powershell-2020.6.0\logs\1612959352-1492f77d-a1fb-4083-82da-059fc7ae41d31612959230672\EditorServices.log' -SessionDetailsPath 'c:\Users*.vscode\extensions\ms-vscode.powershell-2020.6.0\sessions\PSES-VSCode-19512-642239' -FeatureFlags @() 10/2/2021 12:15:52 [NORMAL] - powershell.exe started. 10/2/2021 12:15:52 [NORMAL] - Waiting for session file 10/2/2021 12:19:52 [NORMAL] - Timed out waiting for session file to appear. 10/2/2021 12:19:52 [NORMAL] - Language server startup failed. 10/2/2021 12:19:52 [ERROR] - The language service could not be started: 10/2/2021 12:19:52 [ERROR] - Error: Timed out waiting for session file to appear.

Powershell version is 5.1.17763.1490

mmunchandersen commented 3 years ago

I'm getting this on a Window 2013R2 server. Anyone with a solution?

29.9.2021 21.08.33 [NORMAL] - Visual Studio Code v1.60.2 64-bit 29.9.2021 21.08.34 [NORMAL] - PowerShell Extension v2021.9.0 29.9.2021 21.08.34 [NORMAL] - Operating System: Windows 64-bit 29.9.2021 21.08.34 [NORMAL] - Language server starting -- 29.9.2021 21.08.34 [NORMAL] - PowerShell executable: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe 29.9.2021 21.08.34 [NORMAL] - PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2021.9.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.9.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2021.9.0\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.9.0 <===== ' -LogLevel 'Normal' -LogPath 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2021.9.0\logs\1632942514-d5eecef5-00e9-478c-8d45-2edb094747141632942501054\EditorServices.log' -SessionDetailsPath 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2021.9.0\sessions\PSES-VSCode-4128-329853' -FeatureFlags @() 29.9.2021 21.08.34 [NORMAL] - PowerShell Editor Services args: Import-Module 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2021.9.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.9.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2021.9.0\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.9.0 <===== ' -LogLevel 'Normal' -LogPath 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2021.9.0\logs\1632942514-d5eecef5-00e9-478c-8d45-2edb094747141632942501054\EditorServices.log' -SessionDetailsPath 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2021.9.0\sessions\PSES-VSCode-4128-329853' -FeatureFlags @() 29.9.2021 21.08.34 [NORMAL] - powershell.exe started. 29.9.2021 21.08.34 [NORMAL] - Waiting for session file 29.9.2021 21.12.37 [NORMAL] - Timed out waiting for session file to appear. 29.9.2021 21.12.37 [NORMAL] - Language server startup failed. 29.9.2021 21.12.37 [ERROR] - The language service could not be started: 29.9.2021 21.12.37 [ERROR] - Error: Timed out waiting for session file to appear.

ghost commented 3 years ago

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.