Umbraco Lucene.Net.Index.MergePolicy.MergeException What is causing this? - umbraco

I am using Umbraco and for some reason out of the blue I get the Visual Studio JIT Debugger popup asking me if I want to debug and exception with w3wp.exe, I attached to it and found the following exception, I can't find any cause for this as I haven't added anything new.
Lucene.Net.Index.MergePolicy.MergeException was unhandled
Message=Exception of type 'Lucene.Net.Index.MergePolicy+MergeException' was thrown.
Source=Lucene.Net
StackTrace:
at Lucene.Net.Index.ConcurrentMergeScheduler.HandleMergeException(Exception exc)
at Lucene.Net.Index.ConcurrentMergeScheduler.MergeThread.Run()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: Lucene.Net.Index.CorruptIndexException
Message=doc counts differ for segment _3qw: fieldsReader shows 1025 but segmentInfo shows 1
Source=Lucene.Net
StackTrace:
at Lucene.Net.Index.IndexWriter.HandleMergeException(Exception t, OneMerge merge)
at Lucene.Net.Index.IndexWriter.Merge(OneMerge merge)
at Lucene.Net.Index.ConcurrentMergeScheduler.DoMerge(OneMerge merge)
at Lucene.Net.Index.ConcurrentMergeScheduler.MergeThread.Run()
InnerException:
Does anyone have any idea what is causing this or how to fix it?
Thanks

I found the answer from this link:
http://our.umbraco.org/forum/ourumb-dev-forum/bugs/16066-Missing-LuceneNet-assembly
on Dunfee posted this reply 6 months ago
Just went through a migration from one location to another. I removed the contents of App_Data/TEMP/ExamineIndexes and after a minute or so of watching the browser spinner (while the Lucene cache was being rebuilt) the site came up.

Related

Octopus Deploy Tentacle crash after trying to deploy package

when trying to deploy a package from Octopus Server to Octopus Tentacle, tentacle suddenly crashes with this info in logs:
10 INFO [] [RunningScript] [Read Lock] [no locks] Trying to acquire lock.
10 FATAL Unhandled AppDomain exception occurred: Value cannot be null.
Parameter name: key
System.ArgumentNullException
at System.Collections.Concurrent.ConcurrentDictionary`2.TryAdd(TKey key, TValue value)
at Octopus.Shared.Scripts.ScriptIsolationMutex.ScriptIsolationMutexReleaser.EnterReadLock()
at Octopus.Shared.Scripts.ScriptIsolationMutex.ScriptIsolationMutexReleaser.EnterLock()
at Octopus.Shared.Scripts.RunningScript.Execute()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Concurrent.ConcurrentDictionary`2.TryAdd(TKey key, TValue value)
at Octopus.Shared.Scripts.ScriptIsolationMutex.ScriptIsolationMutexReleaser.EnterReadLock()
at Octopus.Shared.Scripts.ScriptIsolationMutex.ScriptIsolationMutexReleaser.EnterLock()
at Octopus.Shared.Scripts.RunningScript.Execute()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Many thanks,
Pawel
I've solved it by reinstalling everything with default settings.

Attempting to JIT compile method exception in MonoTouch.CoreGraphics.CGContext.DrawPDFPage

Here is the stack
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) MonoTouch.CoreGraphics.CGContext:CGContextDrawPDFPage (intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
at MonoTouch.CoreGraphics.CGContext.DrawPDFPage (MonoTouch.CoreGraphics.CGPDFPage page) [0x00000] in :0
at Neva.PdfViewer.PageContentView.Draw (MonoTouch.CoreGraphics.CGContext context) [0x00000] in :0
at Neva.PdfViewer.PageContentTile.DrawInContext (MonoTouch.CoreGraphics.CGContext ctx) [0x00000] in :0 [7.1.1]
While we were not able to recreate this problem in QA or unit testing, this exception randomly happens on AppStore distributed installations.
Looking at DrawPDFPage in CGContext
public void DrawPDFPage (CGPDFPage page)
{
CGContext.CGContextDrawPDFPage (this.handle, page.handle);
}
where CGContextDrawPDFPage is a P/Invoke function
[DllImport ("/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics")]
private static extern void CGContextDrawPDFPage (IntPtr c, IntPtr page);
doesn't give us any hint. The link above http://docs.xamarin.com/ios/about/limitations is not really helpful.
My question is, what could be causing such an exception? What are steps to debug and fix it?
This exception (System.ExecutionEngineException: Attempting to JIT compile method ...) should be 100% reproducible.
The fact that it isn't, points at something else (and probably worse): memory corruption of some sort.
However without some way to (at least randomly) reproduce it yourself, it's close to impossible to track down.
My initial suggestion would be to try to figure out if there's anything at all you can figure out in order to be able to create a test case yourself:
Does it only occur for a certain set of devices (only iPad 2 for instance)?
Does it only occur for a certain set of customers (only customers in Iceland for instance)?
Is the exception exactly the same every time, or does the P/Invoke / stack trace vary?
Is it a low-memory condition? Did the app get memory warnings prior to this occurring?
Are there any required steps in your app (i.e. if the user does X+Y it may crash, but if he does Y+X, then it never crashes)?

Facebook C# sdk random exception when posting photo

I am using Facebook C#sdk to upload photos to user profiles using a Windows Service as a background job. And I am logging exceptions in almost every place that I can think of and for the most part it works fine. But occasionally, and sometimes it is quite frequent, I get the following exception, which does not get caught by my handler, and gets logged by the Windows Event logger, and terminates my service:
Application: PhotoService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Exception
Stack:
at System.Net.Security._SslStream.WriteCallback(System.IAsyncResult)
at System.Net.LazyAsyncResult.Complete(IntPtr)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Net.ContextAwareResult.Complete(IntPtr)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
From the looks of it, this is happening at FacebookClient.PostTaskAsync() method call, but I have no idea how to troubleshoot with the limited stacktrace information. Below is my photo posting method block:
public void PostPhotoToTimeline(string filename, byte[] photo, EventHandler<FacebookApiEventArgs> callbackCompleted)
{
var _filename = filename;
var mediaObject = new FacebookMediaObject
{
ContentType = "image/jpeg",
FileName = _filename
}.SetValue(photo);
_fb.PostCompleted += callbackCompleted;
var parameters = new Dictionary<string, object>();
parameters["file"] = mediaObject;
_fb.PostTaskAsync("/me/photos", parameters);
}
My biggest problem at the moment is, when this exception occurs, it terminates the service and I don't have service monitoring set up yet, so no way for me to find out the service has stopped. If I understand it correctly, this exception occurs in a separate thread and is not handled, thus it brings down the whole service. Is this correct? Any idea why this might be happening and where, or anyone faced this exception before? I have read about 'legacyUnhandledExceptionPolicy' to catch these unexpected exceptions. Will this prevent my service from terminating and is it good idea to use it? Sorry if I am asking too many questions in one go but these are all related and google hasn't been my friend on this so far.
Thanks for any help you can provide.
2 months gone and not a single answer, so I will post what I did to prevent this issue which might be useful to others. Still don't know the main cause for the crash but it is occasional, so using the flag "legacyUnhandledExceptionPolicy" has worked so far, with no unexpected terminations. The flag needs to be enabled in the config file:
<runtime>
<legacyUnhandledExceptionPolicy enabled="1"/>
</runtime>
Better explanation here: MSDN Reference

Duplicate Objects detected for Instance X of Type Y

I'm getting the following exception from structure map - "Duplicate Objects detected for Instance d54e25dc-d19c-4d70-99d1-56bd2502d203 of Type ..."
The stack trace is:
at StructureMap.InstanceCache.Set(Type pluginType, Instance Instance, Object result) in c:\code\structuremap\Source\StructureMap\InstanceCache.cs:line 60
at StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance) in c:\code\structuremap\Source\StructureMap\BuildSession.cs:line 159
at StructureMap.BuildSession.<>c_DisplayClass3.<.ctor>b_1() in c:\code\structuremap\Source\StructureMap\BuildSession.cs:line 34
at StructureMap.BuildSession.CreateInstance(Type pluginType) in c:\code\structuremap\Source\StructureMap\BuildSession.cs:line 192
at StructureMap.BuildSession.GetInstance[T]() in c:\code\structuremap\Source\StructureMap\BuildSession.cs:line 78
This exception happens only from time to time and is very difficult to reproduce.
What I've found out so far:
Calling ObjectFactory.Container.GetInstance(type) will create a new BuildSession with a new non-static cache.
The call will reach BuildSession.CreateInstance(Type pluginType, Instance instance) and no instance is in the cache yet. (https://github.com/structuremap/structuremap/blob/master/Source/StructureMap/BuildSession.cs#L149-166)
Now we'll go on to _builder.Resolve(pluginType, instance, this);
Somewhere during Resolve() the object will get into the cache and later in CreateInstance we're saving it into the cache once again, receiving the exception.
That object is configured with Singleton lifecycle. The application is WCF service hosted in IIS.
Any help with finding the cause is appreciated.

Sudden exception during UDP streaming

I have an open UDP connection that streams video for several hours between two machines on different vlans.
After several hours I get the following exception on the server side (the transmitter):
System.Net.Sockets.SocketException: A blocking operation was
interrupted by a call to WSACancelBlockingCall at
System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
From that moment on, from time to time (not on every send), I see the following:
System.Net.Sockets.SocketException: A non-blocking socket operation
could not be completed immediately at
System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
On the client side I see no exception or abnormal behavior.
Is it possible that I get this exception due to a N/W problem, for example, something in the switch?
Any other ideas what can cause these exceptions?
Thanks
I will make a wild guess about WSACancelBlockingCall exception.
Probably you are trying to close the socket from another thread or your socket is getting disposed somehow with garbage collector.

Resources