Jump-Location
Jump-Location copied to clipboard
Non-actionable error message in case if ~\jump-location.txt corrupted
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.
Can you retrive Exception and InnerExceptions:
$error[0].Exception
$error[0].Exception.InnerException
$error[0].Exception.InnerException.InnerException
etc, until it's null
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>
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!
I renamed this issue and convert it to bug
Yeah, this fixed it, tnx.
Fixed my issue -- thanks
This problems happens quite often. I would say every 2-3 weeks.
Fixed it for me as well. :+1:
I just encountered this, jump-location.txt
got replaced with 4628 NUL bytes...
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 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.
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.
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
Same thing happened to me. Glad I found this :+1:
Yes, power failure here broke it on next boot.
<ads>
I released the first version of ZLocation, a Jump-Location successor, that doesn't have this particular problem.
</ads>
This happens to me all the time. I have to clean out my jump-location info once a month or so.
I got this error, and it was still non-actionable in 2017
Same here. Happens often.
This has happened twice to me in the last month.
Yes, it's quite irritating, it would be great to have it fixed.