Developer forum

Forum » Development » Lucene.Net.Store.LockObtainFailedException

Lucene.Net.Store.LockObtainFailedException

Eva
Reply
Hi,
We are seeing a sporadict error. We have already tried to delete the write lock and restart but it still happens sometimes.Can someone help out?
Error executing template "Designs/Brund/_parsed/frontpage.parsed.cshtml"
Lucene.Net.Store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@E:\dynamicweb.net\Solutions\[site]-live\App_Data\temp\Indexes\Cookies\write.lock: System.IO.IOException: The process cannot access the file 'E:\dynamicweb.net\Solutions\[site]-live\App_Data\temp\Indexes\Cookies\write.lock' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at Lucene.Net.Store.NativeFSLock.Obtain() in d:\Lucene.Net\FullRepo\trunk\src\core\Store\NativeFSLockFactory.cs:line 240 ---> System.IO.IOException: The process cannot access the file 'E:\dynamicweb.net\Solutions\[site]-live\App_Data\temp\Indexes\Cookies\write.lock' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at Lucene.Net.Store.NativeFSLock.Obtain() in d:\Lucene.Net\FullRepo\trunk\src\core\Store\NativeFSLockFactory.cs:line 240
   --- End of inner exception stack trace ---
   at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout) in d:\Lucene.Net\FullRepo\trunk\src\core\Store\Lock.cs:line 97
   at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create, IndexDeletionPolicy deletionPolicy, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\IndexWriter.cs:line 1228
   at Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, MaxFieldLength mfl) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\IndexWriter.cs:line 174
   at NoZebra.DW.ItpCookies.IndexHandler..ctor() in C:\WORK\NoZebra\S_DW_[site]\NoZebra.DW.ItpCookies\IndexHandler.cs:line 34
   at NoZebra.DW.ItpCookies.IndexHandler.<>c.<.cctor>b__10_0() in C:\WORK\NoZebra\S_DW_[site]\NoZebra.DW.ItpCookies\IndexHandler.cs:line 22
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at NoZebra.DW.ItpCookies.ViewHandler.SetCookies() in C:\WORK\NoZebra\S_DW_[site]\NoZebra.DW.ItpCookies\ViewHandler.cs:line 35
   at CompiledRazorTemplates.Dynamic.RazorEngine_de320f77d2674b9ba691be50f7fcf995.Execute() in E:\dynamicweb.net\Solutions\[site]-live\Files\Templates\Designs\Brund\_parsed\frontpage.parsed.cshtml:line 107
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Eva

I can see that this happens out of something that looks custom - 

NoZebra.DW.ItpCookies

The index looks like a cookie index which is not a thing that ships with Dynamicweb.

So my guess is that you should talk to the developer who made this - and maybe show us the code. It seems like the code is trying to add things to the index from a template - could be a little problematic if concurrency is not taken into consideration.

BR Nicolai

Votes for this answer: 1
 
Eva Sommer
Reply

Hi Nicolai,

Thank you for your fast reply. We will have a developer look into this :)

- Eva

 

You must be logged in to post in the forum