Description
Prerequisites
- I have written a descriptive issue title.I have searched all open and closed issues to ensure it has not already been reported.I have read the troubleshooting guide.I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.If this is a security issue, I have read the security issue reporting guidance.
Summary
PowerShell extension not load...
`05/04/2023 11:35:44 [NORMAL] - PowerShell Editor Services args: Import-Module '/Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules/PowerShellEditorServices/PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2023.3.3' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath '/Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2023.3.3
Copyright (c) Microsoft Corporation.
https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Normal' -LogPath '/Users/jcstorino/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/logs/1680705343-b7385f7a-9f47-4169-9977-ce5d2963e2861680705342975/EditorServices.log' -SessionDetailsPath '/Users/jcstorino/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-66251-378352.json' -FeatureFlags @()
05/04/2023 11:35:44 [NORMAL] - pwsh started.
05/04/2023 11:35:44 [NORMAL] - Waiting for session file...
05/04/2023 11:36:14 [WARNING] - Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.
05/04/2023 11:39:45 [NORMAL] - Timed out waiting for session file to appear!
05/04/2023 11:39:45 [ERROR] - PowerShell process failed to start:
05/04/2023 11:39:45 [ERROR] - Timed out waiting for session file to appear!
05/04/2023 11:39:45 [ERROR] - Unknown session status 'undefined' with reason 'undefined
`
PowerShell Version
PS VSC > $psversionTable
Name Value
---- -----
PSVersion 7.3.3
PSEdition Core
GitCommitId 7.3.3
OS Darwin 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visual Studio Code Version
PS VSC > code --version
1.77.0
7f329fe6c66b0f86ae1574c2911b681ad5a45d63
arm64
Extension Version
PS VSC > code --list-extensions --show-versions | Select-String powershell
ms-vscode.powershell@2023.3.3
Steps to Reproduce
Just open VSC and wait for extension load.
Activity
andyleejordan commentedon Apr 5, 2023
Hm, only interesting thing I spy is this:
Can you test if you can open any
pwsh
terminal with that exact path as the CWD? Wondering if it exists but permissions aren't available for it to actually read/execute and start up. Also you could test setting that to just/Users/jcstorino
and see if it starts, that would rule it out.jcstorino commentedon Apr 5, 2023
Yes, I can open any pwsh in this path, and I have permission to write and write on it! Leaving only in the user's root the problem also occurs equally.
andyleejordan commentedon Apr 5, 2023
Interesting...anyway you can enable more logging and environment information by following these steps?
Thanks! I'm especially interested in the server-side (PSES) logs.
jcstorino commentedon Apr 5, 2023
Hi @andschwa ,
The powershell Log is being generated correctly and is the same one I have attached before, but the Language Server Log could not generate, the combo option does not appear in the list of Output Logs. What am I doing wrong?
vscode-powershell.log
andyleejordan commentedon Apr 5, 2023
Per that link you gotta run the command
PowerShell: Open PowerShell Extension Logs Folder
, and then you should have a folder with three separate logs!jcstorino commentedon Apr 6, 2023
@andschwa
I've been analyzing here, and only have one log file in the folder that is opened by the informed command !
andyleejordan commentedon Apr 6, 2023
HUH well, that indicates
pwsh
either never started at all, or crashed really early in the initialization process (like before logging starts).andyleejordan commentedon Apr 6, 2023
I'm copying this out of your log, what happens if you try to run from a regular terminal (outside of VS Code) the startup command it was trying:
That string is just these arguments encoded as base64:
jcstorino commentedon Apr 6, 2023
Running the entire command by pwsh (outside VSC), it seems to work correctly, see below!
`PS jcstorino > Import-Module '/Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules/PowerShellEditorServices/PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2023.3.3' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath '/Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2023.3.3
Copyright (c) Microsoft Corporation.
https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Diagnostic' -LogPath '/Users/jcstorino/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/logs/1680725213-fa1ed953-d768-4fcb-bd20-33ea57fdd74b1680725154678/EditorServices.log' -SessionDetailsPath '/Users/jcstorino/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-78683-570892.json' -FeatureFlags @()
DEBUG: Logging started
DEBUG: Beginning EndProcessing block
VERBOSE: Removing PSReadLine
VERBOSE: Removed PSReadLine
DEBUG: Creating host configuration
DEBUG: Determining REPL kind
DEBUG: REPL configured as PSReadLine
DEBUG: Configuring LSP transport
DEBUG: Configuring debug transport
DEBUG: Session file writer created
VERBOSE: Adding AssemblyResolve event handler for new AssemblyLoadContext dependency loading
VERBOSE: Loading EditorServices
VERBOSE: PID: 13184
VERBOSE:
== Build Details ==
VERBOSE:
== Host Startup Configuration Details ==
Host name: Visual Studio Code Host
Host version: 2023.3.3
Host profile ID: Microsoft.VSCode
PowerShell host type: System.Management.Automation.Internal.Host.InternalHost
REPL setting: PSReadLine
Session details path: /Users/jcstorino/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-78683-570892.json
Bundled modules path: /Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules
Additional modules: PowerShellEditorServices.VSCode
Feature flags:
Log path: /Users/jcstorino/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/logs/1680725213-fa1ed953-d768-4fcb-bd20-33ea57fdd74b1680725154678/EditorServices.log
Minimum log level: Diagnostic
Profile paths:
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: Microsoft.PowerShell.Security, Version=7.3.3.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
VERBOSE:
== Console Details ==
VERBOSE:
== PowerShell Details ==
VERBOSE:
== Environment Details ==
VERBOSE: Updated PSModulePath to: '/Users/jcstorino/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/usr/local/microsoft/powershell/7/Modules:/Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules'
DEBUG: Validating configuration
VERBOSE: Loading PowerShell Editor Services
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Version=3.8.3.0, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.PowerShell.EditorServices, Version=3.8.3.0, Culture=neutral, PublicKeyToken=null
VERBOSE: Starting EditorServices
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Sinks.Async, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Extensions.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Creating/running editor services
DEBUG: Creating startup info object
VERBOSE: Starting server, deregistering host logger and registering shutdown listener
PowerShell Extension v2023.3.3
Copyright (c) Microsoft Corporation.
https://aka.ms/vscode-powershell
Type 'help' to get help.
`
andyleejordan commentedon Apr 6, 2023
Even when the
cwd
is/Users/jcstorino/Library/Mobile Documents/com~apple~CloudDocs/Work/VSC
?...cause that's strange. If it's starting then it should also be starting when the extension tries the same thing.
jcstorino commentedon Apr 10, 2023
Yes! Even in this folder, the result is the same! It seems to work right!
`PS VSC > pwd
Path
/Users/jcstorino/Library/Mobile Documents/com
appleCloudDocs/Work/VSCPS VSC > Import-Module '/Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules/PowerShellEditorServices/PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2023.3.3' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath '/Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2023.3.3
VERBOSE:
== Host Startup Configuration Details ==
Host name: Visual Studio Code Host
Host version: 2023.3.3
Host profile ID: Microsoft.VSCode
PowerShell host type: System.Management.Automation.Internal.Host.InternalHost
REPL setting: PSReadLine
Session details path: /Users/jcstorino/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-78683-570892.json
Bundled modules path: /Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules
Additional modules: PowerShellEditorServices.VSCode
Feature flags:
Log path: /Users/jcstorino/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/logs/1680725213-fa1ed953-d768-4fcb-bd20-33ea57fdd74b1680725154678/EditorServices.log
Minimum log level: Diagnostic
Profile paths:
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: Microsoft.PowerShell.Security, Version=7.3.3.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
VERBOSE:
== Console Details ==
VERBOSE:
== PowerShell Details ==
VERBOSE:
== Environment Details ==
VERBOSE: Updated PSModulePath to: '/Users/jcstorino/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/usr/local/microsoft/powershell/7/Modules:/Users/jcstorino/.vscode/extensions/ms-vscode.powershell-2023.3.3/modules'
DEBUG: Validating configuration
VERBOSE: Loading PowerShell Editor Services
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Version=3.8.3.0, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.PowerShell.EditorServices, Version=3.8.3.0, Culture=neutral, PublicKeyToken=null
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Reflection.Metadata, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Collections.Immutable, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
VERBOSE: Starting EditorServices
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Sinks.Async, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Extensions.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Creating/running editor services
DEBUG: Creating startup info object
VERBOSE: Starting server, deregistering host logger and registering shutdown listener
PowerShell Extension v2023.3.3
Copyright (c) Microsoft Corporation.
https://aka.ms/vscode-powershell
Type 'help' to get help.
`
6 remaining items