PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.71k stars 491 forks source link

Error "Debug adapter process has terminated unexpectedly" when running Powershell scripts #1214

Closed mklap12 closed 6 years ago

mklap12 commented 6 years ago

System Details


Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

Name                           Value                                                                                                                                                                             
----                           -----                                                                                                                                                                        PSVersion                      5.1.14409.1012                                                                                                                                                                    
PSEdition                      Desktop                                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                           
BuildVersion                   10.0.14409.1012                                                                                                                                                                   
CLRVersion                     4.0.30319.42000                                                                                                                                                                   
WSManStackVersion              3.0                                                                                                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                                                                                               
SerializationVersion           1.1.0.1              

### Issue Description

I am experiencing a problem with...

### Attached Logs
When running powershell scripts on Visual Studio Code it hangs some seconds, then this error appears: Debug adapter process has terminated unexpectedly.

I can see in the logs that it is waiting for Language services and a session file, but I can't figure out how to fix it.

Follow the instructions in the [README](https://github.com/PowerShell/vscode-powershell#reporting-problems)
about capturing and sending logs.
TylerLeonhardt commented 6 years ago

Hi there, thanks for this! Would you mind attaching the logs?

The instructions can be found here.

rkeithhill commented 6 years ago

The log zip is attached but it isn't that helpful. The debug adapter stops logging pretty quickly:

2018-02-26 14:42:37 [NORMAL] - Method "StartLogging" at line 144 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

    PowerShell Editor Services Host v1.6.0.0 starting (pid 7972)...

      Host application details:

        Name:      Visual Studio Code Host
        ProfileId: Microsoft.VSCode
        Version:   1.6.0
        Arch:      64-bit

      Operating system details:

        Version: Microsoft Windows NT 6.3.9600.0
        Arch:    64-bit

2018-02-26 14:42:37 [NORMAL] - Method "StartLanguageService" at line 180 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

    Language service started, listening on port 22516

2018-02-26 14:42:37 [NORMAL] - Method "StartDebugService" at line 254 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

    Debug service started, listening on port 25431

It seems that the extension times out waiting for the session file. @mklap12 Can you set the PowerShell log level to Diagnostic and then paste the contents of the Start-EditorServices.log file here? Thanks.

mklap12 commented 6 years ago

Thanks. Here are the log files. We have another similar Windows server 2012 R2, and we get the same error message there. Both servers have several other Powershell Modules installed like vmware and scom. Could some of those module cause the error?

Start-EditorServices.log vscode-powershell.log EditorServices.log

rjmholt commented 6 years ago

@mklap12 Are you still hitting this issue?

rjmholt commented 6 years ago

I'm having a hard time reproducing it

mklap12 commented 6 years ago

Hi

Sorry the late reply. I updated Visual Studio some days ago, and after that it was working again.

Marius


Fra: Robert Holt notifications@github.com Sendt: fredag 17. august 2018 02.05.59 Til: PowerShell/vscode-powershell Kopi: mklap12; Mention Emne: Re: [PowerShell/vscode-powershell] Error "Debug adapter process has terminated unexpectedly" when running Powershell scripts (#1214)

I'm having a hard time reproducing it

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPowerShell%2Fvscode-powershell%2Fissues%2F1214%23issuecomment-413719810&data=02%7C01%7C%7C16c46819115d4d567b9908d603d537e8%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636700611623747319&sdata=YozVeNicXvM2MibiaK%2BKBXr4adudMsl19VuDKX4n3bM%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAgHt-YGl0b4xeI2O5wamyS-L47oE1n5tks5uRgjngaJpZM4STRrp&data=02%7C01%7C%7C16c46819115d4d567b9908d603d537e8%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636700611623747319&sdata=TAzjVLa%2B9axrhkDjWcWQoPkvhlRPMspQNjsLH4tbIcU%3D&reserved=0.

mklap12 commented 6 years ago

Updated visual studio