.NET Runtime error causing application pool to stop - asp.net-mvc

I'm having this error repeat almost every minute, I think to the point it's hanging my web-server as sometimes it becomes unresponsive but still ping-able.
I'm not exactly sure where to start looking for a fix in reading the 3 log entries below.
Running asp.net 4 for a DNN CMS website (Dotnetnuke) on a new install of windows server 2016 standard. Prior this site was on a 2008R2 machine and this has been happening since the migration.
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IndexOutOfRangeException
at Lucene.Net.Index.IndexWriter.HandleMergeException(System.Exception, OneMerge)
at Lucene.Net.Index.IndexWriter.Merge(OneMerge)
at Lucene.Net.Index.ConcurrentMergeScheduler+MergeThread.Run()
Exception Info: Lucene.Net.Index.MergePolicy+MergeException
at Lucene.Net.Index.ConcurrentMergeScheduler.HandleMergeException(System.Exception)
at Lucene.Net.Index.ConcurrentMergeScheduler+MergeThread.Run()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
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.Threading.ThreadHelper.ThreadStart()
.
Faulting application name: w3wp.exe, version: 10.0.14393.0, time stamp: 0x57899b8a
Faulting module name: KERNELBASE.dll, version: 10.0.14393.0, time stamp: 0x57899809
Exception code: 0xe0434352
Fault offset: 0x0000000000017788
Faulting process id: 0x1840
Faulting application start time: 0x01d27de3c8a59141
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: b8c443b9-7658-47b3-ae17-40d304a55c82
Faulting package full name:
Faulting package-relative application ID:
.
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/25/ROOT
Process ID: 6208
Exception: Lucene.Net.Index.MergePolicy+MergeException
Message: Exception of type 'Lucene.Net.Index.MergePolicy+MergeException' was thrown.
StackTrace: at Lucene.Net.Index.ConcurrentMergeScheduler.HandleMergeException(Exception exc)
at Lucene.Net.Index.ConcurrentMergeScheduler.MergeThread.Run()
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()
InnerException: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
StackTrace: at Lucene.Net.Index.IndexWriter.HandleMergeException(Exception t, OneMerge merge)
at Lucene.Net.Index.IndexWriter.Merge(OneMerge merge)
at Lucene.Net.Index.ConcurrentMergeScheduler.MergeThread.Run()

Related

Unable to deploy Xamarin Froms iOS App it just keeps breaking on physical device

this is the first time I'm trying to write a request to you. Normaly I had could resolve most of the problems thanks to stackoverflow and others.
I developed an Xamarin.Forms App which runs on Android perfectly but when I try to deploy it to iOS (physical iPhone 8) it keeps breaking.
After searching for hours and trying diffrent things I hope someone can read out of the Code whats the matter...
I tried as well to set breakpoints in the appdelegate or first Page but after some seconds everthing breaks with this information:
2021-08-27 18:39:24.004 Xamarin.PreBuilt.iOS[4330:1030659] Xamarin.iOS: Successfully received USB connection from the IDE on port 10000, fd: 6
2021-08-27 18:39:24.007 Xamarin.PreBuilt.iOS[4330:1030659] Xamarin.iOS: Processing: 'start profiler: no'
2021-08-27 18:39:24.007 Xamarin.PreBuilt.iOS[4330:1030624] Xamarin.iOS: Profiler not loaded (disabled)
Loaded assembly: /private/var/containers/Bundle/Application/092BCD0C-2FC9-4F1B-A83E-29D87ACD245E/SHAPP.iOS.app/Xamarin.iOS.dll [External]
2021-08-27 18:39:24.334 Xamarin.PreBuilt.iOS[4330:1030624] Xamarin.iOS: Unable to locate assembly 'SHAPP' (culture: '')
2021-08-27 18:39:24.334 Xamarin.PreBuilt.iOS[4330:1030624] Xamarin.iOS: Unable to locate assembly 'SHAPP' (culture: '')
Loaded assembly: /private/var/mobile/Containers/Data/Application/6FE32CF0-AE4D-41A2-BBBA-EAD56133AA7E/Documents/SHAPP.iOS.content/Xamarin.Forms.Core.dll [External]
2021-08-27 18:39:24.404 Xamarin.PreBuilt.iOS[4330:1030624] Xamarin.iOS: Unable to locate assembly 'FFImageLoading' (culture: '')
2021-08-27 18:39:24.404 Xamarin.PreBuilt.iOS[4330:1030624] Xamarin.iOS: Unable to locate assembly 'FFImageLoading' (culture: '')
Loaded assembly: /private/var/mobile/Containers/Data/Application/6FE32CF0-AE4D-41A2-BBBA-EAD56133AA7E/Documents/SHAPP.iOS.content/FFImageLoading.Platform.dll [External]
....
[0:] Failed to force load assembly /var/mobile/Containers/Data/Application/6FE32CF0-AE4D-41A2-BBBA-EAD56133AA7E/Documents/SHAPP.iOS.content/Forms9Patch.dll. Type:Forms9Patch.PopupLayerEffect. Exception: 'You must call Xamarin.Forms.Forms.Init(); prior to using this property.'. Callstack: ' at Xamarin.Forms.Device.get_PlatformServices () [0x00007] in D:\a\1\s\Xamarin.Forms.Core\Device.cs:87
at Xamarin.Forms.Device.GetAssemblies () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Device.cs:245
at Xamarin.Forms.DependencyService.Initialize () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\DependencyService.cs:103
at Xamarin.Forms.DependencyService.Get[T] (Xamarin.Forms.DependencyFetchTarget fetchTarget) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\DependencyService.cs:28
at Forms9Patch.Settings.ConfirmInitialization () [0x00008] in C:\Users\ben\Development\Xamarin\Forms9Patch\Forms9Patch\Forms9Patch\Models\Settings.cs:116
at Forms9Patch.PopupLayerEffect..cctor () [0x00000] in C:\Users\ben\Development\Xamarin\Forms9Patch\Forms9Patch\Forms9Patch\Effects\PopupLayerEffect.cs:19 '
...
[0:] An error occurred: 'Could not create an native instance of the type 'Airbnb.Lottie.LOTAnimationView': the native class hasn't been loaded.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.'. Callstack: ' at Foundation.NSObject.InitializeObject (System.Boolean alloced) [0x0002e] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSObject2.cs:247
at Foundation.NSObject..ctor (Foundation.NSObjectFlag x) [0x0000d] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSObject2.cs:147
at UIKit.UIResponder..ctor (Foundation.NSObjectFlag t) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/UIKit/UIResponder.g.cs:74
at UIKit.UIView..ctor (Foundation.NSObjectFlag t) [0x00000] in
...
--- End of stack trace from previous location where exception was thrown ---
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:65
at SHAPP.iOS.Application.Main (System.String[] args) [0x00001] in C:\VisualCSharp\MyProjects\SHAPP\SHAPP.iOS\Main.cs:17
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 '
Die App wurde beendet.
Thanks Jason and Saamer,
as you wrote i did try to fix that error prior to my request. But I could not find a way.
My AppDelegate looks like that:
using Foundation;
using Lottie.Forms.Platforms.Ios;
using UIKit;
namespace SHAPP.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
Xamarin.Forms.Forms.Init();
Forms9Patch.iOS.Settings.Initialize(this);
FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
ZXing.Net.Mobile.Forms.iOS.Platform.Init();
// ObjCRuntime.Class.ThrowOnInitFailure = false;
LoadApplication(new App());
//AnimationViewRenderer.Init();
return base.FinishedLaunching(app, options);
}
}
}
So nothing to special, I did even try to set the old Lottie Init, but it did not help. As well I tryed to cancel all nuget Lottiefiles in iOS and to reinstall them, afterwards I cleaned the projects and restartet the build, same error.
Only working thing is to completly cancel Lottieusage.
The Lottie-XAML I use look's like that:
<lottie:AnimationView
Animation="14525-plumbers.json"
AutoPlay="True"
RepeatCount="3"
RepeatMode="Restart"
CacheComposition="True"
HeightRequest="500"
VerticalOptions="Start"
HorizontalOptions="Center"
IsVisible="true"
/>
If I comment it out everything works fine.
The LottieAnimationfile is in my RessourcesFolder (BundledRessource) as well as in the main folder.
Folders iOS and LottieFiles
Gentlement any ideas, what could be wrong? Thanks in advance
As Jason mentioned, you need to add that line in the AppDelegate, as you can see in this example
But you have another error too as you can read the error message at the end of the StackTrace you shared:
An error occurred: 'Could not create an native instance of the type 'Airbnb.Lottie.LOTAnimationView': the native class hasn't been loaded.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.'. Callstack: ' at Foundation.NSObject.InitializeObject (System.Boolean alloced) [0x0002e] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSObject2.cs:247
at Foundation.NSObject..ctor (Foundation.NSObjectFlag x) [0x0000d] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSObject2.cs:147
What Lottie package are you using? Is it this one? Are you using the latest version?
You have to make sure that you add the iOS version of the Lottie package to the iOS project.

How to establish a connection between HoloLens and a MQTT broker?

I'm very new to HoloLens development. Therefore please excuse me if this is an amateur question. I'm currently working transmitting hand gestures detections of the HoloLens to an external MQTT broker.
My use-case it, when I detect a hand tap(from HoloLens), I need to send(publish) a message to a subscribed topic in an MQTT broker.
I found this example on GitHub (https://github.com/gpvigano/M2MqttUnity). This publishes the message yet do not receive any messages. I'm getting the following error.
Connected to iot.eclipse.org:1883...
(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)
Test message published
(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)
'M2MqttUnity.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\M2MqttUnityVS.Release_x86.per287\System.Diagnostics.StackTrace.dll'. Cannot find or open the PDB file.
Exception thrown: 'System.InvalidOperationException' in Assembly-CSharp.dll
Exception thrown: 'uPLibrary.Networking.M2Mqtt.Exceptions.MqttCommunicationException' in Assembly-CSharp.dll
Exception thrown: 'System.AggregateException' in System.Private.CoreLib.ni.dll
The thread 0x13b8 has exited with code 0 (0x0).
The thread 0xfdc has exited with code 0 (0x0).
The thread 0x700 has exited with code 0 (0x0).
The thread 0x179c has exited with code 0 (0x0).
Exception thrown: 'uPLibrary.Networking.M2Mqtt.Exceptions.MqttCommunicationException' in Assembly-CSharp.dll
Failed to connect to iot.eclipse.org:1883:
uPLibrary.Networking.M2Mqtt.Exceptions.MqttCommunicationException: Exception of type 'uPLibrary.Networking.M2Mqtt.Exceptions.MqttCommunicationException' was thrown.
at uPLibrary.Networking.M2Mqtt.MqttClient.SendReceive(Byte[] msgBytes, Int32 timeout)
at uPLibrary.Networking.M2Mqtt.MqttClient.SendReceive(MqttMsgBase msg, Int32 timeout)
at uPLibrary.Networking.M2Mqtt.MqttClient.Connect(String clientId, String username, String password, Boolean willRetain, Byte willQosLevel, Boolean willFlag, String willTopic, String willMessage, Boolean cleanSession, UInt16 keepAlivePeriod)
at M2MqttUnity.M2MqttUnityClient.d__38.MoveNext()
(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)
Anyone tried this before repository before or any idea about what this error is?

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.

How to properly use mciSendString

I play an MP3 sound using the following mciSendString
mciSendString("play \"mysound.mp3\"", NULL, 0, 0);
The above works just fine. But from what I've seen around the web, people use all kinds of wrappers for the above code. Some first send open command then play, then wait for notification, then send close command, they also use aliases for files etc.
My question is - is all this necessary? My primary interest is just to play a file and do it in async manner. The above command appears to do all the cleanup so my question is - is it really required to use open or close command and notifications when the sound has been played to properly release memory and deallocate sound and is there an advantage to doing so.
From what I can see in the debugger it appears that on execution of above command the system loads required DLLs, then starts some threads and as soon as the playback ends, the threads exit and the DLLs are unloaded. So my guess is that open/close are optional because the system does all the allocation/deallocation automatically, but I may be wrong. Am I leaking some memory or resources if I just call the above line and nothing else?
Here is what the debug log shows - all I can conclude from this log that the thread is closed and that the the DLL files are unloaded:
Module Load: MCIQTZ32.dll. No Debug Info. Base Address: $61D80000. Process Project1.exe (368)
Thread Start: Thread ID: 492. Process Project1.exe (368)
Module Load: SETUPAPI.dll. No Debug Info. Base Address: $77920000. Process Project1.exe (368)
Module Unload: SETUPAPI.dll. Process Project1.exe (368)
Thread Start: Thread ID: 1344. Process Project1.exe (368)
Thread Start: Thread ID: 640. Process Project1.exe (368)
Thread Exit: Thread ID: 1344. Process Project1.exe (368)
Thread Exit: Thread ID: 640. Process Project1.exe (368)
Thread Start: Thread ID: 468. Process Project1.exe (368)
Thread Start: Thread ID: 1120. Process Project1.exe (368)
Module Load: SETUPAPI.dll. No Debug Info. Base Address: $77920000. Process Project1.exe (368)
Module Unload: SETUPAPI.dll. Process Project1.exe (368)
Thread Start: Thread ID: 1692. Process Project1.exe (368)
Thread Start: Thread ID: 1384. Process Project1.exe (368)
Thread Start: Thread ID: 204. Process Project1.exe (368)
Thread Start: Thread ID: 1572. Process Project1.exe (368)
Thread Exit: Thread ID: 1692. Process Project1.exe (368)
Thread Exit: Thread ID: 1384. Process Project1.exe (368)
Thread Exit: Thread ID: 1572. Process Project1.exe (368)
Thread Exit: Thread ID: 204. Process Project1.exe (368)
Thread Exit: Thread ID: 1120. Process Project1.exe (368)
Thread Exit: Thread ID: 468. Process Project1.exe (368)
Module Unload: MCIQTZ32.dll. Process Project1.exe (368)
Thread Exit: Thread ID: 492. Process Project1.exe (368)
I found the answer elsewhere so I'm sharing it.
It appears that the play command by itself is perfectly valid.
So here are a couple of ways to call this:
// (a)
mciSendString("open waveaudio!MyFile.wav alias MyFile",NULL,0,0);
mciSendString("play MyFile wait",NULL,0,0);
mciSendString("close MyFile",NULL,0,0);
// (b)
mciSendString("open MyFile.wav alias MyFile",NULL,0,0);
mciSendString("play MyFile wait",NULL,0,0);
mciSendString("close MyFile",NULL,0,0);
// (c)
mciSendString("play MyFile.wav wait",NULL,0,0); // no open or alias used
Answer found on MSDN Forums.
Once important thing worth noting is thatmciSendString will fail miserably if you supply it with filename with spaces in the path (e.g. C:\Program Files...). Even if you enclose this into quotes it won't help. The solution is to use GetShortPathName Windows function to get a DOS-like path from NTFS path name and which doesn't have spaces in it.

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

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.

Resources