U4-7621 - Examine Having Issues Locking Write.lock File for Member Index

Created by Nicholas Westby 30 Dec 2015, 01:26:29 Updated by Ryan Lewis 08 Aug 2017, 14:53:34

A few days ago, I got this error while developing a website locally:

!lock-error.png!

For the search engines, here is the text content of that error message:

Server Error in '/' Application.

The process cannot access the file 'C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\write.lock' because it is being used by another process.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.IOException: The process cannot access the file 'C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\write.lock' because it is being used by another process.

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:

[IOException: The process cannot access the file 'C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\write.lock' because it is being used by another process.] System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +216 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) +1326 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) +66 Lucene.Net.Store.NativeFSLock.Obtain() +482

[LockObtainFailedException: Lock obtain timed out: NativeFSLock@C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\write.lock: System.IO.IOException: The process cannot access the file 'C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\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()] Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout) +548 Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create, Boolean closeDir, IndexDeletionPolicy deletionPolicy, Boolean autoCommit, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit) +176 Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, Boolean create, MaxFieldLength mfl) +424 Examine.LuceneEngine.Providers.LuceneIndexer.CreateIndexWriter() in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:1664 UmbracoExamine.BaseUmbracoIndexer.CreateIndexWriter() +149 Examine.LuceneEngine.Providers.LuceneIndexer.EnsureIndex(Boolean forceOverwrite) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:684 Examine.LuceneEngine.Providers.LuceneIndexer.RebuildIndex() in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:772 UmbracoExamine.BaseUmbracoIndexer.RebuildIndex() +36 UmbracoExamine.UmbracoContentIndexer.RebuildIndex() +57 Examine.ExamineManager._RebuildIndex() in x:\Projects\Examine\Examine\Projects\Examine\ExamineManager.cs:240 Examine.ExamineManager.RebuildIndex() in x:\Projects\Examine\Examine\Projects\Examine\ExamineManager.cs:234 Umbraco.Web.WebBootManager.b__c() +205 Umbraco.Core.Sync.DatabaseServerMessenger.Initialize() +275 Umbraco.Core.Sync.DatabaseServerMessenger.Boot() +117 Umbraco.Web.BatchedDatabaseServerMessenger.Startup() +189 Umbraco.Web.BatchedDatabaseServerMessengerStartup.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +84 Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +49 Umbraco.Core.CoreBootManager.b__8(IApplicationEventHandler x) +144 Umbraco.Core.EnumerableExtensions.ForEach(IEnumerable1 items, Action1 action) +142 Umbraco.Core.CoreBootManager.Complete(Action1 afterComplete) +287 Umbraco.Web.WebBootManager.Complete(Action1 afterComplete) +59 Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) +254 Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e) +44

[HttpException (0x80004005): Lock obtain timed out: NativeFSLock@C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\write.lock: System.IO.IOException: The process cannot access the file 'C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\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()] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9966013 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +352 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Lock obtain timed out: NativeFSLock@C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\write.lock: System.IO.IOException: The process cannot access the file 'C:\r\Redacted\src\Redacted\App_Data\TEMP\ExamineIndexes\WIN-7JU0ANENB0M\InternalMember\Index\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()] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9947380 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0

I took a screenshot for later reference and fixed the error (I forget how... maybe a rebuild), then left the issue alone (though I retained the screenshot). Then, I saw this forum post: https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/73940-umbraco-clean-install-734-problem-with-examine

So it seems I'm not the only person who is having this issue, and it looks like the issue requires manual intervention to resolve.

I thought it better to report this now so that it doesn't become a major issue in a few months when I release the site I'm working on.

By the way, this website is being developed in Visual Studio 2015 on Windows 8.1 (pretty much all the latest updates installed). I installed Umbraco with NuGet, and I have a number of other packages installed, including:

  • Ditto
  • Slimsy
  • Robotnik
  • Document Type Picker
  • uLogs
  • Bookshelf
  • Render Page to File
  • Archetype
  • nuPickers
  • uEditorNotes

Since this is a new website I'm building, there is virtually no content and no members (note that my screenshot shows an issue with the internal member index, which is the same one the other person on the forum was having an issue with). In fact, there may have been no content at the time the error occurred (I can't recall).

2 Attachments

Comments

Nicholas Westby 17 Feb 2016, 07:23:14

FYI, I just came across this again in Umbraco 7.4:

!index-error-2016-02-13.png!


Richard Eyres 17 May 2016, 08:32:16

I have experienced this issue when upgrading a 7.2.8 site to 7.4.3. Worked great locally, but on the live webserver it caused major headaches. Had to rollback and rethink the deployment.


Kim Nedergaard 17 Jun 2016, 10:59:04

I just experienced the same in a clean 7.4.3


Tiago Lucas 12 Jul 2016, 13:58:30

There are some updates on this issue? We have the same problem with write.lock file for Member Index.


Nicklas Gavelin 05 Oct 2016, 08:25:35

We are also experiencing this problem in 7.3.0 on a larger site residing at an external hosting company.

Lucene.Net.Store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@\atm.binero.net\content<hidden>\public_html\App_Data\TEMP\ExamineIndexes\InternalMember\Index\write.lock: System.IO.IOException: The process cannot access the file '\atm.binero.net\content<hidden>\public_html\App_Data\TEMP\ExamineIndexes\InternalMember\Index\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() ---> System.IO.IOException: The process cannot access the file '\atm.binero.net\content<hidden>\public_html\App_Data\TEMP\ExamineIndexes\InternalMember\Index\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()

--- End of inner exception stack trace ---

at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout)

at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create, Boolean closeDir, IndexDeletionPolicy deletionPolicy, Boolean autoCommit, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit)

at Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, Boolean create, MaxFieldLength mfl)

at Examine.LuceneEngine.Providers.LuceneIndexer.CreateIndexWriter()

at UmbracoExamine.BaseUmbracoIndexer.CreateIndexWriter()

at Examine.LuceneEngine.Providers.LuceneIndexer.EnsureIndex(Boolean forceOverwrite)

at Examine.LuceneEngine.Providers.LuceneIndexer.RebuildIndex()

at UmbracoExamine.UmbracoContentIndexer.RebuildIndex()

at Examine.ExamineManager._RebuildIndex()

at Umbraco.Web.WebBootManager.b__c()

at Umbraco.Core.Sync.DatabaseServerMessenger.Initialize()

at Umbraco.Core.Sync.DatabaseServerMessenger.Boot()

at Umbraco.Web.BatchedDatabaseServerMessenger.Startup()

at Umbraco.Web.BatchedDatabaseServerMessengerStartup.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)

at Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)

at Umbraco.Core.CoreBootManager.b__8(IApplicationEventHandler x)


David 05 Oct 2016, 18:15:54

Does anyone have a resolution? I am currently experiencing this after upgrading from 6.1.6 to 7.4.0.


Dan Patching 22 Jun 2017, 14:48:44

Experiencing the same issue on 7.5.13

First suspected AV or a backup process was the culprit, as suggested by @Shandem But Umbraco is running on my local machine, which doesn't get backed up, and only has Windows Defender. On looking at processes in Resource Monitor, I can see only the w3wp.exe process has any Lucene file handles.

For me, this doesn't seem to happen on publish, only when the index is being rebuilt in the Examine dashboard in the back office.


Kim Nedergaard 26 Jun 2017, 07:49:00

I had same problem - but solved it by running Visual Studio as administrator.


Ryan Lewis 08 Aug 2017, 14:53:34

Been experiencing this problem, just limited to Internal member index, despite having no members.


Priority: Normal

Type: Bug

State: Submitted

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.4.0, 7.3.4, 7.4.3, 7.5.13

Due in version:

Sprint:

Story Points:

Cycle: