I am running the MVC website on Windows Azure and using the built-in RavenDB. If the website is cold (unloaded from an Azure instance), I get the following error message when I first get to the website:
Server error in application "/".
Log file write failure
Description: An unhandled exception occurred during the execution of the current web request. View the stack trace for error information and where it originated in the code.
Exception Details: Microsoft.Isam.Esent.Interop.EsentLogWriteFailException: Failed to write to the log file
Source Error:
An unhandled exception was thrown during the execution of the current web request. Information about the origin and location of the exception can be identified using the exception stack trace below.
Stack trace:
[EsentLogWriteFailException: write to log file failed]
Microsoft.Isam.Esent.Interop.Api.Check (Int32 err) +21
Microsoft.Isam.Esent.Interop.Api.JetInit (JET_INSTANCE & instance) +23
Raven.Storage.Esent.TransactionalStorage.Initialize (IUuidGenerator uuidGenerator, OrderedPartCollection`1 documentCodecs) +309
[InvalidOperationException: Failed to open transactional store: C: \ DWASFiles \ Sites \ reflix \ VirtualDirectory0 \ site \ Wwwroot \ App_Data \ Data] Raven.Storage.Esent.TransactionalStorage.Initialize (IUuidGenerator uuidGenerator, OrderedPartCollection1)
Raven.Database.DocumentDatabase..ctor (InMemoryRavenConfiguration configuration) +994
Raven.Client.Embedded.EmbeddableDocumentStore.InitializeInternal () +313 Raven.Client.Document.DocumentStore.Initialize () +463 Reflix.MvcApplication.InitializeRavenDB (String dataDirectory, Boolean rethrowException) +135pplixix
[HttpException (0x80004005): Could not open transactional storage: C: \ DWASFiles \ Sites \ reflix \ VirtualDirectory0 \ site \ Wwwroot \ App_Data \ Data] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode (HttpCon9pp1 context, application
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS (IntPtr appContext, HttpContext context, MethodInfo [] +118 handlers
System.Web.HttpApplication.InitSpecial (HttpApplicationState state, MethodInfo [] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance (IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication (IntPtr appContext) +296
[HttpException (0x80004005): Could not open transactional storage: C: \ DWASFiles \ Sites \ reflix \ VirtualDirectory0 \ site \ Wwwroot \ App_Data \ Data] System.Web.HttpRuntime.FirstRequestInit (HttpContext context) +9873784 System.WebHtt. EnsureFirstRequestInit (HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate (IIS7WorkerRequest wr, HttpContext context) +254
Version Information: Microsoft.NET Framework Version: 4.0.30319; ASP.NET Version: 4.0.30319.18033
If I wait a minute or two, the website fits perfectly. So it is clear that this is a matter of first launch. Anyone have any ideas how to solve the problem?