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

continuous freezes and crashes on vscode extension (for the past ~1.5 weeks) #3216

Closed
brwilkinson opened this issue Mar 1, 2021 · 13 comments
Labels
Issue-Bug A bug to squash. Resolution-External Will close automatically.

Comments

@brwilkinson
Copy link

Issue Description

continuous freezes and crashes on vscode extension (for the past ~1.5 weeks)

either crashes similar to below:
image

or the console simply stops showing output during a long running command, such as a deployment.

It just cycles on this error and never returns in the console, until it's reset.

[Error - 8:31:55 AM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Execution of the following command(s) completed with errors:

    Microsoft.PowerShell.Core\Out-Default -InputObject No process is on the other end of the pipe.

 | 
[Warn  - 8:31:55 AM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Runtime exception occurred while executing command:

System.Management.Automation.CmdletInvocationException: No process is on the other end of the pipe.
 ---> System.IO.IOException: No process is on the other end of the pipe.
   at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.ConsolePal.get_ForegroundColor()
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContext.TerminalPSHostUserInterface.WriteOutput(String outputString, Boolean includeNewLine, OutputType outputType, ConsoleColor foregroundColor, ConsoleColor backgroundColor) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\Session\Host\TerminalPSHostUserInterface.cs:line 174
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorServicesPSHostUserInterface.WriteErrorLine(String value) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\Session\Host\EditorServicesPSHostUserInterface.cs:line 587
   at Microsoft.PowerShell.Commands.Internal.Format.ConsoleLineOutput.OnWriteLine(String s)
   at Microsoft.PowerShell.Commands.Internal.Format.ComplexWriter.WriteToScreen()
   at Microsoft.PowerShell.Commands.Internal.Format.ComplexWriter.WriteObject(List`1 formatValueList)
   at Microsoft.PowerShell.Commands.Internal.Format.OutCommandInner.ProcessPayload(FormatEntryData fed, OutputContext c)
   at Microsoft.PowerShell.Commands.Internal.Format.OutCommandInner.ProcessObject(PSObject so)
   at Microsoft.PowerShell.Commands.Internal.Format.OutCommandInner.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
   --- End of inner exception stack trace ---
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 927
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 927 | 


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.21318
VSCode 1.53.2
PowerShell Extension Version 2021.2.1

PowerShell Information

Name Value
PSVersion 7.1.2
PSEdition Core
GitCommitId 7.1.2
OS Microsoft Windows 10.0.21318
Platform Win32NT
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 6.1.0 6.2.0 7.0.0 7.1.2
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
application-insights VisualStudioOnlineApplicationInsights 0.4.2
azure-account ms-vscode 0.9.6
azure-iot-toolkit vsciot-vscode 2.16.6
azure-pipelines ms-azure-devops 1.183.0
azurerm-vscode-tools msazurermtools 0.14.1
csharp ms-dotnettools 1.23.9
debugger-for-edge msjsdiag 1.0.15
dotnet-interactive-vscode ms-dotnettools 1.0.212602
file-downloader mindaro-dev 1.0.10
git-graph mhutchie 1.29.0
gitlens eamodio 11.2.1
indent-rainbow oderwat 7.5.0
json-tools eriklynd 1.0.2
jupyter ms-toolsai 2021.2.603412351
language-liquid neilding 0.1.1
material-icon-theme PKief 4.5.0
mindaro mindaro 1.0.120210224
powershell-preview ms-vscode 2021.2.1
remote-containers ms-vscode-remote 0.158.0
remote-wsl ms-vscode-remote 0.53.4
rest-client humao 0.24.4
synthwave-vscode RobbOwen 0.1.8
vsc-community-material-theme Equinusocio 1.4.2
vsc-material-theme Equinusocio 33.1.2
vsc-material-theme-icons equinusocio 1.2.2
vscode-ai-remote ms-toolsai 0.1.0
vscode-apimanagement ms-azuretools 0.1.8
vscode-azureappservice ms-azuretools 0.20.0
vscode-azurefunctions ms-azuretools 1.2.1
vscode-azurelogicapps ms-azuretools 0.0.9
vscode-azureresourcegroups ms-azuretools 0.3.0
vscode-azurestorage ms-azuretools 0.12.0
vscode-bicep ms-azuretools 0.2.328
vscode-cosmosdb ms-azuretools 0.16.0
vscode-docker ms-azuretools 1.10.0
vscode-dotnet-runtime ms-dotnettools 1.0.0
vscode-dotnet-sdk ms-dotnettools 0.0.1
vscode-github-actions cschleiden 0.16.0
vscode-icons vscode-icons-team 11.1.0
vscode-kubernetes-tools ms-kubernetes-tools 1.3.0
vscode-liquid-snippets killalau 2.0.1
vscode-pull-request-github GitHub 0.23.1
vscode-sort-json richie5um2 1.19.2
vscode-yaml redhat 0.15.0
xml DotJoshJohnson 2.5.1
@ghost ghost added the Needs: Triage Maintainer attention needed! label Mar 1, 2021
@rjmholt rjmholt added the Issue-Bug A bug to squash. label Mar 1, 2021
@brwilkinson
Copy link
Author

@rjmholt let me know what you need for a repro or if I can turn up the logging or anything ?

@SydneyhSmith
Copy link
Collaborator

Thanks @brwilkinson is there any particular pattern to these crashes (like certain commands or projects?), also you mention that this has been the last 1.5 weeks-- were you seeing crashes before then just at a lesser frequency or was this a totally new issue for you? And similarly can you think of any environment changes that may have occurred when this started? Thanks for opening the issue it looks potentially related to PowerShell/PowerShellEditorServices#1295

@brwilkinson
Copy link
Author

brwilkinson commented Mar 3, 2021

I have mostly moved to just editing in Code, then executing scripts from the Windows Terminal to avoid the freezes, however I will do some work back in Code to see if I can get more logs etc.

This is the latest freeze (from just now).

symptons:

  • terminal hung, cannot press 'Enter' command.
  • obviously integrated terminal cannot run an F8 etc. However it does flip control back to the terminal tab.

[Error - 12:54:13 PM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Execution of the following command(s) completed with errors:

    __Invoke-ReadLineForEditorServices -CancellationToken System.Threading.CancellationToken

 | 
[Warn  - 12:54:13 PM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Runtime exception occurred while executing command:

System.Management.Automation.CmdletInvocationException: No process is on the other end of the pipe.
 ---> System.IO.IOException: No process is on the other end of the pipe.
   at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.ConsolePal.get_ForegroundColor()
   at Microsoft.PowerShell.Internal.VirtualTerminal.get_ForegroundColor()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
   at Microsoft.PowerShell.EditorServices.Commands.InvokeReadLineForEditorServicesCommand.EndProcessing() in D:\a\1\s\src\PowerShellEditorServices.Hosting\Commands\InvokeReadLineForEditorServicesCommand.cs:line 46
   at System.Management.Automation.CommandProcessorBase.Complete()
   --- End of inner exception stack trace ---
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 927
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 927 | 

After it has hung, F8 shows these editor services logs.. however no output.

[Error - 12:58:15 PM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Execution of the following command(s) completed with errors:

    prompt

 | 
[Error - 12:58:16 PM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Execution of the following command(s) completed with errors:

    prompt

 | 
[Error - 12:58:17 PM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Execution of the following command(s) completed with errors:

    prompt

 | 
[Error - 12:59:21 PM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Execution of the following command(s) completed with errors:

    prompt

 |

However the prompt never shows up in the terminal.

image

This was the last crash/logs before it started the new log session.

Error: Connection got disposed.
	at Object.dispose (c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\node_modules\vscode-jsonrpc\lib\common\connection.js:1044:27)
	at Object.dispose (c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\node_modules\vscode-languageclient\lib\common\client.js:73:35)
	at c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\node_modules\vscode-languageclient\lib\common\client.js:2320:28

VSCode extension seems fine, this was from when it started 10 mins ago. Since editor services crashed the last time.

3/3/2021 12:47:01 PM [NORMAL] - Language server starting --
3/3/2021 12:47:01 PM [NORMAL] -     PowerShell executable: C:\Program Files\PowerShell\7\pwsh.exe
3/3/2021 12:47:01 PM [NORMAL] -     PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules' -EnableConsoleRepl -StartupBanner '' -LogLevel 'Normal' -LogPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\logs\1614804421-952b7da0-a3b0-47b4-9f8f-bdfe3dd0d98a1614792397475\EditorServices.log' -SessionDetailsPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\sessions\PSES-VSCode-29096-994404' -FeatureFlags @() 
3/3/2021 12:47:01 PM [NORMAL] -     PowerShell Editor Services args: Import-Module 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules' -EnableConsoleRepl -StartupBanner '' -LogLevel 'Normal' -LogPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\logs\1614804421-952b7da0-a3b0-47b4-9f8f-bdfe3dd0d98a1614792397475\EditorServices.log' -SessionDetailsPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\sessions\PSES-VSCode-29096-994404' -FeatureFlags @() 
3/3/2021 12:47:01 PM [NORMAL] - pwsh.exe started.
3/3/2021 12:47:01 PM [NORMAL] - Waiting for session file
3/3/2021 12:47:03 PM [NORMAL] - Session file found
3/3/2021 12:47:03 PM [NORMAL] - Registering terminal close callback
3/3/2021 12:47:03 PM [NORMAL] - Registering terminal PID log callback
3/3/2021 12:47:03 PM [NORMAL] - pwsh.exe PID: 43276
3/3/2021 12:47:03 PM [NORMAL] - Language server started.
3/3/2021 12:47:03 PM [NORMAL] - {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"\\\\.\\pipe\\PSES_svajjdsa.xrl","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\\\.\\pipe\\PSES_co1lv1ie.z4j"}
3/3/2021 12:47:03 PM [NORMAL] - Connecting to language service on pipe \\.\pipe\PSES_svajjdsa.xrl...
3/3/2021 12:47:03 PM [NORMAL] - Language service connected.

other than that 1 restart for the extension, it was running since earlier today

3/3/2021 9:27:06 AM [NORMAL] - Language service connected.
$psversiontable


Name                           Value
----                           -----
PSVersion                      7.1.2
PSEdition                      Core
GitCommitId                    7.1.2
OS                             Microsoft Windows 10.0.21318
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

@brwilkinson
Copy link
Author

another one, this time I think it was the extension, not editor services ?!

just executed an F8 and it crashed as below.

image

not really much to show it started corrrectly then just shows the "3/3/2021 1:36:48 PM [NORMAL] - powershell.exe terminated or terminal UI was closed" 1:36.

3/3/2021 1:20:29 PM [NORMAL] - Shutting down language client...
3/3/2021 1:20:29 PM [NORMAL] - Terminating PowerShell process...
3/3/2021 1:20:29 PM [NORMAL] - Language server starting --
3/3/2021 1:20:29 PM [NORMAL] -     PowerShell executable: C:\Program Files\PowerShell\7\pwsh.exe
3/3/2021 1:20:29 PM [NORMAL] -     PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules' -EnableConsoleRepl -StartupBanner '' -LogLevel 'Normal' -LogPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\logs\1614806429-952b7da0-a3b0-47b4-9f8f-bdfe3dd0d98a1614792397475\EditorServices.log' -SessionDetailsPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\sessions\PSES-VSCode-29096-908199' -FeatureFlags @() 
3/3/2021 1:20:29 PM [NORMAL] -     PowerShell Editor Services args: Import-Module 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules' -EnableConsoleRepl -StartupBanner '' -LogLevel 'Normal' -LogPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\logs\1614806429-952b7da0-a3b0-47b4-9f8f-bdfe3dd0d98a1614792397475\EditorServices.log' -SessionDetailsPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\sessions\PSES-VSCode-29096-908199' -FeatureFlags @() 
3/3/2021 1:20:29 PM [NORMAL] - pwsh.exe started.
3/3/2021 1:20:29 PM [NORMAL] - Waiting for session file
3/3/2021 1:20:31 PM [NORMAL] - Session file found
3/3/2021 1:20:31 PM [NORMAL] - Registering terminal close callback
3/3/2021 1:20:31 PM [NORMAL] - Registering terminal PID log callback
3/3/2021 1:20:31 PM [NORMAL] - pwsh.exe PID: 15432
3/3/2021 1:20:31 PM [NORMAL] - Language server started.
3/3/2021 1:20:31 PM [NORMAL] - {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"\\\\.\\pipe\\PSES_fbynkdh2.xx5","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\\\.\\pipe\\PSES_c5fk4q1o.mfz"}
3/3/2021 1:20:31 PM [NORMAL] - Connecting to language service on pipe \\.\pipe\PSES_fbynkdh2.xx5...
3/3/2021 1:20:31 PM [NORMAL] - Language service connected.
3/3/2021 1:36:48 PM [NORMAL] - powershell.exe terminated or terminal UI was closed

@brwilkinson
Copy link
Author

not sure if they are helpful, however let me know what I can do to help.

@brwilkinson
Copy link
Author

[Error - 10:23:14 PM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Execution of the following command(s) completed with errors:

    __Invoke-ReadLineForEditorServices -CancellationToken System.Threading.CancellationToken

 | 
[Warn  - 10:23:14 PM] Microsoft.PowerShell.EditorServices.Services.PowerShellContextService: Runtime exception occurred while executing command:

System.Management.Automation.CmdletInvocationException: No process is on the other end of the pipe.
 ---> System.IO.IOException: No process is on the other end of the pipe.
   at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.ConsolePal.get_ForegroundColor()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
   at Microsoft.PowerShell.EditorServices.Commands.InvokeReadLineForEditorServicesCommand.EndProcessing() in D:\a\1\s\src\PowerShellEditorServices.Hosting\Commands\InvokeReadLineForEditorServicesCommand.cs:line 52
   at System.Management.Automation.CommandProcessorBase.Complete()
   --- End of inner exception stack trace ---
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 927
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 927 | 
[Error - 10:23:17 PM] Connection to server got closed. Server will not be restarted.

@brwilkinson
Copy link
Author

i noticed in the extensions log, there was some error loading the powershell preview extension.

image

going to switch back to the powershell extension for a while and test that... it seems to load without error.

image

@brwilkinson
Copy link
Author

brwilkinson commented Mar 9, 2021

probably not related, however I have been getting this all day. . . just going to put it here, since we don't have anything much to go on for the above crashes.

code with powershell extensions
code-insiders with powershell preview extension

Also on a brand new lab machine vm that I just deployed fresh. (code with powershell extensions)

image

Windows Powershell and Powershell 7.1.2

looks like this one is related to #2377 However the original crashes above are still occuring.

@brwilkinson
Copy link
Author

I switched back to Preview extension this morning.

my current theory is that this setting has resolved this issue:

"terminal.integrated.enablePersistentSessions": false

will update in another 12 hours.

@brwilkinson
Copy link
Author

@SydneyhSmith so I have done quite a bit of testing in 12 hours blocks.

it does appear that disabling this makes this issue disappear.

I tested across 3 different machines, including freshly deployed machines with minimal other configs on them.

"terminal.integrated.enablePersistentSessions": false

This crash:

image

The terminal process "C:\Program Files\PowerShell\7\pwsh.exe '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', 'Import-Module 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2021.2.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules' -EnableConsoleRepl -StartupBanner '' -LogLevel 'Normal' -LogPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\logs\1615418894-56949ce9-20c7-49ad-b4ba-3145ba37a2e61615416697784\EditorServices.log' -SessionDetailsPath 'c:\Users\benwilk\.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\sessions\PSES-VSCode-12764-749508' -FeatureFlags @() '" terminated with exit code: 3762504530.

System.Management.Automation.CmdletInvocationException: No process is on the other end of the pipe.
 ---> System.IO.IOException: No process is on the other end of the pipe.
   at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.ConsolePal.get_ForegroundColor()
   at Microsoft.PowerShell.Internal.VirtualTerminal.get_ForegroundColor()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
   at Microsoft.PowerShell.EditorServices.Commands.InvokeReadLineForEditorServicesCommand.EndProcessing() in D:\a\1\s\src\PowerShellEditorServices.Hosting\Commands\InvokeReadLineForEditorServicesCommand.cs:line 46
   at System.Management.Automation.CommandProcessorBase.Complete()
   --- End of inner exception stack trace ---
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.<>c__DisplayClass89_0`1.<ExecuteCommandAsync>b__0() in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 778
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 927
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 927 | 
[Error - 3:38:21 PM] Connection to server got closed. Server will not be restarted.

@andyleejordan
Copy link
Member

I switched back to Preview extension this morning.

Just FYI the Preview and Stable extensions currently have the same code.

@andyleejordan
Copy link
Member

"terminal.integrated.enablePersistentSessions": false

Ah ha! @brwilkinson I think you might be experiencing a different face of the VS Code bug introduced in 1.53, and discussed in #3227. Could you try updating to 1.54.2 and set that setting back to true to see if it's been resolved? I think essentially the fix in 1.54.2 disables that setting for extension owned terminals (like ours).

@brwilkinson
Copy link
Author

thanks @andschwa

will keep you posted.

@SydneyhSmith SydneyhSmith removed the Needs: Triage Maintainer attention needed! label Mar 23, 2021
@andyleejordan andyleejordan added the Resolution-External Will close automatically. label Apr 13, 2021
@ghost ghost closed this as completed Apr 13, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Resolution-External Will close automatically.
Projects
None yet
Development

No branches or pull requests

4 participants