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

The Language Service could not be started. #1360

Closed
RumRogerz opened this issue Jun 11, 2018 · 20 comments · Fixed by #1485
Assignees
Labels

Comments

@RumRogerz
Copy link

@RumRogerz RumRogerz commented Jun 11, 2018

2018-6-11 11:31:48 [NORMAL] - Visual Studio Code v1.24.0 64-bit
2018-6-11 11:31:48 [NORMAL] - PowerShell Extension v1.7.0
2018-6-11 11:31:48 [NORMAL] - Operating System: Windows 64-bit
2018-6-11 11:31:48 [NORMAL] - Path specified by 'powerShellExePath' setting - '' - not found, reverting to default PowerShell path.
2018-6-11 11:31:48 [NORMAL] - Language server starting --
2018-6-11 11:31:48 [NORMAL] -     exe: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
2018-6-11 11:31:48 [NORMAL] -     args: C:\Users\rdattilo\.vscode\extensions\ms-vscode.powershell-1.7.0\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.7.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\rdattilo\.vscode\extensions\ms-vscode.powershell-1.7.0\modules' -EnableConsoleRepl -LogLevel 'Verbose' -LogPath 'C:\Users\rdattilo\.vscode\extensions\ms-vscode.powershell-1.7.0\logs\1528731108-8debbaed-db66-4139-b259-39746061c6391528731105860\EditorServices.log' -SessionDetailsPath 'C:\Users\rdattilo\.vscode\extensions\ms-vscode.powershell-1.7.0\sessions\PSES-VSCode-17688-512792' -FeatureFlags @()
2018-6-11 11:31:49 [NORMAL] - powershell.exe started, pid: 19508
2018-6-11 11:32:48 [NORMAL] - Language server startup failed.
2018-6-11 11:32:48 [ERROR] - The language service could not be started: 
2018-6-11 11:32:48 [ERROR] - Timed out waiting for session file to appear.

This is all of the sudden started happening. It was fine a few days ago and then,this :(

I've uninstalled VsCode, uninstalled the powershell add-in..... several times.

Name                           Value
----                           -----
PSVersion                      5.1.17134.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1`

thats my PS version I'm running. The only thing of late that has changed on my PC is an update to Windows 1803. Although I was using VSCode just fine after the update. Maybe there is some sort of weird connection to this?

@TylerLeonhardt

This comment has been minimized.

Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Jun 11, 2018

Thanks for this. Can you attach the logs so we can help further?

https://github.com/PowerShell/vscode-powershell/blob/master/README.md#2-capture-verbose-logs-and-send-them-to-us

In your case, please set the log level to Diagnostic.

@RumRogerz

This comment has been minimized.

Copy link
Author

@RumRogerz RumRogerz commented Jun 11, 2018

1528734640-e5c19306-07b0-4eb7-954a-fdf2563bffaf1528734636488.zip

Oddly enough, It's set to diagnostic, but it's still pumping out the exact same information. I thought there would be more.

I DO get this when I try to open a ps1 file in the terminal section:

Transcript started, output file is C:\Users\rdattilo.vscode\extensions\ms-vscode.powershell-1.7.0\logs\1528734640-e5c19306-07b0-4eb7-954a-fdf2563bffaf1528734636488\Start-EditorServices.log
VERBOSE:
#-- Updated PSModulePath to: -------------------------------------------------
VERBOSE: C:\Users\rdattilo\Documents\WindowsPowerShell\Modules
VERBOSE: C:\Program Files\WindowsPowerShell\Modules
VERBOSE: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
VERBOSE: C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules
VERBOSE: C:\Program Files\Common Files\Skype for Business Online\Modules
VERBOSE: C:\Users\rdattilo.vscode\extensions\ms-vscode.powershell-1.7.0\modules
VERBOSE:
#-- Check required modules available -----------------------------------------
VERBOSE: Testing module availability PowerShellGet
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1'.
VERBOSE: PowerShellGet found
VERBOSE:
#-- Start up PowerShellEditorServices ----------------------------------------
VERBOSE: Importing PowerShellEditorServices
VERBOSE: Loading module from path 'C:\Users\rdattilo.vscode\extensions\ms-vscode.powershell-1.7.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'.
VERBOSE: Loading module from path 'C:\Users\rdattilo.vscode\extensions\ms-vscode.powershell-1.7.0\modules\PowerShellEditorServices\PowerShellEditorServices.psm1'.
VERBOSE: Exporting function 'Start-EditorServicesHost'.
VERBOSE: Exporting function 'Compress-LogDir'.
VERBOSE: Exporting function 'Get-PowerShellEditorServicesVersion'.
VERBOSE: Importing function 'Compress-LogDir'.
VERBOSE: Importing function 'Get-PowerShellEditorServicesVersion'.
VERBOSE: Importing function 'Start-EditorServicesHost'.
VERBOSE: Checking port: 28572, attempts remaining 10 --------------------
VERBOSE: Testing availability of port 28572 at address 127.0.0.1 / InterNetwork
VERBOSE: Port: 28572 is available
VERBOSE: Checking port: 19180, attempts remaining 10 --------------------
VERBOSE: Testing availability of port 19180 at address 127.0.0.1 / InterNetwork
VERBOSE: Port: 19180 is available
PowerShell Integrated Console

VERBOSE:

Invoking Start-EditorServicesHost
VERBOSE: Start-EditorServicesHost returned Microsoft.PowerShell.EditorServices.Host.EditorServicesHost
VERBOSE: Writing session file with contents:
VERBOSE: {"debugServicePort":19180,"status":"started","debugServiceTransport":"Tcp","languageServiceTransport":"Tcp","languageServicePort":28572}
VERBOSE: Wrote out session file
VERBOSE:
#-- Waiting for EditorServicesHost to complete execution ---------------------

But that Editor Services log file doesn't even exist!

@TylerLeonhardt

This comment has been minimized.

Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Jun 14, 2018

Do you have any sort of restrictions on your PC, @RumRogerz?

I want to rule out the possibility of the vscode extension not being able to create the session file because of permissions.

@RumRogerz

This comment has been minimized.

Copy link
Author

@RumRogerz RumRogerz commented Jun 15, 2018

Great question, but no. I am the commander and ruler of all the things on my pc.
Even killed off my AV for a round of troubleshooting to see if it was perhaps the culprit.... to no avail. :(

@Wand3rvogel

This comment has been minimized.

Copy link

@Wand3rvogel Wand3rvogel commented Jun 15, 2018

@TylerLeonhardt

This comment has been minimized.

Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Jun 19, 2018

@Wand3rvogel can you explain with some detail on how you called this function?

@rjmholt

This comment has been minimized.

Copy link
Member

@rjmholt rjmholt commented Jun 19, 2018

Looks like here:

innerTryFunc(60, 1000);

@Wand3rvogel

This comment has been minimized.

Copy link

@Wand3rvogel Wand3rvogel commented Jun 20, 2018

@tylerl0706 i've found this here:
a86354d
from
#562

@TylerLeonhardt

This comment has been minimized.

Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Jun 21, 2018

Ah so you're saying we should up the timeout... I think that's probably reasonable to set it to 120 seconds. Thought?

@RumRogerz

This comment has been minimized.

Copy link
Author

@RumRogerz RumRogerz commented Jun 21, 2018

well, it couldn’t hurt. Ima try this out and report back

@rjmholt

This comment has been minimized.

Copy link
Member

@rjmholt rjmholt commented Jun 21, 2018

This isn't necessarily a good suggestion, but... we could always make it a user-configurable extension setting...

@rjmholt

This comment has been minimized.

Copy link
Member

@rjmholt rjmholt commented Jul 31, 2018

@RumRogerz Did you get any results playing with the timeout value? In any case, we might just up the default timeout value.

@RumRogerz

This comment has been minimized.

Copy link
Author

@RumRogerz RumRogerz commented Jul 31, 2018

@rjmholt
Sorry about the lateness of my reply, but yes! I played around with the default value to 120 seconds and that totally solved all my woes. Now I'm shelling with power.

You can consider this ticket closed

@rjmholt

This comment has been minimized.

Copy link
Member

@rjmholt rjmholt commented Jul 31, 2018

Ah cool! We should probably keep this open until we merge a PR to fix it somehow.

@fatherofinvention

This comment has been minimized.

Copy link

@fatherofinvention fatherofinvention commented Aug 6, 2018

I experienced the same symptoms after updating VS Code (1.25.1) and PowerShell extension (1.8.2). Discovered that C:\Users\USERNAME\.vscode\extensions\ms-vscode.powershell-1.8.2\modules\PowerShellEditorServices\Start-EditorServices.ps1 was failing to launch by looking at the logs and trying to launch it manually from a separate PowerShell instance with the same arguments. It returned the following prompt: Do you want to run software from this untrusted publisher? [V] Never run [D] Do not run [R] Run once [A] Always run [?] Help (default is "D"): indicating that the digital signature was not trusted.

To remedy this I performed the following:

  1. Browse to the file noted in the error message above. (ex. C:\Users\USERNAME\.vscode\extensions\ms-vscode.powershell-1.8.2\modules\PowerShellEditorServices\Start-EditorServices.ps1)
  2. Right click on the file and choose Properties | Digital Signatures
  3. Select the signature and click Details | View Certificate
  4. Choose the Details tab and click Copy to File...
  5. Save the file with a .CER extension.
  6. Using the Certificates MMC Snapin, import this file into the Trusted Publishers Certificate Store on the Local Machine.
@gwojan

This comment has been minimized.

Copy link

@gwojan gwojan commented Aug 8, 2018

@fatherofinvention I was having the same problem and imported the certificate just like you suggested and problem solved. 😄 I also noticed a Microsoft code signing certificate that expires 08/11/2018. I wonder if that has any bearing on the problem.

@fatherofinvention

This comment has been minimized.

Copy link

@fatherofinvention fatherofinvention commented Aug 12, 2018

Hey @gwojan (fellow Michigander!), I'm glad it helped you out. For anyone else reading, I've also seen this happen due to group policy enforced execution policy. Disabling the group policy object enforcing AllSigned or moving to another OG outside of the scope of that particular policy can resolve it but you may still need to complete the steps above to make sure the certificate is imported into the Trusted Publishers cert store.

@RumRogerz

This comment has been minimized.

Copy link
Author

@RumRogerz RumRogerz commented Aug 14, 2018

I think I should also point out that the certificate from that ps1 file in question expired on the 11th of this month (August)

@rjmholt rjmholt self-assigned this Aug 14, 2018
@rjmholt

This comment has been minimized.

Copy link
Member

@rjmholt rjmholt commented Aug 14, 2018

Thanks for the info everyone! I'm working on fixing this this week

@rjmholt rjmholt referenced this issue Aug 15, 2018
3 of 3 tasks complete
@rjmholt

This comment has been minimized.

Copy link
Member

@rjmholt rjmholt commented May 11, 2019

As noted by @fatherofinvention, execution policy can block the extension from running. The easiest way to fix this is captured in the documentation here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.