Cannot access file, the file is locked or in use

Discussion in 'Hosting Services / Control Panel' started by Bflan, Jun 24, 2013.

  1. In my permissions manager, it says I have no users at all. I've search forum posts that say read/write permissions are automatic for anonymous users. I'm using RavenDb in EmbeddedMode and I have not set UseEmbeddedHttpServer = true.

    Here is the stack trace (I xx'd out the directory structure, which is a majore security breach BTW):

    Exception Details: Microsoft.Isam.Esent.Interop.EsentFileAccessDeniedException: Cannot access file, the file is locked or in use

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:


    [EsentFileAccessDeniedException: Cannot access file, the file is locked or in use]
    Microsoft.Isam.Esent.Interop.Api.Check(Int32 err) in C:\Work\ravendb\SharedLibs\Sources\managedesent-61618\EsentInterop\Api.cs:2739
    Microsoft.Isam.Esent.Interop.Api.JetInit(JET_INSTANCE& instance) in C:\Work\ravendb\SharedLibs\Sources\managedesent-61618\EsentInterop\Api.cs:131
    Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator uuidGenerator, OrderedPartCollection`1 documentCodecs) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\TransactionalStorage.cs:366

    [InvalidOperationException: Could not write to location: E:\web\bflannet000\htdocs\App_Data\RavenDb. Make sure you have read/write permissions for this path.]
    Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator uuidGenerator, OrderedPartCollection`1 documentCodecs) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\TransactionalStorage.cs:382
    Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configuration) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:197
    Raven.Client.Embedded.EmbeddableDocumentStore.InitializeInternal() in c:\Builds\RavenDB-Stable\Raven.Client.Embedded\EmbeddableDocumentStore.cs:204
    Raven.Client.Document.DocumentStore.Initialize() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\DocumentStore.cs:423
    bFlan.Infrastructure.ControllersInstaller.Install(IWindsorContainer container, IConfigurationStore store) in C:\projects\bflan\bFlan\Infrastructure\ControllersInstaller.cs:23
    Castle.Windsor.Installer.AssemblyInstaller.Install(IWindsorContainer container, IConfigurationStore store) +142
    Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers, DefaultComponentInstaller scope) +97
    Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers) +90
    bFlan.MvcApplication.BootstrapContainer() in C:\projects\bflan\bFlan\Global.asax.cs:48
    bFlan.MvcApplication.Application_Start() in C:\projects\bflan\bFlan\Global.asax.cs:44

    [HttpException (0x80004005): Could not write to location: xxxxxxxxx\htdocs\App_Data\RavenDb. Make sure you have read/write permissions for this path.]
    System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9171885
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +131
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253

    [HttpException (0x80004005): Could not write to location: xxxxxx\htdocs\App_Data\RavenDb. Make sure you have read/write permissions for this path.]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090988
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Based on the error, it looks like the file is locked by a process.

    I can't tell what is locking it just by looking at the error. I recommend you open a ticket. Please include

    1) Which file is currently being locked?
    2) A way to repro the error.
     

Share This Page