Skip to content

Powershell Extension crash on UNC path. #1854

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
agressiv opened this issue Apr 8, 2019 · 3 comments
Closed

Powershell Extension crash on UNC path. #1854

agressiv opened this issue Apr 8, 2019 · 3 comments

Comments

@agressiv
Copy link

agressiv commented Apr 8, 2019

VSCode version: 1.33.0 0dd516dd412d42323fc3464531b1c715d51c4c1a x64

VSCode extensions:

luggage66.VBScript@0.0.2
ms-python.python@2019.3.6352
ms-vscode.csharp@1.18.0
ms-vscode.powershell@1.12.0
vscode-icons-team.vscode-icons@8.5.0

PSES version: 1.12.0.0

PowerShell version:

Name Value


PSVersion 5.1.17763.316
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.316
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Issue Description

Visual Studio Code powershell extension crashes if I open a file with a UNC path. This used to work. If I change the path to a fixed drive letter, it doesn't crash.

Expected Behaviour

The powershell environment shouldn't crash.

Actual Behaviour

It crashes.

-- Description of what actually happens --

Attached Logs

2019-04-08 08:06:31.309 [ERROR] tid:15 in 'OnListenTaskCompleted' C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs: line 391
ProtocolEndpoint message loop terminated due to unhandled exception:

System.AggregateException: One or more errors occurred. ---> System.NotSupportedException: The given path's format is not supported.
   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.GetFile(String filePath)
   at Microsoft.PowerShell.EditorServices.CodeLenses.CodeLensFeature.<HandleCodeLensResolveRequest>d__6.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.NotSupportedException: The given path's format is not supported.
   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.GetFile(String filePath)
   at Microsoft.PowerShell.EditorServices.CodeLenses.CodeLensFeature.<HandleCodeLensResolveRequest>d__6.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()<---

2019-04-08 08:06:31.316 [ERROR] tid:15 in 'ProtocolEndpoint_UnhandledException' C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: line 448
PowerShell Editor Services is terminating due to an unhandled exception, see previous logs for details.

@MichaelWinterGdB
Copy link

Same behavior here on 2 different machines after update of powershell extension to version 1.12
image

@TylerLeonhardt
Copy link
Member

Duplicate of #1830
Fixed in PowerShell/PowerShellEditorServices#908

Closing in favor of the original issue.

@TylerLeonhardt
Copy link
Member

Hi all, can you try one of these builds:

PowerShell and PowerShell Preview release candidates.zip

This should have the UNC path fix. Note, if you've never used the Preview extension, look at these steps.

If you've never installed a VSIX before, here are the steps.

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

No branches or pull requests

3 participants