Skip to content

Debug adapter process has terminated unexpectedly #918

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
kunaludapi opened this issue Jun 23, 2017 · 19 comments
Closed

Debug adapter process has terminated unexpectedly #918

kunaludapi opened this issue Jun 23, 2017 · 19 comments
Labels

Comments

@kunaludapi
Copy link

I getting error after upgrading after upgrading latest VScode-Powershell. Debug adapter process has terminated unexpectedly

  Operating system details:

    Version: Microsoft Windows NT 6.3.9600.0
    Arch:    64-bit

6/23/2017 6:31:56 PM [NORMAL] - Method "StartLanguageService" at line 180 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

Language service started, listening on port 22305

6/23/2017 6:31:56 PM [NORMAL] - Method "StartDebugService" at line 254 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

Debug service started, listening on port 26542

6/23/2017 6:31:57 PM [NORMAL] - Method "Initialize" at line 220 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

PowerShell runtime version: 5.1.14394.1000, edition: Desktop

6/23/2017 6:31:57 PM [NORMAL] - Method "FindPSScriptAnalyzerModule" at line 354 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs

PSScriptAnalyzer found at C:\Users\vKunal\.vscode\extensions\ms-vscode.powershell-1.4.1\modules\PSScriptAnalyzer\PSScriptAnalyzer.psd1

6/23/2017 6:31:59 PM [NORMAL] - Method "Register" at line 36 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.VSCode\ComponentRegistration.cs

PowerShell Editor Services VS Code module loaded.

6/23/2017 6:31:59 PM [ERROR] - Method "DispatchMessage" at line 147 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs

MessageDispatcher: No handler registered for Event type 'initialized'

6/23/2017 6:31:59 PM [ERROR] - Method "DispatchMessage" at line 147 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs

MessageDispatcher: No handler registered for Event type '$/setTraceNotification'

6/23/2017 6:31:59 PM [ERROR] - Method "OnListenTaskCompleted" at line 391 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs

ProtocolEndpoint message loop terminated due to unhandled exception:

System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Illegal characters in path.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
   at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDocumentParams openParams, EventContext eventContext)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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.ArgumentException: Illegal characters in path.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
   at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDocumentParams openParams, EventContext eventContext)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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()<---

6/23/2017 6:31:59 PM [ERROR] - Method "ProtocolEndpoint_UnhandledException" at line 417 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

PowerShell Editor Services is terminating due to an unhandled exception, see previous logs for details.
@daviwil
Copy link
Contributor

daviwil commented Jun 23, 2017

Based on what I see here, the code is crashing on a file path. Can you tell me the path of the file you're trying to debug? Alternatively, turn on Verbose logging so that we can see more details about what's happening:

https://github.com/PowerShell/vscode-powershell#2-capture-verbose-logs-and-send-them-to-us

@daviwil daviwil added Area-Debugging Issue-Bug A bug to squash. labels Jun 23, 2017
@daviwil daviwil added this to the June 2017 milestone Jun 23, 2017
@kunaludapi
Copy link
Author

My scripts are located in below location C:\scripts\Final\SplattingFromFile, There is some issue uploading zip file, Please bare with me, I am copy pasting logs here. Just to mentioned I found I don't have C:\Projects folder on my machine as per the logs.

DebugAdapter.Log
Session file path: C:\Users\vKunal.vscode\extensions\ms-vscode.powershell-1.4.1\sessions\PSES-VSCode-4308-Debug, pid: 2604
Waiting for session file, tries remaining: 30...
Waiting for session file, tries remaining: 29...
Waiting for session file, tries remaining: 28...
Waiting for session file, tries remaining: 27...
Waiting for session file, tries remaining: 26...
Waiting for session file, tries remaining: 25...
Waiting for session file, tries remaining: 24...
Waiting for session file, tries remaining: 23...
Waiting for session file, tries remaining: 22...
Waiting for session file, tries remaining: 21...
Waiting for session file, tries remaining: 20...
Waiting for session file, tries remaining: 19...
Waiting for session file, tries remaining: 18...
Waiting for session file, tries remaining: 17...
Waiting for session file, tries remaining: 16...
Waiting for session file, tries remaining: 15...
Waiting for session file, tries remaining: 14...
Waiting for session file, tries remaining: 13...
Waiting for session file, tries remaining: 12...
Waiting for session file, tries remaining: 11...
Waiting for session file, tries remaining: 10...
Waiting for session file, tries remaining: 9...
Waiting for session file, tries remaining: 8...
Waiting for session file, tries remaining: 7...
Waiting for session file, tries remaining: 6...
Waiting for session file, tries remaining: 5...
Waiting for session file, tries remaining: 4...
Waiting for session file, tries remaining: 3...
Waiting for session file, tries remaining: 2...
Waiting for session file, tries remaining: 1...
Waiting for session file, tries remaining: 0...
Timed out waiting for session file!

EditorServices.log
6/23/2017 7:24:01 PM [NORMAL] - Method "StartLogging" at line 144 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

PowerShell Editor Services Host v1.4.1.0 starting (pid 12276)...

  Host application details:

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

  Operating system details:

    Version: Microsoft Windows NT 6.3.9600.0
    Arch:    64-bit

6/23/2017 7:24:01 PM [NORMAL] - Method "StartLanguageService" at line 180 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

Language service started, listening on port 21236

6/23/2017 7:24:01 PM [NORMAL] - Method "StartDebugService" at line 254 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

Debug service started, listening on port 27235

6/23/2017 7:24:02 PM [NORMAL] - Method "Initialize" at line 220 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

PowerShell runtime version: 5.1.14394.1000, edition: Desktop

6/23/2017 7:24:02 PM [VERBOSE] - Method "SetExecutionPolicy" at line 1414 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Setting execution policy:
    Current = ExecutionPolicy.Bypass
    Desired = ExecutionPolicy.RemoteSigned

6/23/2017 7:24:02 PM [VERBOSE] - Method "CheckForCapability" at line 155 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\Capabilities\DscBreakpointCapability.cs

Side-by-side DSC module was not found.

6/23/2017 7:24:02 PM [VERBOSE] - Method "SetProfileVariableInCurrentRunspace" at line 1561 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Setting $profile variable in runspace.  Current user host profile path: C:\Users\vKunal\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1

6/23/2017 7:24:02 PM [NORMAL] - Method "FindPSScriptAnalyzerModule" at line 354 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs

PSScriptAnalyzer found at C:\Users\vKunal\.vscode\extensions\ms-vscode.powershell-1.4.1\modules\PSScriptAnalyzer\PSScriptAnalyzer.psd1

6/23/2017 7:24:03 PM [VERBOSE] - Method "EnumeratePSScriptAnalyzerCmdlets" at line 389 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs

The following cmdlets are available in the imported PSScriptAnalyzer module:
    Get-ScriptAnalyzerRule
    Invoke-Formatter
    Invoke-ScriptAnalyzer

6/23/2017 7:24:03 PM [VERBOSE] - Method "EnumeratePSScriptAnalyzerRules" at line 405 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs

Available PSScriptAnalyzer Rules:
PSAlignAssignmentStatement
PSAvoidUsingCmdletAliases
PSAvoidDefaultValueSwitchParameter
PSAvoidDefaultValueForMandatoryParameter
PSAvoidUsingEmptyCatchBlock
PSAvoidGlobalAliases
PSAvoidGlobalFunctions
PSAvoidGlobalVars
PSAvoidInvokingEmptyMembers
PSAvoidNullOrEmptyHelpMessageAttribute
PSAvoidUsingPositionalParameters
PSReservedCmdletChar
PSReservedParams
PSAvoidShouldContinueWithoutForce
PSAvoidUsingUserNameAndPassWordParams
PSAvoidUsingComputerNameHardcoded
PSAvoidUsingConvertToSecureStringWithPlainText
PSAvoidUsingDeprecatedManifestFields
PSAvoidUsingInvokeExpression
PSAvoidUsingPlainTextForPassword
PSAvoidUsingWMICmdlet
PSAvoidUsingWriteHost
PSMisleadingBacktick
PSMissingModuleManifestField
PSPlaceCloseBrace
PSPlaceOpenBrace
PSPossibleIncorrectComparisonWithNull
PSProvideCommentHelp
PSUseApprovedVerbs
PSUseBOMForUnicodeEncodedFile
PSUseCmdletCorrectly
PSUseCompatibleCmdlets
PSUseConsistentIndentation
PSUseConsistentWhitespace
PSUseDeclaredVarsMoreThanAssignments
PSUseLiteralInitializerForHashtable
PSUseOutputTypeCorrectly
PSUsePSCredentialType
PSShouldProcess
PSUseShouldProcessForStateChangingFunctions
PSUseSingularNouns
PSUseSupportsShouldProcess
PSUseToExportFieldsInManifest
PSUseUTF8EncodingForHelpFile
PSDSCDscExamplesPresent
PSDSCDscTestsPresent
PSDSCReturnCorrectTypesForDSCFunctions
PSDSCUseIdenticalMandatoryParametersForDSC
PSDSCUseIdenticalParametersForDSC
PSDSCStandardDSCFunctionsInResource
PSDSCUseVerboseMessageInDSCResource

6/23/2017 7:24:03 PM [VERBOSE] - Method "ExecuteCommand" at line 491 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Attempting to execute command(s):

    Import-Module

6/23/2017 7:24:03 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Session state changed --

    Old state: Ready
    New state: Running
    Result: NotFinished

6/23/2017 7:24:04 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Session state changed --

    Old state: Running
    New state: Ready
    Result: Completed

6/23/2017 7:24:04 PM [VERBOSE] - Method "ExecuteCommand" at line 551 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Execution completed successfully.

6/23/2017 7:24:04 PM [VERBOSE] - Method "ExecuteCommand" at line 491 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Attempting to execute command(s):

    Import-Module

6/23/2017 7:24:04 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Session state changed --

    Old state: Ready
    New state: Running
    Result: NotFinished

6/23/2017 7:24:04 PM [NORMAL] - Method "Register" at line 36 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.VSCode\ComponentRegistration.cs

PowerShell Editor Services VS Code module loaded.

6/23/2017 7:24:04 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Session state changed --

    Old state: Running
    New state: Ready
    Result: Completed

6/23/2017 7:24:04 PM [VERBOSE] - Method "ExecuteCommand" at line 551 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Execution completed successfully.

6/23/2017 7:24:04 PM [VERBOSE] - Method "ReadMessage" at line 123 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs

Received Request 'initialize' with id 0

6/23/2017 7:24:04 PM [VERBOSE] - Method "WriteMessage" at line 61 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageWriter.cs

Writing Response 'initialize' with id 0

6/23/2017 7:24:04 PM [VERBOSE] - Method "ReadMessage" at line 123 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs

Received Event 'initialized'

6/23/2017 7:24:04 PM [ERROR] - Method "DispatchMessage" at line 147 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs

MessageDispatcher: No handler registered for Event type 'initialized'

6/23/2017 7:24:04 PM [VERBOSE] - Method "ReadMessage" at line 123 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs

Received Event '$/setTraceNotification'

6/23/2017 7:24:04 PM [ERROR] - Method "DispatchMessage" at line 147 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs

MessageDispatcher: No handler registered for Event type '$/setTraceNotification'

6/23/2017 7:24:04 PM [VERBOSE] - Method "ReadMessage" at line 123 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs

Received Event 'workspace/didChangeConfiguration'

6/23/2017 7:24:04 PM [VERBOSE] - Method "ReadMessage" at line 123 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs

Received Event 'textDocument/didOpen'

6/23/2017 7:24:04 PM [VERBOSE] - Method "ExecuteCommand" at line 491 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Attempting to execute command(s):

    prompt

6/23/2017 7:24:04 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Session state changed --

    Old state: Ready
    New state: Running
    Result: NotFinished

6/23/2017 7:24:04 PM [VERBOSE] - Method "ResolveFilePath" at line 354 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Workspace\Workspace.cs

Resolved path: c:\scripts\Final\SplattingFromFile\Get-INIConfiguration.ps1

6/23/2017 7:24:04 PM [VERBOSE] - Method "GetFileBuffer" at line 138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Workspace\Workspace.cs

Opened file as in-memory buffer: c:\scripts\Final\SplattingFromFile\Get-INIConfiguration.ps1

6/23/2017 7:24:04 PM [VERBOSE] - Method "HandleDidOpenTextDocumentNotification" at line 484 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs

Finished opening document.

6/23/2017 7:24:04 PM [VERBOSE] - Method "ReadMessage" at line 123 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs

Received Event 'textDocument/didOpen'

6/23/2017 7:24:04 PM [ERROR] - Method "OnListenTaskCompleted" at line 391 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs

ProtocolEndpoint message loop terminated due to unhandled exception:

System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Illegal characters in path.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
   at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDocumentParams openParams, EventContext eventContext)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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.ArgumentException: Illegal characters in path.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
   at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDocumentParams openParams, EventContext eventContext)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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()<---

6/23/2017 7:24:04 PM [ERROR] - Method "ProtocolEndpoint_UnhandledException" at line 417 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

PowerShell Editor Services is terminating due to an unhandled exception, see previous logs for details.

6/23/2017 7:24:04 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Session state changed --

    Old state: Running
    New state: Ready
    Result: Completed

6/23/2017 7:24:04 PM [VERBOSE] - Method "ExecuteCommand" at line 551 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Execution completed successfully.

vscode-powershell.log
[19:23:59] Language server starting...
powershell.exe started --
exe: C:\Windows\Sysnative\WindowsPowerShell\v1.0\powershell.exe
pid: 12276
args: C:\Users\vKunal.vscode\extensions\ms-vscode.powershell-1.4.1\scripts\Start-EditorServices.ps1 -EditorServicesVersion '1.4.1' -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.4.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\vKunal.vscode\extensions\ms-vscode.powershell-1.4.1\modules' -EnableConsoleRepl -LogLevel 'Verbose' -LogPath 'C:\Users\vKunal.vscode\extensions\ms-vscode.powershell-1.4.1\logs\1498226039-aaa23991-3df8-4ad8-a7a9-fdde81dbf62c1498222899111\EditorServices.log' -SessionDetailsPath 'C:\Users\vKunal.vscode\extensions\ms-vscode.powershell-1.4.1\sessions\PSES-VSCode-4308-686680' -FeatureFlags @()

[19:24:2] Language server started.
{"debugServicePort":27235,"status":"started","channel":"tcp","languageServicePort":21236}
Connecting to language service on port 21236...

Language service connected.

powershell.exe terminated or terminal UI was closed

@kunaludapi
Copy link
Author

kunaludapi commented Jun 24, 2017

@daviwil is there any update?

@daviwil daviwil modified the milestones: June 2017, July 2017 Jul 11, 2017
@HowardHoffman
Copy link

I frequently get these errors:

The PowerShell session has terminated due to an error or Debug adapter process has terminated unexpectedly.

I can resolve only be closing VS Code and then restarting. I am on Powershell (authored by ms-vscode) 1.4.1.

@kunaludapi
Copy link
Author

kunaludapi commented Jul 11, 2017 via email

@daviwil
Copy link
Contributor

daviwil commented Jul 11, 2017

@nsleigh
Copy link

nsleigh commented Aug 14, 2017

I am seeing exactly the same problem (logs attached). It seem to happen with specific files but I can't find anything common with them, they are even in the same folder as files that are ok. I am not debugging when it crashes just viewing the code.

1502698131-aae3bc26-03ba-47be-b9ed-8984139d6e211502693666404.zip

@nsleigh
Copy link

nsleigh commented Aug 14, 2017

I thought the common feature was the file being non-UTF-8 but even after converting to UTF-8 the same files still cause a crash. Looking the code it seems be be that PowerShellEditorServices module is incorrectly calculating the number of lines in the file. Hope this helps.

@TylerLeonhardt
Copy link
Member

Is anyone still seeing this issue? We've done some fixes around the "Illegal characters in path" exception.

@ravick4u
Copy link

I am also having the similar issue. Any update?

2018-07-27 11:24:36.623 [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.ArgumentException: Illegal characters in path.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at Microsoft.PowerShell.EditorServices.Workspace.GetFile(String filePath)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.DebugAdapter.<HandleSetBreakpointsRequest>d__29.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.ArgumentException: Illegal characters in path.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at Microsoft.PowerShell.EditorServices.Workspace.GetFile(String filePath)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.DebugAdapter.<HandleSetBreakpointsRequest>d__29.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)

@nsleigh
Copy link

nsleigh commented Jul 27, 2018

I haven't seen this problem with any of the latest updates.

@ravick4u
Copy link

I am using 1.8.1 with Visual Studio code v1.25.1

@ravick4u
Copy link

@nsleigh Looks like I found an issue. In my path, one of the folder has dot(.) in it. If I remove the dot then everything works ok. This was working earlier but not anymore. So for time being, I will have to rename my folder.

Hope this helps in troubleshooting issue.

@rjmholt
Copy link
Contributor

rjmholt commented Jul 27, 2018

@ravick4u Would you be able to share the full path of that folder (or something similar)?

@rjmholt
Copy link
Contributor

rjmholt commented Jul 27, 2018

Also, @ravick4u could you share your platform information?

> $PSVersionTable

Should be enough, although if you're on non-Windows, more info about the OS is often helpful.

@ravick4u
Copy link

ravick4u commented Jul 27, 2018

@rjmholt Not sure why but now I am not able to reproduce the issue. :(

If this issue comes again I will report it. Below is requested details regarding PowerShell.

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

@IamFive
Copy link

IamFive commented Oct 29, 2018

Same Issue, the folder name contains a dot may cause the issue.
But it's ok at first (i can debug pestor at first with same folder name), maybe after a update of vscode, then it keeps crash. if i change the folder name (remove dot), everything is ok again.

Folder path is 'C:\Program Files\WindowsPowerShell\Modules\Huawei.iBMC.Cmdlets'

2018-10-29 10:11:38.694 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs: In method 'OnListenTaskCompleted', line 391:
    ProtocolEndpoint message loop terminated due to unhandled exception:
    
    System.AggregateException: 发生一个或多个错误。 ---> System.ArgumentException: 路径中具有非法字符。
       在 System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
       在 System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
       在 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
       在 Microsoft.PowerShell.EditorServices.Workspace.GetFile(String filePath)
       在 Microsoft.PowerShell.EditorServices.Protocol.Server.DebugAdapter.<HandleSetBreakpointsRequest>d__29.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
       在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       在 Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__7.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
       在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       在 Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.<ListenForMessages>d__36.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
       在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       在 Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
       在 System.Threading.Tasks.Task.Execute()
       --- 内部异常堆栈跟踪的结尾 ---
    ---> (内部异常 #0) System.ArgumentException: 路径中具有非法字符。
       在 System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
       在 System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
       在 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
       在 Microsoft.PowerShell.EditorServices.Workspace.GetFile(String filePath)
       在 Microsoft.PowerShell.EditorServices.Protocol.Server.DebugAdapter.<HandleSetBreakpointsRequest>d__29.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
       在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       在 Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__7.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
       在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       在 Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.<ListenForMessages>d__36.MoveNext()
    --- 引发异常的上一位置中堆栈跟踪的末尾 ---
       在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       在 Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
       在 System.Threading.Tasks.Task.Execute()<---
    

2018-10-29 10:11:38.694 [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.

@JustinGrote
Copy link
Collaborator

I was unable to reproduce this even with putting a ton of special characters in a project folder as #918 (comment) suggests
image

@IamFive can you still reproduce after the latest version release?

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 22, 2020
@rjmholt
Copy link
Contributor

rjmholt commented Apr 23, 2020

Given that the debugging infrastructure has changed pretty significantly, I think it's safe to assume that any issue still occurring here is unrelated to what's happening in this issue and doesn't share any meaningful context

@rjmholt rjmholt closed this as completed Apr 23, 2020
@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Apr 23, 2020
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

10 participants