question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ChannelClosedException: The channel has been closed - Intellisense and F8 stop working

See original GitHub issue

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

Hi,

I’ve been experiencing an issue where predictive intellisense and F8 (run line/code selection) stop working. I’ve collected some diagnostic logs and noticed the following error:

2022-09-21 10:20:25.349 +01:00 [VRB] Could not write to output handler, perhaps serialization failed?
System.Threading.Channels.ChannelClosedException: The channel has been closed.
   at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
   at OmniSharp.Extensions.JsonRpc.OutputHandler.ProcessOutputStream(CancellationToken cancellationToken)

Once this error occurs in the logs, I have to restart the integrated terminal for it to work again.

I noticed a similar error reported in #3800 and when this error occurs, I also have the endless formatting behaviour, but also intellisense and F8 stop working for me. This issue occurs for me on the latest PowerShell extension and preview extension.

Logs to follow via email.

PowerShell Version

PowerShell Extension v2022.8.5
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.

PS> $PSVersionTable

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

Visual Studio Code Version

1.71.2
74b1f979648cc44d385a2286793c226e611f59e7
x64

Extension Version

ms-vscode.powershell@2022.8.5

Steps to Reproduce

  1. Launch project in VSCode: code .
  2. Open PowerShell script file and extension with integrated terminal is loaded.
  3. All is working for a short time and then predictive intellisense and F8 stop working.

Apologies for the lack of repo steps 😞 but I’m really not sure what exactly is causing this issue.

Visuals

No response

Logs

Logs sent via email.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dbrennandcommented, Oct 19, 2022

Hi @andschwa

FWIW we also looked at the logs you emailed us (thank you) but unfortunately found nothing helpful. It seems like the last thing that happens is a code action is responded to by the server, but then a full two minutes go by and then the channel closed exception happens.

Thank you for taking a look at the logs I sent.

Oof, that’s unfortunate. Do you have a similar machine without the AV that you can try to repro on? Or does your AV allow you to add folder exceptions?

Unfortunately I do not, and I’m not permitted to add folder exceptions either. I think there is not much that can be done from your side. Thanks again for your time spent on this.

0reactions
andschwacommented, Oct 18, 2022

FWIW we also looked at the logs you emailed us (thank you) but unfortunately found nothing helpful. It seems like the last thing that happens is a code action is responded to by the server, but then a full two minutes go by and then the channel closed exception happens.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jenkins Issue: hudson.remoting.ChannelClosedException
ChannelClosedException : channel is already closed which is caused by java.net.SocketException: Connection reset . Any suggestions on how to fix ...
Read more >
An Easy Way To Remember Those F Stop Numbers
If you are new to cameras (digital or film) and find the F stop notation difficult to understand, or remember, then this little...
Read more >
Beginner's guide to using F8 aperture. - Adobe
Here are a few easy ones to start with: Achieve quality landscape photos by shooting well-lit locations with a not-too-distant background. Shoot close-up...
Read more >
What is F-Stop and How Does it Work? - Photography Life
Understanding f-stops is important in order to create stunning photographs like this one. As a beginner photographer, you might have heard ...
Read more >
Canon RF 1200mm F8 L IS USM Lens Review
The bottom line is that the RF 1200 does not provide sharpness (contrast and resolution) close to the RF 600 without extenders, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found