Skip to content
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

Index was out of range on fresh install #84

Open
tgeng opened this issue Jul 21, 2019 · 2 comments
Open

Index was out of range on fresh install #84

tgeng opened this issue Jul 21, 2019 · 2 comments

Comments

@tgeng
Copy link

tgeng commented Jul 21, 2019

Hi, first thank you for creating this plugin! I enjoy using z.sh on Linux and I was super excited when seeing this project!

Unfortunately I could not get this working. Everytime I execute z. I get the following error:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
At C:\Program Files (x86)\WindowsPowerShell\Modules\ZLocation\1.2.0\ZLocation.Service.psm1:76 char:9
+         Write-Error $error[0]
+         ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], ArgumentOutOfRangeException
    + FullyQualifiedErrorId : System.ArgumentOutOfRangeException

My setup:

PS> $PSVersionTable.PSVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17763  592

Terminal: Cmder version 180626
Windows version: 10.0.17763 Build 17763

@vvuk
Copy link

vvuk commented Aug 19, 2019

Same issue, pwsh 7 preview 2 on Windows 10. For me Update-ZLocation $pwd takes >10s (!) to execute and prints this error.

@vvuk
Copy link

vvuk commented Aug 19, 2019

The actual contents of the error -- after commenting out the entire block there and just getting the raised exception instead of trying to save errors in a loop:

Exception calling "Insert" with "1" argument(s): "Cannot insert duplicate key in unique index '_id'. The duplicate value is '"C:\\Users\\vladv"'."
At C:\Users\vladv\Documents\PowerShell\Modules\ZLocation\1.2.0\ZLocation.LiteDB.psm1:19 char:5
+     $collection.Insert((ToDocument $item)) | out-null
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : LiteException

I opened #85 for this as it might be a different underlying issue than the original reporter of this issue was hitting.

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

2 participants