At NS we're experiencing occasional Internal Server Errors during the build when publishing features, causing the build to fail. Investigating the event log on the machine hosting the Augurk instance reveals the following exception:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 3/21/2016 10:40:13 AM
Event time (UTC): 3/21/2016 10:40:13 AM
Event ID: 9f20d05504954a63ab2126d85d90a3cc
Event sequence: 2
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1273337584/ROOT-34-131030304046816584
Trust level: Full
Application Virtual Path: /
Application Path: E:\sitesroot\0\
Machine name: RD000D3A22E383
Process information:
Process ID: 6360
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: TargetInvocationException
Exception message: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Owin.Loader.DefaultLoader.<>c__DisplayClass1.<LoadImplementation>b__0(IAppBuilder builder)
at Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
One or more errors occurred.
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Raven.Database.Indexing.DefaultBackgroundTaskExecuter.ExecuteAllInterleaved[T](WorkContext context, IList`1 result, Action`1 action)
at Raven.Database.Indexing.IndexStorage..ctor(IndexDefinitionStorage indexDefinitionStorage, InMemoryRavenConfiguration configuration, DocumentDatabase documentDatabase)
at Raven.Database.DocumentDatabase.DocumentDatabaseInitializer.InitializeIndexStorage()
at Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configuration, TransportState recievedTransportState)
at Raven.Database.Server.RavenDBOptions..ctor(InMemoryRavenConfiguration configuration, DocumentDatabase db)
at Raven.Database.Server.OwinHttpServer..ctor(InMemoryRavenConfiguration config, DocumentDatabase db, Boolean useHttpServer, Action`1 configure)
at Raven.Server.RavenDbServer.Initialize(Action`1 configure)
at Raven.Database.Client.EmbeddedDocumentStore.Initialize()
at Raven.Client.Embedded.EmbeddableDocumentStore.Initialize()
at Augurk.Api.Startup.InitializeRavenDB()
at Augurk.Api.Startup.Configuration(IAppBuilder app)
Could not reset index Features/ByTitleProductAndGroup
at Raven.Database.Indexing.IndexStorage.TryResettingIndex(String indexName, IndexDefinition indexDefinition)
at Raven.Database.Indexing.IndexStorage.OpenIndexOnStartup(String indexName)
at System.Threading.Tasks.Task.Execute()
The following processes are locking E:\sitesroot\0\App_Data\FeatureStore\Indexes\2\write.lock
w3wp 6360
at Raven.Database.Extensions.IOExtensions.TryHandlingError(String directory, Int32 i, Exception e)
at Raven.Database.Extensions.IOExtensions.DeleteDirectory(String directory)
at Raven.Database.Indexing.IndexStorage.TryResettingIndex(String indexName, IndexDefinition indexDefinition)
Request information:
Request URL: http://spoorplaza.cloudapp.net/Content/select.css
Request path: /Content/select.css
User host address: 145.222.61.13
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 12
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Owin.Loader.DefaultLoader.<>c__DisplayClass1.<LoadImplementation>b__0(IAppBuilder builder)
at Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
Custom event details:
It seems that the Raven database is locked by another process, but according to the error message it is locked by the same process ID as the process ID causing the exception. Any thoughts?