Skip to content

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

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
6 tasks done
dbrennand opened this issue Sep 21, 2022 · 9 comments
Closed
6 tasks done
Labels
Issue-Bug A bug to squash.

Comments

@dbrennand
Copy link

dbrennand commented Sep 21, 2022

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

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.

@dbrennand dbrennand added the Issue-Bug A bug to squash. label Sep 21, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label Sep 21, 2022
@dbrennand
Copy link
Author

Issue persists on latest preview [email protected]

@andyleejordan
Copy link
Member

Do you have any anti-virus running?

@andyleejordan andyleejordan added Needs: Author Feedback Please give us the requested feedback! and removed Needs: Triage Maintainer attention needed! labels Sep 30, 2022
@ghost ghost closed this as completed Oct 9, 2022
@ghost
Copy link

ghost commented Oct 9, 2022

This issue was closed automatically as author feedback was indicated as needed, but there has been no activity in over a week. Please feel free to reopen with any available information!

@dbrennand
Copy link
Author

Apologies for the delayed response, yes there is anti-virus running on the device I'm experiencing this issue with.

@ghost ghost added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Author Feedback Please give us the requested feedback! labels Oct 17, 2022
@ghost ghost reopened this Oct 17, 2022
@andyleejordan
Copy link
Member

That would be my best guess. Can you temporarily disable it, especially any real-time setting, and see if it continues to repro? We have seen aggressive anti-virus software kill the process before.

@dbrennand
Copy link
Author

dbrennand commented Oct 18, 2022

That would be my best guess. Can you temporarily disable it, especially any real-time setting, and see if it continues to repro? We have seen aggressive anti-virus software kill the process before.

Hmmm 🤔 OK, I've checked the event logs and I can't see any indication that the process is being blocked/killed. Unfortunately, I cannot disable it 🙁

Guess I'm kinda toast 🍞 😅

@andyleejordan
Copy link
Member

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?

@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label Oct 18, 2022
@andyleejordan
Copy link
Member

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.

@andyleejordan andyleejordan added the Needs: Author Feedback Please give us the requested feedback! label Oct 18, 2022
@dbrennand
Copy link
Author

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.

@ghost ghost added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Author Feedback Please give us the requested feedback! labels Oct 19, 2022
@ghost ghost reopened this Oct 19, 2022
@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label Oct 20, 2022
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.
Projects
None yet
Development

No branches or pull requests

2 participants