Skip to content

PowerShell Integrated Console does not start on PowerShell Preview 2021.4.2 #3306

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
kborowinski opened this issue Apr 27, 2021 · 36 comments · Fixed by PowerShell/PowerShellEditorServices#1481
Assignees
Labels

Comments

@kborowinski
Copy link

Issue Description

PowerShell Integrated Console does not start on VSCode 1.55.2 (Stable) with PowerShell Preview 2021.4.2

vscode

Attached Logs

1619554566-4c04d7c7-874b-4077-a2e4-3b993520c4a11619554562893.zip
powershell_editor_services_trace_server.zip

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.19042
VSCode 1.55.2
PowerShell Extension Version 2021.4.2

PowerShell Information

Name Value
PSVersion 5.1.19041.906
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.19041.906
BuildVersion 10.0.19041.906
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
asm-code-lens maziac 1.8.0
bracket-pair-colorizer-2 CoenraadS 0.2.0
code-spell-checker streetsidesoftware 1.10.2
dezog maziac 2.2.4
errorlens usernamehw 3.2.6
gitlens eamodio 11.4.1
material-palenight-theme whizkydee 2.0.1
nex-fileviewer maziac 1.1.0
night-owl sdras 2.0.0
path-intellisense christian-kohler 2.3.0
powershell-preview ms-vscode 2021.4.2
python ms-python 2021.4.765268190
rainbow-csv mechatroner 1.8.1
sna-fileviewer maziac 1.2.1
Untabify ilich8086 0.0.2
vscode-icons vscode-icons-team 11.4.0
vscode-inline-values-powershell TylerLeonhardt 0.0.5
vscode-markdownlint DavidAnson 0.40.4
vscode-sort-json richie5um2 1.20.0
vscode-sqlite alexcvzz 0.12.0
vscode-test-explorer hbenl 2.19.6
xml DotJoshJohnson 2.5.1
z80-asm-meter theNestruo 1.5.0
z80-instruction-set maziac 1.0.4
z80-unit-tests maziac 1.2.0
@ghost ghost added the Needs: Triage Maintainer attention needed! label Apr 27, 2021
@SydneyhSmith
Copy link
Collaborator

Thanks @kborowinski we are having some trouble reproducing this issue, and are not seeing anything interesting in the logs (thanks for providing those!), are you also seeing this issue one PowerShell 7? It would also be great to know if you have hit this in the past with other versions...in all likelihood we may need to add more logging to debug this. Thanks!

@SydneyhSmith SydneyhSmith added Needs-Repro-Info and removed Needs: Triage Maintainer attention needed! labels Apr 27, 2021
@kborowinski
Copy link
Author

kborowinski commented Apr 27, 2021

@SydneyhSmith Good tip with the PowerShell 7. The PowerShell Integrated Console starts correctly on PS 7.2 (daily). I've also noticed that when the console hangs during startup on PS 5.1, switching PowerShell session to 7.2 and then back to
5.1 unfreezes the console.

Edit: I don't have this issue on Preview 2021.4.1.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 27, 2021
@andyleejordan
Copy link
Member

That's helpful, this does seem to repro specifically with Windows PowerShell 5.1. Hm...will have to debug.

@andyleejordan andyleejordan added Area-Startup Issue-Bug A bug to squash. and removed Needs-Repro-Info Needs: Maintainer Attention Maintainer attention needed! labels Apr 28, 2021
@andyleejordan andyleejordan self-assigned this Apr 28, 2021
@PrzemyslawKlys
Copy link
Contributor

This bug makes preview extension 90% useles in PowerShell 5.1 😭 It does work from time to time

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 28, 2021
@andyleejordan
Copy link
Member

I'll make sure it doesn't find it's way into stable 😓

@andyleejordan andyleejordan added this to the Committed-vNext milestone Apr 28, 2021
@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label May 4, 2021
@andyleejordan
Copy link
Member

It does work from time to time

Oof, that makes this harder.

@kborowinski
Copy link
Author

Oof, that makes this harder.

@andschwa I've tested the behavior on 4 different computers and it follows the 80/20 pattern, i.e. the PIC on PS 5.1 hangs on start 8 out of 10 times.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label May 5, 2021
@andyleejordan
Copy link
Member

Any chance you have logs from those sessions? I just got my old Windows box back up and running (I've been working on a Mac mini), seems to repro, I just gotta find what's going wrong now 🕵️

@andyleejordan
Copy link
Member

andyleejordan commented May 5, 2021

Annoyingly this doesn't repro when I am debugging it 😢

@andyleejordan
Copy link
Member

Talk about ironic. This repros with:

    "powershell.developer.editorServicesWaitForDebugger": false

and then it stops reproducing (and doesn't seem to wait for the debugger!) with:

    "powershell.developer.editorServicesWaitForDebugger": true

@rjmholt any ideas?

@andyleejordan
Copy link
Member

Hm...it's not 100% though for me. It's like 50/50.

@PrzemyslawKlys
Copy link
Contributor

1620244955-ae2c3707-365c-4519-a4e5-f01827ffd1481620244936081.zip

As requested - full log.

@andyleejordan
Copy link
Member

andyleejordan commented May 6, 2021

Ok, @PrzemyslawKlys and @kborowinski I could use your help. While I can occasionally repro this, and even under the debugger a couple times, I have so far been unable to find the information I need to solve it. What appears to happen is that the server code (the .NET app hosting PowerShell) is stuck waiting for PowerShell to run a work item (the PSES module code), and it's just never running. I've built a VSIX where the .NET code was compiled in debug configuration, has additional logs, and will continue to print logs to the console even after the banner is printed (this is normally prevented by unsubscribing the logger). Since you both seem to able to reproduce this more consistently and with:

    "powershell.developer.editorServicesLogLevel": "Diagnostic",

Please try the attached VSIX (in a zip because GitHub wouldn't let me otherwise upload it), with diagnostic logs, and capture the logs printed to the Integrated Console when it hangs. While all I've done is add logs, build it locally and in debug mode, I cannot seem to reproduce the bug with this build.

PowerShell-insiders.zip

Thank you!

@kborowinski
Copy link
Author

kborowinski commented May 6, 2021

@PrzemyslawKlys
Copy link
Contributor

If you need mine, please let me know.

@andyleejordan
Copy link
Member

Additional logs from other machine with VSCode Stable:

1620284685-eebfe89b-b2df-471a-91d2-390223f8bf6e1620284684240.zip
1620284685-eebfe89b-b2df-471a-91d2-390223f8bf6e1620284684240_powershell_editor_services_trace_server.zip

You're certain the integrated console hung in this session? The logs indicate the server is up and running and responding to requests...

@kborowinski
Copy link
Author

Tomorrow I can post the logs again from that particular machine.

@andyleejordan
Copy link
Member

It's ok! I managed to get it to hang (though without diagnostic logs, of course) and can see that the server is up and responding to requests, it's just the console that doesn't get to the point of printing the prompt. So, that's a start!

@andyleejordan
Copy link
Member

The better news is I've managed to get it to hang more consistently, with logging! It only does so when I build as a VSIX and install it, rather than run it under a launched (and debugged) VS Code instance.

@andyleejordan
Copy link
Member

Ok, hear me out, but can you reproduce this?

Get the Integrated Console to hang, then open your settings.json and toggle:

    "powershell.developer.editorServicesLogLevel": "Normal",

Like, if it were set to Diagnostics, change it to Normal, or something. When I do that and save the file, the console finally reaches its prompt.

@andyleejordan
Copy link
Member

Yup, I can reproduce that fairly consistently. When the console is "hung" and then I trigger a real workspace/didChangeConfiguration (by changing the settings), it unhangs. What's more, if you've typed any input while it's "hung" all that gets queued and when it unhangs it executes. We're going to work backwards from that, especially given some other oddities in the log around notifications, and changes in OmniSharp v0.19 to them.

@wsmelton
Copy link

I'm on the below build of Insiders and I see no hung integrated terminal, it is just not running at all.

https://twitter.com/wsmelton/status/1392130847734652933

I have gone in and changed the logging for the preview extension to diagnostic, verbose and back to normal (each with a reload and opening a PS1 file). No longs are generated and the extension shows no indication that it started. It is not until I do the restart PS session that it will start up and I can access to the integrated terminal.

I'd note I see this behavior on both extensions (stable and preview).

Version: 1.57.0-insider (system setup)
Commit: 37a12c9b0846167b2f68e9e1f276149d2d8b9b27
Date: 2021-05-12T14:14:26.024Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.19042

@andyleejordan
Copy link
Member

@wsmelton what version of PowerShell? Sounds like a potentially different issue to me.

@wsmelton
Copy link

This happens whether I'm using PS 7.1.3 or Windows PowerShell 5.1. Was not sure if it would be separate or not.

@andyleejordan
Copy link
Member

Ok! We think we have a more clear understanding of what's going on, for anybody who's interested OmniSharp/csharp-language-server-protocol#588

This is still actively being debugged (heck, it's what I've spent most of the last few weeks looking at).

@andyleejordan
Copy link
Member

andyleejordan commented May 19, 2021

@kborowinski, @PrzemyslawKlys, @rjmholt, and others, can ya'll test this attached VSIX and tell me if it repros? I think I fixed it with OmniSharp/csharp-language-server-protocol#589

Umm, GitHub is erroring when I upload the zip.

@PrzemyslawKlys
Copy link
Contributor

Attached? Can you attach it? 😊

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label May 19, 2021
@andyleejordan
Copy link
Member

Trying in a new comment.

...

Nope. I get "is not included in the list"

@andyleejordan
Copy link
Member

Try this: https://www.icloud.com/iclouddrive/0W-vrs0b16mkOv6huKfqbMBug#PowerShell-Insiders

@PrzemyslawKlys
Copy link
Contributor

So far it works. I'll let you know.

@kborowinski
Copy link
Author

@andschwa Tested on my home PC, so far so good. Will test tomorrow morning at work on two more machines.

@juergsteiger
Copy link

Try this: https://www.icloud.com/iclouddrive/0W-vrs0b16mkOv6huKfqbMBug#PowerShell-Insiders

Tested on my personal and on the company machine the whole day. It worked perfect.

@kborowinski
Copy link
Author

@andschwa Have used the Preview 2021.5.0 whole day at work without any problems so the fix apparently works, thanks!

@andyleejordan
Copy link
Member

Yay! Will make sure this patch is merged into OmniSharp and that everything on our end is updated before I do the next release.

@andyleejordan
Copy link
Member

I'll try to get a new preview out ASAP!

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label May 21, 2021
@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants