Jump-Location icon indicating copy to clipboard operation
Jump-Location copied to clipboard

Non-actionable error message in case if ~\jump-location.txt corrupted

Open MitjaBezensek opened this issue 9 years ago • 21 comments

I'm getting this error after installing Jump-Location:

Set-JumpLocation : The type initializer for 'Jump.Location.SetJumpLocationCommand' 
threw an exception.
At C:\Users\mitja.bezensek\Documents\WindowsPowerShell\Modules\Jump.Location\Load.ps1:
36 char:2
+     Set-JumpLocation -Initialize
+     ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], TypeInitializationException
    + FullyQualifiedErrorId : System.TypeInitializationException

I have tried the two suggestions for errors after install but none of those worked for me.

Not sure if it is related but I had Jump-Location installed via chocolatey (v0.5.1) which I uninstalled and then installed the new version (v0.6.0) via the Install-Module.

MitjaBezensek avatar Oct 08 '14 08:10 MitjaBezensek

Can you retrive Exception and InnerExceptions: $error[0].Exception $error[0].Exception.InnerException $error[0].Exception.InnerException.InnerException etc, until it's null

vors avatar Oct 08 '14 16:10 vors

C:\Users\mitja.bezensek> $error[0].Exception
The type initializer for 'Jump.Location.SetJumpLocationCommand' threw an exception.
C:\Users\mitja.bezensek> $error[0].Exception.InnerException
Row of file didn't have 2 columns separated by a tab
C:\Users\mitja.bezensek> $error[0].Exception.InnerException.InnerException
C:\Users\mitja.bezensek>

MitjaBezensek avatar Oct 08 '14 16:10 MitjaBezensek

Oh, I hit this one time as well, I thought it was during development. File with data corrupted, you can remove it with rm ~\jump-location.txt*

Thank you for reporting this!

vors avatar Oct 08 '14 16:10 vors

I renamed this issue and convert it to bug

vors avatar Oct 08 '14 16:10 vors

Yeah, this fixed it, tnx.

MitjaBezensek avatar Oct 08 '14 16:10 MitjaBezensek

Fixed my issue -- thanks

thebrianlopez avatar Dec 03 '14 05:12 thebrianlopez

This problems happens quite often. I would say every 2-3 weeks.

vors avatar Dec 10 '14 00:12 vors

Fixed it for me as well. :+1:

dennisdoomen avatar Feb 04 '15 18:02 dennisdoomen

I just encountered this, jump-location.txt got replaced with 4628 NUL bytes...

Porges avatar Mar 01 '15 19:03 Porges

Could it be caused when multiple PS console/ISE/other hosts are run concurrently? The mutex that guards the file against concurrent access derives its name from the executing assembly, which would have duplicates in that case.

codespare avatar Mar 11 '15 16:03 codespare

@codespare this is what we want: a global mutex should be used by all users of assembly to synchronize between each other.

I tried fix this part couple times and it became over-engineered, but still doesn't work correctly. The real problem is in using file as a database without a layer of abstraction that handles concurrency. Original design was not created to handle multiply instances at the same time. I started project https://github.com/vors/ZLocation to fix that. You can give it a try.

vors avatar Mar 11 '15 16:03 vors

You are right, I got a little confused. One shouldn't try and troubleshoot concurrency issue after midnight, but my j key had suddenly broken and that was an emergency :) I also realized this had already been clarified in another issue after having posted my comment... Re-reading FileStoreProvider.cs, I still don't quite get things like the use of ownership:false constructing the mutex, or the Global scope prefix rather than Local. The Assembly Guid retrieval could also probably be via a string constant, and Save seems to assume nothing has changed since it was last called and looks like it would merrily overwrite intermediate changes having originated in another instance. But in any case, thank you for your suggestion, I'll go try ZLocation. Irrespective of that bug, this is just too useful of a tool to go without.

codespare avatar Mar 12 '15 11:03 codespare

Same thing happened: my computer BSOD'd on me, and the next reboot I got the same error. As with @Porges, my jump-location.txt is full of nul! Here it is, in case you want to repro yourself: https://dl.dropboxusercontent.com/u/2323661/jump-location.txt

hmemcpy avatar Mar 23 '15 07:03 hmemcpy

Same thing happened to me. Glad I found this :+1:

latish avatar Mar 26 '15 22:03 latish

Yes, power failure here broke it on next boot.

cmaughan avatar Jun 11 '15 09:06 cmaughan

<ads> I released the first version of ZLocation, a Jump-Location successor, that doesn't have this particular problem. </ads>

vors avatar Jun 11 '15 17:06 vors

This happens to me all the time. I have to clean out my jump-location info once a month or so.

Pharylon avatar Dec 21 '15 13:12 Pharylon

I got this error, and it was still non-actionable in 2017

uglycoyote avatar May 24 '17 04:05 uglycoyote

Same here. Happens often.

martijnburgers avatar May 29 '17 11:05 martijnburgers

This has happened twice to me in the last month.

neraath avatar Jun 19 '17 13:06 neraath

Yes, it's quite irritating, it would be great to have it fixed.

Greg-Smulko avatar Jan 29 '18 14:01 Greg-Smulko