Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
EsentTempPathInUseException - How to avoid?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  23 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
BAM  
View profile  
 More options Feb 27 2012, 2:13 pm
From: BAM <b...@bryanvt.net>
Date: Mon, 27 Feb 2012 11:13:00 -0800 (PST)
Subject: EsentTempPathInUseException - How to avoid?
Hello,

I recently started to move a web app I’ve been developing locally into
our network development environment. As part of that process I’ve set
up Raven as an IIS application. When running against the IIS instance
I'm intermittently seeing the exception mentioned in the subject line.
One of my unit tests consistently sees the error.

The test is fairly straightforward:
 1. Open session
   a. Query for specific object
   b. Assert object is null

 2. Call an action on a controller which creates and persists the
object.

 3. Open a new session
   a. Query for specific object
   b. Assert object is not null

Sessions for 1 and 3 are each in a using block. Session for 2 is
managed within the application's controller.

The test passes when connecting to my local instance of Raven.

If I run the test connecting to the IIS Raven it errors out at 3.a
with the following error.

[EsentTempPathInUseException: Temp path already used by another
database instance]
   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&amp;
instance) in C:\Work\ravendb\SharedLibs\Sources
\managedesent-61618\EsentInterop\Api.cs:131
   Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator
uuidGenerator) in c:\Builds\raven\Raven.Storage.Esent
\TransactionalStorage.cs:207

[InvalidOperationException: Could not open transactional storage: C:
\inetpub\wwwroot\Raven\Data\Data]
   Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator
uuidGenerator) in c:\Builds\raven\Raven.Storage.Esent
\TransactionalStorage.cs:220
   Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration
configuration) in c:\Builds\raven\Raven.Database\DocumentDatabase.cs:
152
   Raven.Web.ForwardToRavenRespondersFactory.Init() in c:\Builds\raven
\Raven.Web\ForwardToRavenRespondersFactory.cs:79
   Raven.Web.RavenDbStartupAndShutdownModule.&lt;Init&gt;b__0(Object
sender, EventArgs args) in c:\Builds\raven\Raven.Web\BootStrapper.cs:
13

System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep .Execute()
+148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean&amp; completedSynchronously) +75

If I debug/step through the test connecting to IIS Raven it passes.

I'm using build 616.

Am I doing something wrong?

Thanks in advance.

B.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Feb 27 2012, 4:09 pm
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Mon, 27 Feb 2012 23:09:05 +0200
Local: Mon, Feb 27 2012 4:09 pm
Subject: Re: [RavenDB] EsentTempPathInUseException - How to avoid?

Do you have any way of reproducing it?
Are you calling to a tenant database or to the master one?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Feb 27 2012, 4:26 pm
From: BAM <b...@bryanvt.net>
Date: Mon, 27 Feb 2012 13:26:33 -0800 (PST)
Local: Mon, Feb 27 2012 4:26 pm
Subject: Re: EsentTempPathInUseException - How to avoid?
Running the unit test I described above reliably reproduces it. Calls
involved there are to a tenant database.

Running the application against IIS Raven I see the error
sporadically. (FYI - All calls the application makes are to tenant
DBs.)

I never saw this error while working against a local Raven instance
using Raven.Server.exe.

On Feb 27, 4:09 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Feb 27 2012, 4:29 pm
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Mon, 27 Feb 2012 23:29:05 +0200
Local: Mon, Feb 27 2012 4:29 pm
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

Can you actually send us the code to generate this error?
The description you had allows for a lot of variations, which can be pretty
important.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Feb 28 2012, 9:51 am
From: BAM <b...@bryanvt.net>
Date: Tue, 28 Feb 2012 06:51:11 -0800 (PST)
Local: Tues, Feb 28 2012 9:51 am
Subject: Re: EsentTempPathInUseException - How to avoid?
Understood.

I don't want to send my entire application.

Will try to find some time to create a pared down version and see what
the results are.

Thanks,

B.

On Feb 27, 4:29 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Feb 28 2012, 9:52 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Tue, 28 Feb 2012 16:52:50 +0200
Local: Tues, Feb 28 2012 9:52 am
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

Thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Feb 28 2012, 4:33 pm
From: BAM <b...@bryanvt.net>
Date: Tue, 28 Feb 2012 13:33:42 -0800 (PST)
Local: Tues, Feb 28 2012 4:33 pm
Subject: Re: EsentTempPathInUseException - How to avoid?
https://github.com/bryanvt/EsentTempPathInUseException

You will probably need to run the test twice. There's a problem where
an invoke thinks the method is null the first time through. I'll need
to figure that one out...

On Feb 28, 9:52 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Feb 28 2012, 6:54 pm
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Wed, 29 Feb 2012 01:54:53 +0200
Local: Tues, Feb 28 2012 6:54 pm
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

Hi,
How am I supposed to be running this?
I tried running the test, but it failed ( I run it 3 - 4 times, just to be
sure):

Test
'Tests.TrmAdmin_CharacterizationControllerFixture.save_characterization_tes t'
failed: System.Reflection.TargetInvocationException : Exception has been
thrown by the target of an invocation.
  ----> System.NullReferenceException : Object reference not set to an
instance of an object.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method,
Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes
methodAttributes, RuntimeType typeOwner)
 at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method,
Object target, Object[] arguments, Signature sig, MethodAttributes
methodAttributes, RuntimeType typeOwner)
 at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
Boolean skipVisibilityChecks)
 at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
 Config.cs(155,0): at
Tests.Config.RavenControllerOnActionExecuting(RavenController controller)
TrmAdmin_CharacterizationControllerFixture.cs(52,0): at
Tests.TrmAdmin_CharacterizationControllerFixture.save_characterization_test ()
 --NullReferenceException
at Temp.TrmAppHelper.GetRequestedDb(RouteValueDictionary
routeValueDictionary)
 at Temp.TrmAppHelper.GetCoreData(ControllerContext context)
at
Temp.Controllers.RavenController.OnActionExecuting(ActionExecutingContext
filterContext)

0 passed, 1 failed, 0 skipped, took 1.48 seconds (NUnit 2.5.10).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Feb 28 2012, 7:14 pm
From: BAM <b...@bryanvt.net>
Date: Tue, 28 Feb 2012 16:14:50 -0800 (PST)
Local: Tues, Feb 28 2012 7:14 pm
Subject: Re: EsentTempPathInUseException - How to avoid?

Odd. I get sometimes get that error but only once at the most. Let me
see if I can tweak a workaround for you.

Sorry.

On Feb 28, 6:54 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Feb 29 2012, 10:35 am
From: BAM <b...@bryanvt.net>
Date: Wed, 29 Feb 2012 07:35:23 -0800 (PST)
Local: Wed, Feb 29 2012 10:35 am
Subject: Re: EsentTempPathInUseException - How to avoid?
Oren,

First my apologies. I was going through the code I'd provided you. I
realized there was just too much going on. I need to re-factor and
simplify things. Then I'll see whether the error occurs any more.

That was one conclusion I came to. I also began to be more convinced
that the Esent error is caused, at root, by something I'm doing or not
in my code. The thing is I'm not sure what sort of thing I'm looking
for. So a couple questions:

 1. What is your hunch about what might cause that error to occur?
e.g. Nested OpenSession calls (not that I think I'm doing that), or
some other bad thing?
 2. When I go into Raven studio there are no log entries. Do I need to
do something to enable logging?

Again sorry to have brought you along on my snipe hunt.

B.

On Feb 28, 6:54 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Feb 29 2012, 10:36 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Wed, 29 Feb 2012 17:36:34 +0200
Local: Wed, Feb 29 2012 10:36 am
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

The most likely cause is that you are trying to open EmbeddedDocumentStore
more than once.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Feb 29 2012, 11:01 am
From: BAM <b...@bryanvt.net>
Date: Wed, 29 Feb 2012 08:01:32 -0800 (PST)
Local: Wed, Feb 29 2012 11:01 am
Subject: Re: EsentTempPathInUseException - How to avoid?
Thanks. That's not impossible in the test units. I've seen the error
when running the app as well, and it is not using embedded.

What would be the most likely cause that doesn't involve embedded?

On Feb 29, 10:36 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Feb 29 2012, 11:42 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Wed, 29 Feb 2012 18:42:07 +0200
Local: Wed, Feb 29 2012 11:42 am
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

How are you running RavenDB outside of unit tests?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Mar 2 2012, 1:39 pm
From: BAM <b...@bryanvt.net>
Date: Fri, 2 Mar 2012 10:39:40 -0800 (PST)
Local: Fri, Mar 2 2012 1:39 pm
Subject: Re: EsentTempPathInUseException - How to avoid?
It's a multi-tenant application that connects to an IIS instance of
RavenDB. The IIS server is a development box within our network. I
have never had a problem establishing the connection.

DocumentStore instantiating code follows:

        public static IDocumentStore GetDocumentStore(IContext
context)
        {
            lock (typeof(MvcApplication))
            {
                if (_documentStore == null)
                {
                    _documentStore = new DocumentStore
{ ConnectionStringName = "RavenDB" };
                    _documentStore.Conventions.IdentityPartsSeparator
= "-";
                    _documentStore.Initialize();
                }
            }

            return _documentStore;
        }

Does that answer your question?

The error is intermittent and not predictable.

On Feb 29, 11:42 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Mar 2 2012, 3:08 pm
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Fri, 2 Mar 2012 22:08:40 +0200
Local: Fri, Mar 2 2012 3:08 pm
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

Did you modify the indexpath or logspath?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Mar 2 2012, 4:06 pm
From: BAM <b...@bryanvt.net>
Date: Fri, 2 Mar 2012 13:06:37 -0800 (PST)
Local: Fri, Mar 2 2012 4:06 pm
Subject: Re: EsentTempPathInUseException - How to avoid?
The config settings? No. This is copied straight from the server:

<configuration>
        <appSettings>
                <add key="Raven/DataDir" value="~\Data"/>
                <add key="Raven/AnonymousAccess" value="All"/>
        </appSettings>
        <system.webServer>
                <handlers>
                        <add name="All" path="*" verb="*"
type="Raven.Web.ForwardToRavenRespondersFactory, Raven.Web"/>
                </handlers>
                <modules runAllManagedModulesForAllRequests="true">
                        <remove name="WebDAVModule" />
                </modules>
        </system.webServer>
        <runtime>
                <loadFromRemoteSources enabled="true"/>
                <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
                        <probing privatePath="Analyzers"/>
                </assemblyBinding>
        </runtime>
          <system.web>
            <customErrors mode="Off">
            </customErrors>
          </system.web>
</configuration>

On Mar 2, 3:08 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Mar 4 2012, 5:57 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Sun, 4 Mar 2012 12:57:38 +0200
Local: Sun, Mar 4 2012 5:57 am
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

Hm,
No idea then. If you can find a way to reproduce this, I would be most
grateful.
I went over the code a couple of times, and it looks fine.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Mar 4 2012, 8:27 am
From: BAM <b...@bryanvt.net>
Date: Sun, 4 Mar 2012 05:27:20 -0800 (PST)
Local: Sun, Mar 4 2012 8:27 am
Subject: Re: EsentTempPathInUseException - How to avoid?

Thanks. I'm making progress toward a more targeted test. I'll let you
know when I think it's worth sharing.

It does _seem_ to be connected with scenarios where several sessions
are rapidly open and closed. As in the test I initially described.

On Mar 4, 5:57 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Chaliy  
View profile  
 More options Mar 4 2012, 4:48 pm
From: Mike Chaliy <m...@chaliy.name>
Date: Sun, 4 Mar 2012 13:48:54 -0800 (PST)
Local: Sun, Mar 4 2012 4:48 pm
Subject: Re: EsentTempPathInUseException - How to avoid?
Just an idea.
When IIS recycles app pool it does not kill previous worker process
before new worker process is created.
It seems that for some time there are two phisical processes that
access to the same database directory.
You can disable this by Disable Overlapped Recycle in App Pool
Advanced Settings.

On 4 Бер, 12:57, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Mar 5 2012, 3:43 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Mon, 5 Mar 2012 10:43:14 +0200
Local: Mon, Mar 5 2012 3:43 am
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

Haven't thought of that, yes.
That might very well be a reason for that.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Mar 6 2012, 9:03 am
From: BAM <b...@bryanvt.net>
Date: Tue, 6 Mar 2012 06:03:10 -0800 (PST)
Local: Tues, Mar 6 2012 9:03 am
Subject: Re: EsentTempPathInUseException - How to avoid?
Mike,

Thanks for the idea. I've set up an App Pool with overlap disabled. So
far so good. I hesitate to jump to certainty, but it seems like you've
put your finger on the problem.

B.

On Mar 4, 4:48 pm, Mike Chaliy <m...@chaliy.name> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BAM  
View profile  
 More options Mar 8 2012, 11:02 am
From: BAM <b...@bryanvt.net>
Date: Thu, 8 Mar 2012 08:02:53 -0800 (PST)
Local: Thurs, Mar 8 2012 11:02 am
Subject: Re: EsentTempPathInUseException - How to avoid?

All,

Just wanted to close this thread. It's been a couple of days since I
implemented Mike's suggestion. Since that time I have not seen the
error once. I feel confident that pool recycling was the root cause.

On a related note, before changing the recycling setting I regularly
would see errors in Studio. As it recovered after I closed the message
and wasn't affecting my application I did not take the time to
investigate. Since disabling recycling I have seen a significant
reduction (essentially eliminated) in the number of errors.

I would suggest y'all consider adding this as a recommendation for
configuration of IIS in your instructions, at the very least for multi-
tenant situations.

Thanks for all the help.

B.

On Mar 5, 3:43 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oren Eini (Ayende Rahien)  
View profile  
 More options Mar 8 2012, 11:28 am
From: "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
Date: Thu, 8 Mar 2012 18:28:43 +0200
Local: Thurs, Mar 8 2012 11:28 am
Subject: Re: [RavenDB] Re: EsentTempPathInUseException - How to avoid?

BAN, we will, thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »