Skip to content

Perforce extension causes Editor Services to crash #729

@natalie-o-perret

Description

@natalie-o-perret

System Details

  • Operating system name and version: Windows 7 Enterprise
  • VS Code version: 1.12.1
  • PowerShell extension version: 1.0.0
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here

code -v

1.12.1
f6868fce3eeb16663840eb82123369dec6077a9b

$pseditor.EditorServicesVersion
Display nothing...

code --list-extensions --show-versions

dbaeumer.vscode-eslint@1.2.8
donjayamanne.git-extension-pack@0.1.2
donjayamanne.githistory@0.2.0
donjayamanne.python@0.6.4
dracula-theme.theme-dracula@1.16.0
eamodio.gitlens@3.4.9
eg2.tslint@0.14.0
formulahendry.auto-close-tag@0.3.12
HookyQR.beautify@1.0.2
jprestidge.theme-material-theme@1.0.1
lukehoban.Go@0.6.61
ms-vscode.cpptools@0.11.0
ms-vscode.csharp@1.9.0
ms-vscode.PowerShell@1.0.0
msjsdiag.debugger-for-chrome@3.1.1
PeterJausovec.vscode-docker@0.0.14
robertohuertasm.vscode-icons@7.7.0
saviorisdead.Theme-GitHubCleanWhite@0.0.3
slevesque.perforce@2.0.1
superzadeh.theme-solarized-obsidian@0.0.8
zhuangtongfa.Material-theme@2.7.4
Zignd.html-css-class-completion@1.2.0
ziyasal.vscode-open-in-github@1.2.5

$PSVersionTable

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

Issue Description

Just open any powershell script

Attached Logs

Follow the instructions in the README

EditorServices.log

5/11/2017 2:31:56 AM [NORMAL] - Method "StartLogging" at line 126 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

    PowerShell Editor Services Host v1.0.0.0 starting (pid 36992)...
    
      Host application details:
    
        Name:      Visual Studio Code Host
        ProfileId: Microsoft.VSCode
        Version:   1.0.0
        Arch:      64-bit
    
      Operating system details:
    
        Version: Microsoft Windows NT 6.1.7601 Service Pack 1
        Arch:    64-bit

5/11/2017 2:31:56 AM [NORMAL] - Method "Initialize" at line 214 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

    PowerShell runtime version: 5.1.14409.1005, edition: Desktop

5/11/2017 2:31:57 AM [NORMAL] - Method "FindPSScriptAnalyzerModule" at line 261 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs

    PSScriptAnalyzer found at C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\modules\PSScriptAnalyzer\PSScriptAnalyzer.psd1

5/11/2017 2:31:57 AM [NORMAL] - Method "StartLanguageService" at line 160 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

    Language service started, listening on port 22578

5/11/2017 2:31:57 AM [NORMAL] - Method "StartDebugService" at line 215 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs

    Debug service started, listening on port 29455

5/11/2017 2:31:58 AM [ERROR] - Method "DispatchMessage" at line 301 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs

    MessageDispatcher: No handler registered for Event type 'initialized'

5/11/2017 2:31:58 AM [ERROR] - Method "DispatchMessage" at line 301 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs

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

5/11/2017 2:31:58 AM [ERROR] - Method "OnListenTaskCompleted" at line 337 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs

    MessageDispatcher loop terminated due to unhandled exception:
    
    System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Illegal characters in path.
       at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
       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__DisplayClass26_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__33.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.MessageDispatcher.<ListenForMessages>d__32.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)
       at System.Threading.Tasks.Task.Execute()
       --- End of inner exception stack trace ---
    ---> (Inner Exception #0) System.ArgumentException: Illegal characters in path.
       at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
       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__DisplayClass26_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__33.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.MessageDispatcher.<ListenForMessages>d__32.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)
       at System.Threading.Tasks.Task.Execute()<---
    

vscode-powershell.log

[2:31:55] Language server starting...
powershell.exe started --
    exe: C:\WINDOWS\Sysnative\WindowsPowerShell\v1.0\powershell.exe
    pid: 36992
    args: C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\scripts\Start-EditorServices.ps1 -EditorServicesVersion '1.0.0' -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.0.0' -BundledModulesPath 'C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\modules' -EnableConsoleRepl -LogLevel 'Normal' -LogPath 'C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\logs\1494484315-421c0121-e093-4bd6-a688-5e28238a7b901494484314199\EditorServices.log' -SessionDetailsPath 'C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\sessions\PSES-VSCode-36500-851452' -FeatureFlags @()


[2:31:57] Language server started.
{"debugServicePort":29455,"status":"started","channel":"tcp","languageServicePort":22578}
Connecting to language service on port 22578...

Language service connected.

When starting powershell... and with any powershell script be it empty or with a few lines... Im always getting systematically the error below:

Starting PowerShell...

PS C:\Users\eperret\Desktop\

Caught error while waiting for EditorServicesHost to complete:
One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.WaitForExit()
   at CallSite.Target(Closure , CallSite , Object )
One or more errors occurred.
Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean check
ForDuplicates, 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(DidOpenTextDo
cumentParams openParams, EventContext eventContext)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass26_0`2.<SetEventHandle
r>b__0(Message eventMessage, MessageWriter messageWriter)
   at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__33.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.MessageDispatcher.<ListenForMessages>d__32.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)

Any idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions