-
Notifications
You must be signed in to change notification settings - Fork 498
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
Language server startup failed #2417
Comments
These logs just indicate that the client waited for the server to start and that it didn't. When you try to start the PowerShell extension, does anything flash in the terminal? Unfortunately, because of the way VSCode works, capturing the screen at that moment (like with a video/gif recorder) might be the only way to get any error message there.
You might also have some luck trying to execute the following from cmd: powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "$PSES_BUNDLE_PATH/PowerShellEditorServices/Start-EditorServices.ps1 -BundledModulesPath $PSES_BUNDLE_PATH -LogPath $SESSION_TEMP_PATH/logs.log -SessionDetailsPath $SESSION_TEMP_PATH/session.json -FeatureFlags @() -AdditionalModules @() -HostName 'My Client' -HostProfileId 'myclient' -HostVersion 1.0.0 -LogLevel Diagnostic" With the following set inline:
If that works, it should print a bunch of information and then block at the point where it waits for a client to connect (you should then kill the process, since there won't be a client to connect). If it doesn't work (which is what I'm hoping, since we need to reproduce this error in an environment where we control the terminal process), then you should see the error in the CMD console. |
The cursor just blinks like it's waiting for something? |
Is this in the Integrated Console after startup? It might be worth trying pressing Enter or entering some input there. Also see if you're able to run the other command listed above. |
Actually looks like I didn't wait long enough. There are now 3 files in my temp directory. logs.ext, Start-EditorServices-logs.txt, and session.json. In the Integrated Console in VSCode, the last status is #-- Waiting for EditorServicesHost to complete execution --------------------- |
That means it should be ready to go. Do you get a prompt? |
The PS Integrated Console does not let me type anything in there. It tries to start up with a Starting Powershell message and eventually throws an initialization error which is the Language server startup error that I posted here. I ran the command in a different Powershell terminal session within VS code. I assume this is just the PS on the OS. In this window, I get the Waiting for EditorServicesHost message but I can't type anything after that message. I'm still not able to run any of my PS scripts from within VSCode because it says Cannot Debug or Run Powershell Script until the Powershell session has started. |
Can you post those files here? (Or send them through by email: see the troubleshooting doc)
That's indeed what that is. From what you've described so far, it sounds like the PowerShell process that runs the server is correctly getting to the point where it's waiting on a client connection but for some reason the client never connects properly. If the logs don't reveal anything, it might be worth trying the preview extension instead, especially since that will be stable within the month. |
Files uploaded. Where do I get the preview extension? I've tried rolling back to an older version but still same issue. |
It's in the VSCode marketplace as |
Unfortunately same issue with the preview version. Might try uninstalling VSCode and re-install. |
Re-installing VSCode didn't help. |
Can you post of a GIF of the whole VSCode window as the extension starts up? |
The other thing I noticed is that the Windows version you're using (RS3) may be end-of-life. Sometimes these kinds of hang issues that we can't reproduce are caused by changes in Windows fixed by patches. |
The terminal is blank with a Starting Powershell... message at the bottom right. Are you wanting a screenshot of the Output window? Unfortunately I can't control the Windows version. This machine is my work laptop. The Powershell extension is a Microsoft product correct? My next route will have to be to submit a ticket to MS if I can't figure this out myself soon. |
A GIF/video of the startup would be ideal, something that shows the extension load when the first PowerShell file is opened and then the Integrated Console appear and start, right until the last message that you posted earlier is logged. It might not show any new information, but sometimes there's a clue in the greater VSCode window.
In that case I believe RS3 is good until April. But in an enterprise context, sometimes anti-virus or group policy prevent startup. It's not entirely clear how we'd show that, but some users have found they can reproduce the same issue on various work devices with different Windows and PowerShell versions, while also having no problem starting the extension on personal devices. If you find that's the case, we'd be grateful for any data you can provide since this is something that crops up from time to time but is very hard to reproduce.
This is indeed software developed, maintained and made available by Microsoft. I am a Microsoft engineer. |
This was working fine before the holiday break. I upgraded to the latest extension recently so not sure what triggered the issue. Could very well be Windows hotfix, GPO, etc... I just need to figure out what exactly. I can try and record VSCode but it pretty much shows me a blank terminal window while it's starting up. I don't see anything else. |
Any advice on what specific group policy to look for? Isn't this just trying to run a PS script behind the scenes? ie Start-EditorServices.ps1? |
Yeah we've heard similar in other cases. Often it seems the extension hasn't changed, or even VSCode (since they're totally separate). But one day it just stops working. Possibly a Windows patch, perhaps more likely a policy rollout.
Yeah, VSCode starts a child process like
In the absence of other information it could be helpful. It likely won't shed new light, but sometimes there's a clue.
Unfortunately I don't know very much about GPO or how exactly it could interact with the extension, just that some other users have reported it doing so. I'll try and do some research on it. In the meantime, this issue is marked for triage so I'll discuss it with some other team members tomorrow. |
At the point the extension seems to be stuck, the server has created an ACL'd named pipe and the client should be connecting over that named pipe |
Hopefully you'll have some more ideas after speaking with your team members. In the meantime I'll look into submitting a MS support case ticket. That way I can talk with someone and do screen sharing. |
Any updates on this issue? I am experiencing the same symptoms. The the OP, this also worked prior to the holidays and no longer does. I've even gone as far as installing PS Core 6.2 to test both Windows PS 5.1 and PSC 6. No change in either behavior. Attached are the session logs. |
@doug4772 Can you give this a go in the PowerShell Preview extension? It has a ton of fixes in it and it might be fixed in that already. |
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. |
This issue is being closed as inactive, if this issue is still occurring it will be re-opened |
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}) |
Happening on all my PROD api servers now |
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 |
Do you run any privilege management software like BeyondTrust? |
I have the same problem that Posh 5.1 crashes with "The language service could not be started" in vscode. Posh7 works. |
Do you run any privilege management software like BeyondTrust? |
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. |
Also getting this issue in VS Code: Powershell version is 5.1.17763.1490 |
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 |
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. |
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
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: