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

Debug adapter has terminated unexpectedly #1542

Closed
Js-Brecht opened this issue Sep 23, 2018 · 3 comments
Closed

Debug adapter has terminated unexpectedly #1542

Js-Brecht opened this issue Sep 23, 2018 · 3 comments
Labels

Comments

@Js-Brecht
Copy link

Js-Brecht commented Sep 23, 2018

System Details

  • Operating system name and version:
    Windows 10 version 1803 build 17134.285
  • VS Code version:
    1.27.2 (user setup)
  • PowerShell extension version:
    v1.8.4
  • Output from $PSVersionTable:
NameValue
PSVersion5.1.17134.228
PSEditionDesktop
PSCompatibleVersions{1.0, 2.0, 3.0, 4.0...}
BuildVersion10.0.17134.228
CLRVersion4.0.30319.42000
WSManStackVersion3.0
PSRemotingProtocolVersion2.3
SerializationVersion1.1.0.1
Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

> code -v
1.27.2
f46c4c469d6e6d8c46f268d1553c5dc4b475840f
x64

> $pseditor.EditorServicesVersion <- no output
> code --list-extensions --show-versions
[createInstance] extensionManagementService depends on downloadService which is NOT registered.
AlanWalk.markdown-toc@1.5.6
alefragnani.Bookmarks@9.1.0
alexdima.copy-relative-path@0.0.2
Angular.ng-template@0.1.10
austin.code-gnu-global@0.2.2
christian-kohler.npm-intellisense@1.3.0
CoenraadS.bracket-pair-colorizer@1.0.60
DavidAnson.vscode-markdownlint@0.20.0
dbaeumer.jshint@0.10.20
dbaeumer.vscode-eslint@1.6.0
ecmel.vscode-html-css@0.2.0
eg2.tslint@1.0.39
esbenp.prettier-vscode@1.6.1
fabianlauer.vs-code-xml-format@0.1.5
fabiospampinato.vscode-diff@1.3.3
formulahendry.auto-rename-tag@0.0.15
HookyQR.beautify@1.4.4
humao.rest-client@0.19.1
mdickin.markdown-shortcuts@0.8.1
mohsen1.prettify-json@0.0.3
ms-vscode.cpptools@0.18.1
ms-vscode.csharp@1.16.1
ms-vscode.PowerShell@1.8.4
msjsdiag.debugger-for-chrome@4.10.1
octref.vetur@0.12.6
rbbit.typescript-hero@2.3.2
ritwickdey.LiveServer@5.1.1
sdras.night-owl@0.4.1
sdras.vue-vscode-extensionpack@0.1.3
sdras.vue-vscode-snippets@1.3.0
Shan.code-settings-sync@3.1.2
tombonnike.vscode-status-bar-format-toggle@1.4.0
wmaurer.vscode-jumpy@0.3.1
xabikos.JavaScriptSnippets@1.7.0
Zignd.html-css-class-completion@1.17.1

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.17134.228
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.228
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When I attempt to run the debugger on a powershell script, I get an error saying

Debug adapter has terminated unexpectedly

If I hit F8, I get the error:

command 'PowerShell.RunSelection' not found

Attached Logs

Followed the instructions for collecting logs in the README, but there are no log files being generated. Log directory does not exist under $HOME.vscode\extensions\ms-vscode.powershell-1.8.4

EDIT
Created logs directory, and DebugAdapter.log was generated successfully.
DebugAdapter.log

Additionally, running the command

Open PowerShell Extension Logs Folder

returns the error

command 'PowerShell.OpenLogFolder' not found

Troubleshooting steps taken

  • Removed the powershell extension from vscode and reinstalled

Not really sure what else to do. Any guidance would be appreciated.

@Tnk1972
Copy link

Tnk1972 commented Sep 25, 2018

Also getting the same debug termination error when debugging any script in extension version 1.8.4, logs do not show anything obvious but crash always generates a "Socket closed, shutting down." message in DebugAdapter.log which is probably to be expected, but not seeing anything else even with Verbose logging enabled.

@rjmholt rjmholt added Issue-Bug A bug to squash. Area-Debugging labels Sep 25, 2018
@Tnk1972
Copy link

Tnk1972 commented Oct 3, 2018

Still an issue in v1.90, it looks like it's an EditorServices issues as I managed to pull the following from it's log (Running on Windows 7 with Powershell V3) :-

2018-10-03 14:18:07.753 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs: In method 'OnListenTaskCompleted', line 391:
ProtocolEndpoint message loop terminated due to unhandled exception:

System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PowerShell.EditorServices.Session.PowerShell3Operations.<>c__2`1.<ExecuteCommandInDebugger>b__2_0(PSObject pso)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   at Microsoft.PowerShell.EditorServices.DebugService.<EvaluateExpression>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.DebugAdapter.<HandleEvaluateRequest>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.<ListenForMessages>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PowerShell.EditorServices.Session.PowerShell3Operations.<>c__2`1.<ExecuteCommandInDebugger>b__2_0(PSObject pso)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   at Microsoft.PowerShell.EditorServices.DebugService.<EvaluateExpression>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.DebugAdapter.<HandleEvaluateRequest>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.<ListenForMessages>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
   at System.Threading.Tasks.Task.Execute()<---

2018-10-03 14:18:07.753 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: In method 'ProtocolEndpoint_UnhandledException', line 435:
PowerShell Editor Services is terminating due to an unhandled exception, see previous logs for details.

@rjmholt rjmholt changed the title v1.8.4 - Debug adapter has terminated unexpectedly Debug adapter has terminated unexpectedly Oct 3, 2018
@rjmholt
Copy link
Contributor

rjmholt commented Oct 8, 2018

I'm going to dupe this to #1494 so we can keep all the discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants