Perforce extension causes Editor Services to crash
See original GitHub issueSystem 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?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
Helix Core Server Administrator Guide (2022.2)
Examples include: the system crashing, the Helix Core Server exiting without any error in its log and without Windows indicating that the server...
Read more >Server extension errors and troubleshooting - Perforce
When a trigger or server extension has a failure, the logged by server message can be presented. It is an intentionally uninformative message...
Read more >P4VS Release Notes - Perforce
1840211 (Job #99521) * P4VS will no longer cause Visual Studio to crash when clicking Get Revision on a Changelist in the Submitted...
Read more >Helix Core Extensions Developer Guide - Perforce Software
The following table lists the Helix Core events that can cause a server extension to run. Instead of managing a trigger table, the...
Read more >Release Notes for Helix Visual Client (P4V) - Perforce Software
#103707 Updated version of Helix Core API that P4V uses where a bug in the API was fixed that was causing it to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks a lot! I see the issue now, you’re using the Perforce plugin and it’s opening a virtual file path that we don’t support. I need to get this issue fixed: https://github.com/PowerShell/PowerShellEditorServices/issues/342
I believe @tylerl0706 added support for the
inmemory://URI – @ehouarn-perret, @Serivy would you be able to check if this bug is fixed? (Don’t have perforce on my machine)