Skip to content

EditorServices - Parameter name: Position 194:1 is outside of the line range of 1 to 193. #1561

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
PrzemyslawKlys opened this issue Oct 4, 2018 · 21 comments

Comments

@PrzemyslawKlys
Copy link
Contributor

PrzemyslawKlys commented Oct 4, 2018

System Details

### VSCode version: 1.27.2 f46c4c469d6e6d8c46f268d1553c5dc4b475840f x64

### VSCode extensions:
[createInstance] extensionManagementService depends on downloadService which is NOT registered.
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


### PSES version: 1.9.0.0

### PowerShell version:

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


Issue Description

I am experiencing a problem with...crashing of editor services.

Expected Behaviour

Not crashing.

Actual Behaviour

Got this one with 1.9.0

VERBOSE: ERRORS caught while waiting for EditorServicesHost to complete execution
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
One or more errors occurred.
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
One or more errors occurred.

Specified argument was out of the range of valid values.
Parameter name: Position 194:1 is outside of the line range of 1 to 193.
   at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
   at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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()
PS>$global:?
True
**********************
Windows PowerShell transcript end
End time: 20181004112755
**********************

I had 2 files open. I copied part of the content of one file (that almost matched the other content but it was like 7 lines longer) and pasted with replace on the other content.

In other words:

  • 1 file has 100 lines
  • 2 file has 100 lines
  • Modify file nr 1 and add 7 more lines
  • Select 70 lines (including those modified)
  • Go into another file Select 63 lines
  • Paste content over
  • Crash occurs

At least that's what happend. Not sure if it's the same as this one #1510 thou or as one of those closed ones. Looks similar but the idea may be the same.

Attached Logs

Follow the instructions in the troubleshooting docs
about capturing and sending logs.

@TylerLeonhardt
Copy link
Member

Hi @PrzemyslawKlys can you attach the Diagnostic logs? We're looking to see what message came in that caused this crash.

Thanks for always being so patient and understanding. We really appreciate it!

@PrzemyslawKlys
Copy link
Contributor Author

Hi @tylerl0706. That's no problem. I really enjoy Visual Studio Code with PowerShell. And for some reason the moment I started using VSCode for real suddenly I've managed to create lots of PowerShell Modules, structure them, source control them and even Pestered them (didn't knew what Pester was before VSCode) and my PowerShell skills have improved a lot in last few months. Might be coincidental but maybe not. It really adds a lot of features over standard ISE. Folder managing, code formatting, and other VS Code features really makes things great and without all those things I may not go thru jump & hoops to find out better way to manage/write PowerShell. I don't use debugging of PowerShell yet but I guess time will come for this.

Here are the logs for that session:
1538643718-bd5bdb27-273d-4b5c-9c78-7ca742f8cb091538643570544.zip

@Halkcyon
Copy link

Halkcyon commented Oct 8, 2018

I'd like to point out in my scenario (on the linked issue), the crashing stopped when changing the logging to Diagnostic.

@PrzemyslawKlys
Copy link
Contributor Author

In my case it still happens. I've been running diagnostic since months now

image

@rjmholt
Copy link
Contributor

rjmholt commented Oct 8, 2018

@PrzemyslawKlys hopefully you're cleaning the log folder out -- you're probably accumulating a lot of files there.

@PrzemyslawKlys
Copy link
Contributor Author

PrzemyslawKlys commented Oct 8, 2018

:-) Nope..

image

But it seems to clean itself when upgrading of extension happens. So only 1.9.0 now. Unless it's impacting performance I don't mind.

@rjmholt
Copy link
Contributor

rjmholt commented Oct 8, 2018

Ok! There is a plan to eventually make it self-cleaning, but it hasn't been prioritised.

@rjmholt
Copy link
Contributor

rjmholt commented Oct 9, 2018

@PrzemyslawKlys A couple of questions about your specific scenario that the logs don't fully reconstruct:

  • The file before the paste was 193 lines long (starts at 1 and ends at 194)?
  • You highlighted from some point in the document up to the last line and then pasted?
  • The new document length would have been something other than 193 lines?

You probably can't reconstruct the exact scenario you had, but maybe you can reproduce a similar one again and record (1) the length of the file before pasting, (2) the region you pasted over, (3) the number of lines of text your pasted? (I haven't been able to reproduce this myself, but I'm pretty sure I've worked out where in the code bad things are happening and why)

@PrzemyslawKlys
Copy link
Contributor Author

I saw this again today. I will try to reproduce it but so far no go. I do have logs from that one crash thou if you want?

PowerShell Integrated Console
VERBOSE: Invoking Start-EditorServicesHost
VERBOSE: Start-EditorServicesHost returned Microsoft.PowerShell.EditorServices.Host.EditorServicesHost
VERBOSE: Writing session file with contents:
VERBOSE: {"status":"started","debugServiceTransport":"NamedPipe","languageServiceTransport":"NamedPipe","debugServicePipeName":"\\\\.\\pipe\\PSES_0636c164-68b6-4e49-8e71-b5b729c59ed4","languageServicePipeName":"\\\\.\\pipe\\PSES_bc344d39-a38e-458a-96e0-c2cc927fd412"}
VERBOSE: Wrote out session file
VERBOSE: 
#-- Waiting for EditorServicesHost to complete execution ---------------------
VERBOSE: ERRORS caught while waiting for EditorServicesHost to complete execution
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
One or more errors occurred.
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
One or more errors occurred.

Specified argument was out of the range of valid values.
Parameter name: Position 223:1 is outside of the line range of 1 to 222.
   at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
   at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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()
PS>$global:?
True
**********************
Windows PowerShell transcript end
End time: 20181009204837
**********************

And


2018-10-09 20:48:37.441 [VERBOSE] C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs: In method 'ReadMessage', line 123:
    Received Event 'textDocument/didChange'

2018-10-09 20:48:37.442 [VERBOSE] C:\PowerShellEditorServices\src\PowerShellEditorServices\Workspace\Workspace.cs: In method 'ResolveFilePath', line 382:
    Resolved path: c:\Support\GitHub\PSMigrator\Paccor-Turkey-Istanbul\O365-Paccor-France-Auneau.ps1

2018-10-09 20:48:37.444 [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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: Position 223:1 is outside of the line range of 1 to 222.
       at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: Position 223:1 is outside of the line range of 1 to 222.
       at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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-09 20:48:37.445 [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
Copy link
Contributor

rjmholt commented Oct 9, 2018

I'm reasonably confident this is now fixed in PowerShell/PowerShellEditorServices#763. (I know we've been here before, but these weird off-by-one messages are something that we just didn't know VSCode was sending or under what circumstances -- we're now at pretty general handling of them)

There's not really a convenient way to give it to you to test though... The simplest way would be to take the artefact and replace the extension's modules folder with that expanded. If you're interested, I can tell you how to do it.

@PrzemyslawKlys
Copy link
Contributor Author

It's no problem. I can run insiders versions if you want as well. I switched back from insiders to production because I lost excitement when new version was released to masses because I already had it... that's why I don't run VSCode Insiders so I can enjoy this feeling of "Wow! New goodies to play with". Unfortunately I'm heavy software geek so when new things are added and then taken away because they are not prime time ready it hurts :-)

I've now replaced code with yours and will let you know if i hit anything. On a side note I did notice one change in newest Windows 10 (or maybe it was there before) where it doesn't ask you anymore when you paste over folders from .zip file directly. If you unpack first and then paste it will prompt you for overwrite.

@PrzemyslawKlys
Copy link
Contributor Author

PrzemyslawKlys commented Oct 10, 2018

Replacing that files gives me error on start of PowerShell.

10/10/2018 11:03:32 AM [NORMAL] - Visual Studio Code v1.28.0 64-bit
10/10/2018 11:03:32 AM [NORMAL] - PowerShell Extension v1.9.0
10/10/2018 11:03:32 AM [NORMAL] - Operating System: Windows 64-bit
10/10/2018 11:03:32 AM [DIAGNOSTIC] - Succesfully required c:\Program Files\Microsoft VS Code\resources\app/node_modules.asar/vscode-textmate
10/10/2018 11:03:32 AM [DIAGNOSTIC] - Loaded the vscode-textmate module
10/10/2018 11:03:32 AM [DIAGNOSTIC] - Created the textmate Registry
10/10/2018 11:03:32 AM [DIAGNOSTIC] - PowerShell grammar file specified as c:\Program Files\Microsoft VS Code\resources\app\extensions\powershell\syntaxes\powershell.tmLanguage.json
10/10/2018 11:03:32 AM [NORMAL] - Language server starting --
10/10/2018 11:03:32 AM [NORMAL] -     exe: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
10/10/2018 11:03:32 AM [NORMAL] -     args: C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.9.0'-AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\modules'-EnableConsoleRepl -LogLevel 'Diagnostic' -LogPath 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\logs\1539162212-4862e4a3-332f-4ccd-8e8a-3d4193f94b9d1539162209521\EditorServices.log' -SessionDetailsPath 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\sessions\PSES-VSCode-10884-451872' -FeatureFlags @()
10/10/2018 11:03:32 AM [NORMAL] - Syntax Folding Provider registered
10/10/2018 11:03:32 AM [NORMAL] - powershell.exe started, pid: 9068
10/10/2018 11:03:33 AM [NORMAL] - powershell.exe terminated or terminal UI was closed

Had to reinstall extension for it to work (as in the old version is working, not the one you gave me).

@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2018

@PrzemyslawKlys Do you have the corresponding EditorServices log?

@PrzemyslawKlys
Copy link
Contributor Author

1539192935-c5798968-f798-4145-92fc-feb4d2282dd71539192932023.zip

Not the same but I am able to reproduce it kind of. There is only 1 file. Nothing else thou. I copy files and start VS Code and it terminates.

@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2018

Hmmmmm, looks like it might not have the backend at all. If you wait a couple of days, we should have a full VSIX from AppVeyor for you to try instead.

@PrzemyslawKlys
Copy link
Contributor Author

Sure. I'll wait ;)

@PrzemyslawKlys
Copy link
Contributor Author

Just in case it's not fixed (will wait for final release) I wanted to add I was able to reproduce this when I was editing some text, adding, deleting lines and decided it's bad way to do this so I started using Ctrl+Y / CTRL+Z a lot and it triggered this.

**********************
Windows PowerShell transcript start
Start time: 20181014151712
Username: EVOTEC\przemyslaw.klys
RunAs User: EVOTEC\przemyslaw.klys
Configuration Name: 
Machine: EVO1 (Microsoft Windows NT 10.0.17763.0)
Host Application: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command & 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\modules\PowerShellEditorServices\Start-EditorServices.ps1' -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.9.0'-AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\modules'-EnableConsoleRepl -LogLevel 'Diagnostic' -LogPath 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\logs\1539523031-1d4a926a-427e-47cb-8fad-398e6dd760301539448135335\EditorServices.log' -SessionDetailsPath 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\sessions\PSES-VSCode-6136-416994' -FeatureFlags @()
Process ID: 27404
PSVersion: 5.1.17763.1
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17763.1
BuildVersion: 10.0.17763.1
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
VERBOSE: 
#-- Updated PSModulePath to: -------------------------------------------------
VERBOSE: C:\Users\pklys\Documents\WindowsPowerShell\Modules\
VERBOSE: C:\Users\pklys\AppData\Local\Apps\Sharegate\
VERBOSE: C:\Program Files\WindowsPowerShell\Modules
VERBOSE: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
VERBOSE: C:\Program Files\Intel\
VERBOSE: C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\
VERBOSE: C:\Program Files\SharePoint Online Management Shell\
VERBOSE: C:\Program Files (x86)\AutoIt3\AutoItX
VERBOSE: C:\Program Files\WindowsPowerShell\Modules\
VERBOSE: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\
VERBOSE: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\
VERBOSE: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage\
VERBOSE: C:\Program Files (x86)\SharePoint Online Management Shell\
VERBOSE: C:\Program Files\Common Files\Skype for Business Online\Modules\
VERBOSE: C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer\AppvPkgConverter
VERBOSE: C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer\AppvSequencer
VERBOSE: C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\
VERBOSE: C:\Program Files\Intel\Wired Networking\
VERBOSE: C:\Program Files\Microsoft Message Analyzer\PowerShell\
VERBOSE: C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\modules
VERBOSE: 
#-- Check required modules available -----------------------------------------
VERBOSE: Testing module availability PowerShellGet
VERBOSE: Populating RepositorySourceLocation property for module PowerShellGet.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.0.0\PSModule.psm1'.
VERBOSE: Populating RepositorySourceLocation property for module PowerShellGet.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.5.0.0\PSModule.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1'.
VERBOSE: PowerShellGet  found
VERBOSE: 
#-- Start up PowerShellEditorServices ----------------------------------------
VERBOSE: Importing PowerShellEditorServices
VERBOSE: Loading module from path 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'.
VERBOSE: Loading module from path 'C:\Users\pklys\.vscode\extensions\ms-vscode.powershell-1.9.0\modules\PowerShellEditorServices\PowerShellEditorServices.psm1'.
VERBOSE: Exporting function 'Start-EditorServicesHost'.
VERBOSE: Exporting function 'Compress-LogDir'.
VERBOSE: Exporting function 'Get-PowerShellEditorServicesVersion'.
VERBOSE: Importing function 'Compress-LogDir'.
VERBOSE: Importing function 'Get-PowerShellEditorServicesVersion'.
VERBOSE: Importing function 'Start-EditorServicesHost'.
PowerShell Integrated Console
VERBOSE: Invoking Start-EditorServicesHost
VERBOSE: Start-EditorServicesHost returned Microsoft.PowerShell.EditorServices.Host.EditorServicesHost
VERBOSE: Writing session file with contents:
VERBOSE: {"status":"started","debugServiceTransport":"NamedPipe","languageServiceTransport":"NamedPipe","debugServicePipeName":"\\\\.\\pipe\\PSES_bb1fcf92-b393-48e9-81c5-9ac861b5afbf","languageServicePipeName":"\\\\.\\pipe\\PSES_8366067d-860e-40ac-befd-2792b91ab8a9"}
VERBOSE: Wrote out session file
VERBOSE: 
#-- Waiting for EditorServicesHost to complete execution ---------------------
VERBOSE: ERRORS caught while waiting for EditorServicesHost to complete execution
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
One or more errors occurred.
VERBOSE: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Object )
One or more errors occurred.

Specified argument was out of the range of valid values.
Parameter name: Position 30:2 is outside of the column range of 1 to 1.
   at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
   at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
   at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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()
PS>$global:?
True
**********************
Windows PowerShell transcript end
End time: 20181014154557
**********************

@rjmholt
Copy link
Contributor

rjmholt commented Dec 6, 2018

Hi all, please let us know if this is fixed or not with the latest extension release. We added a fix here which we think will fix things, but are looking for user confirmation.

@PrzemyslawKlys
Copy link
Contributor Author

Looks good so far. I'll keep you posted.

@PrzemyslawKlys
Copy link
Contributor Author

2018-12-07 18:58:40.261 [ERROR] tid:44 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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: Position 87:20 is outside of the column range of 1 to 1.
       at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: Position 87:20 is outside of the column range of 1 to 1.
       at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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()<---

1544201026-7cb5b18e-aaf0-4712-9e57-f347208f6ec91544200733726.zip

It happens when you mess with file outside of VSCode while at the same time it's open in VSCode and maybe some change happens.

@PrzemyslawKlys
Copy link
Contributor Author

1546202591-bcd9ffac-00ec-4c7f-ae1c-aefe59f7fe231546168483990.zip

2018-12-30 22:04:32.579 [ERROR] tid:51 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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: Position 60:26 is outside of the column range of 1 to 19.
       at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: Position 60:26 is outside of the column range of 1 to 19.
       at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, 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.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-12-30 22:04:32.580 [ERROR] tid:51 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.

Happened when I tried to Format. After Format things went sideways. It seems it doesn't really like when something is done outside of VS.

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

No branches or pull requests

5 participants