Skip to content

Initialisation Error - Windows 10, new install of code and extension #1847

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
SwarfegaGit opened this issue Apr 5, 2019 · 8 comments
Closed

Comments

@SwarfegaGit
Copy link

SwarfegaGit commented Apr 5, 2019

The extension fails to load the console. It takes a while before it times out with an initialisation error. The logs just show...

05/04/2019 07:46:50 [NORMAL] - Visual Studio Code v1.33.0 64-bit
05/04/2019 07:46:50 [NORMAL] - PowerShell Extension v1.12.0
05/04/2019 07:46:50 [NORMAL] - Operating System: Windows 64-bit
05/04/2019 07:46:50 [NORMAL] - Language server starting --
05/04/2019 07:46:50 [NORMAL] -     exe: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
05/04/2019 07:46:50 [NORMAL] -     args: C:\Users\ME\.vscode\extensions\ms-vscode.powershell-1.12.0\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.12.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\ME\.vscode\extensions\ms-vscode.powershell-1.12.0\modules' -EnableConsoleRepl -LogLevel 'Normal' -LogPath 'C:\Users\ME\.vscode\extensions\ms-vscode.powershell-1.12.0\logs\1554446810-5aaeda74-9b5e-4ab8-bf2c-7c6a614b098a1554446804466\EditorServices.log' -SessionDetailsPath 'C:\Users\ME\.vscode\extensions\ms-vscode.powershell-1.12.0\sessions\PSES-VSCode-1292-974954' -FeatureFlags @()
05/04/2019 07:46:53 [NORMAL] - powershell.exe started, pid: 11356
05/04/2019 07:46:54 [NORMAL] - powershell.exe terminated or terminal UI was closed
05/04/2019 07:48:51 [NORMAL] - Language server startup failed.
05/04/2019 07:48:51 [ERROR] - The language service could not be started: 
05/04/2019 07:48:51 [ERROR] - Timed out waiting for session file to appear.

I can see people have had this issue in the past but they appear to be fixed on releases. This is a fresh install of Windows 10 along with Code and the extension. This is a company laptop though on Azure AD so something tells me they might have changed something.

PowerShell 6 will open fine.
Execution policy is RemoteSigned

Tried the preview extension but also fails.

@TylerLeonhardt
Copy link
Member

Thanks for the info! Can you also attach the logs here so we can get a better idea of what's going on?

@SwarfegaGit
Copy link
Author

I've done this but the logs seem pretty empty.

10/04/2019 08:57:41 [NORMAL] - Language server starting --
10/04/2019 08:57:41 [NORMAL] -     args: C:\Users\MyUser\.vscode\extensions\ms-vscode.powershell-1.12.0\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.12.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\MyUser\.vscode\extensions\ms-vscode.powershell-1.12.0\modules' -EnableConsoleRepl -LogLevel 'Diagnostic' -LogPath 'C:\Users\MyUser\.vscode\extensions\ms-vscode.powershell-1.12.0\logs\1554883061-bc0f58bb-fb8e-4361-a206-db7459a967a51554883053735\EditorServices.log' -SessionDetailsPath 'C:\Users\MyUser\.vscode\extensions\ms-vscode.powershell-1.12.0\sessions\PSES-VSCode-16512-367824' -FeatureFlags @()
10/04/2019 08:57:41 [NORMAL] -     exe: C:\Windows\SysWow64\WindowsPowerShell\v1.0\powershell.exe
10/04/2019 08:57:43 [NORMAL] - powershell.exe started, pid: 9584
10/04/2019 08:57:44 [NORMAL] - powershell.exe terminated or terminal UI was closed
10/04/2019 08:59:42 [NORMAL] - Language server startup failed.
10/04/2019 08:59:42 [ERROR] - The language service could not be started: 
10/04/2019 08:59:42 [ERROR] - Timed out waiting for session file to appear.

@TylerLeonhardt
Copy link
Member

Can you set the log level to "Diagnostic" and attach those logs? It should create a Start-EditorServices log file.

setting:

"powershell.developer.editorServicesLogLevel": "Diagnostic"

The link above has the full steps.

@SwarfegaGit
Copy link
Author

SwarfegaGit commented Apr 11, 2019

There are no logs though. Whilst the argument suggests there should be a EditorServices.log file there isn't one.

11/04/2019 14:34:39 [NORMAL] - Visual Studio Code v1.33.0 64-bit
11/04/2019 14:34:39 [NORMAL] - PowerShell Extension v1.12.0
11/04/2019 14:34:39 [NORMAL] - Operating System: Windows 64-bit
11/04/2019 14:34:39 [NORMAL] - Language server starting --
11/04/2019 14:34:39 [NORMAL] -     exe: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
11/04/2019 14:34:39 [NORMAL] -     args: C:\Users\MyAccount\.vscode\extensions\ms-vscode.powershell-1.12.0\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.12.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\MyAccount\.vscode\extensions\ms-vscode.powershell-1.12.0\modules' -EnableConsoleRepl -LogLevel 'Diagnostic' -LogPath 'C:\Users\MyAccount\.vscode\extensions\ms-vscode.powershell-1.12.0\logs\1554989679-9cab73cf-187c-4687-a58d-ae95c0d9adc01554989674668\EditorServices.log' -SessionDetailsPath 'C:\Users\MyAccount\.vscode\extensions\ms-vscode.powershell-1.12.0\sessions\PSES-VSCode-2336-805766' -FeatureFlags @()
11/04/2019 14:34:40 [NORMAL] - powershell.exe started, pid: 14196
11/04/2019 14:34:41 [NORMAL] - powershell.exe terminated or terminal UI was closed
11/04/2019 14:36:39 [NORMAL] - Language server startup failed.
11/04/2019 14:36:39 [ERROR] - The language service could not be started: 
11/04/2019 14:36:39 [ERROR] - Timed out waiting for session file to appear.
PS C:\Users\MyAccount> Get-ChildItem 'C:\Users\MyAccount\.vscode\extensions\ms-vscode.powershell-1.12.0\logs\1554989679-9cab73cf-187c-4687-a58d-ae95c0d9adc01554989674668'


    Directory: C:\Users\MyAccount\.vscode\extensions\ms-vscode.powershell-1.12.0\logs\1554989679-9cab73cf-187c-4687-a58d-ae95c0d9adc01554989674668


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       11/04/2019     14:36           1271 vscode-powershell.log


PS C:\Users\MyAccount>

@TylerLeonhardt
Copy link
Member

@SwarfegaGit do you use an anti virus? We've received a lot of reports in the last version that antivirus has been getting in the way of PowerShell Editor Services starting up in the background.

We have a fix that is pending a new release.

@SwarfegaGit
Copy link
Author

SwarfegaGit commented Apr 12, 2019

Yes, McAfee Endpoint Security.
I think you're correct as looking in the Application Event Log after opening VSCode I see this...

Log Name:      Application
Source:        McAfee Endpoint Security
Date:          12/04/2019 10:24:08
Event ID:      3
Task Category: None
Level:         Error
Keywords:      Classic
User:          SYSTEM
Computer:      --------------
Description:
EventID=18054

ExP:Illegal API Use Blocked an attempt to exploit C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0\POWERSHELL.EXE, which targeted the AtlComPtrAssign API.

I am running the system version of VS Code by the way.

@TylerLeonhardt
Copy link
Member

This is fixed in #1837. Pending a new release which should happen today or early next week!

@TylerLeonhardt
Copy link
Member

I will dupe this to #1831. We've already got a report that says the fix worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants