Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • MuirisOG 382 posts 1284 karma points
    Jul 18, 2017 @ 14:42
    MuirisOG
    0

    Hi everyone

    I have a number of sites ready to go live and I'm trying to get rid of the last remaining stumbling blocks.

    They are all sitting in one instance of Umbraco.

    My problem is that every time I launch a site for the first time, I get a YSOD caused by a write.lock. Refreshing the screen gets rid of the error.

    I'm worried I'll get this error if the any of the sites reload.

    If I switch Examine off in the config file, will it stop the search facility in the BackOffice?

    See the error message below:

    Server Error in '/' Application.
    
    The process cannot access the file 'c:\mysite\App_Data\TEMP\ExamineIndexes\Internal\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:\mysite\App_Data\TEMP\ExamineIndexes\Internal\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:\mysite\App_Data\TEMP\ExamineIndexes\Internal\Index\write.lock' because it is being used by another process.]
       System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +10769637
       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) +1305
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) +66
       Lucene.Net.Store.NativeFSLock.Obtain() +520
    
    [LockObtainFailedException: Lock obtain timed out: NativeFSLock@c:\mysite\App_Data\TEMP\ExamineIndexes\Internal\Index\write.lock: System.IO.IOException: The process cannot access the file 'c:\mysite\App_Data\TEMP\ExamineIndexes\Internal\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) +576
       Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create, Boolean closeDir, IndexDeletionPolicy deletionPolicy, Boolean autoCommit, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit) +177
       Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, Boolean create, MaxFieldLength mfl) +402
       Examine.LuceneEngine.Providers.LuceneIndexer.WriterFactory(Directory d) in X:\Projects\Examine\Examine\src\Examine\LuceneEngine\Providers\LuceneIndexer.cs:1867
       Examine.LuceneEngine.<>c__DisplayClass7_0.<GetWriter>b__0(String s) in X:\Projects\Examine\Examine\src\Examine\LuceneEngine\WriterTracker.cs:44
       System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +72
       Examine.LuceneEngine.WriterTracker.GetWriter(Directory dir, Func`2 factory) in X:\Projects\Examine\Examine\src\Examine\LuceneEngine\WriterTracker.cs:44
       Examine.LuceneEngine.Providers.LuceneIndexer.CreateIndexWriter() in X:\Projects\Examine\Examine\src\Examine\LuceneEngine\Providers\LuceneIndexer.cs:1832
       UmbracoExamine.BaseUmbracoIndexer.CreateIndexWriter() +128
       Examine.LuceneEngine.Providers.LuceneIndexer.EnsureIndex(Boolean forceOverwrite) in X:\Projects\Examine\Examine\src\Examine\LuceneEngine\Providers\LuceneIndexer.cs:661
       Examine.LuceneEngine.Providers.LuceneIndexer.RebuildIndex() in X:\Projects\Examine\Examine\src\Examine\LuceneEngine\Providers\LuceneIndexer.cs:749
       UmbracoExamine.UmbracoContentIndexer.RebuildIndex() +53
       Umbraco.Web.WebBootManager.<InitializeResolvers>b__f() +113
       Umbraco.Core.Sync.DatabaseServerMessenger.Initialize() +593
       Umbraco.Core.Sync.DatabaseServerMessenger.Boot() +87
       Umbraco.Web.BatchedDatabaseServerMessenger.Startup() +185
       Umbraco.Web.BatchedDatabaseServerMessengerStartup.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +63
       Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +37
       Umbraco.Core.CoreBootManager.<Complete>b__a(IApplicationEventHandler x) +219
       Umbraco.Core.EnumerableExtensions.ForEach(IEnumerable`1 items, Action`1 action) +141
       Umbraco.Core.CoreBootManager.Complete(Action`1 afterComplete) +276
       Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) +114
       Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) +297
       Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e) +34
    
    [HttpException (0x80004005): Lock obtain timed out: NativeFSLock@c:\mysite\App_Data\TEMP\ExamineIndexes\Internal\Index\write.lock: System.IO.IOException: The process cannot access the file 'c:\mysite\App_Data\TEMP\ExamineIndexes\Internal\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) +9934477
       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) +336
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
    
    [HttpException (0x80004005): Lock obtain timed out: NativeFSLock@c:\mysite\App_Data\TEMP\ExamineIndexes\Internal\Index\write.lock: System.IO.IOException: The process cannot access the file 'c:\mysite\App_Data\TEMP\ExamineIndexes\Internal\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) +9948312
       System.Web.HttpRuntime.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.36366
    
  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Jul 18, 2017 @ 15:08
    Nicholas Westby
    0

    Try setting RebuildOnAppStart="false" in ExamineSettings.config: https://our.umbraco.org/documentation/reference/config/examinesettings/

    By the way, which version of Umbraco are you using?

  • MuirisOG 382 posts 1284 karma points
    Jul 18, 2017 @ 16:18
    MuirisOG
    0

    Nicholas

    I'm using v7.5.14.

    You'll see various posts here with different version numbers.

    Whilst building our site in Umbraco, I've kept pace with Umbraco development in an attempt to finally go 'live' with the latest version and still keep our legacy webforms code.

    I did try to get to v7.6.3 but it was a step too far for webforms, so went back to v7.5.14

    Phase II will be to get off webforms and onto MVC.

    And thanks for all your help - it really is very much appreciated.

    Muiris

  • MuirisOG 382 posts 1284 karma points
    Jul 26, 2017 @ 11:44
    MuirisOG
    1

    This problem was entirely down to the way I set up my sites in IIS.

    I have created a class library for my own backoffice apps and put all my sites into one IIS site running with multiple host headers.

    The incorrect set up meant that the site was reloading for each site and was competing for resources.

Please Sign in or register to post replies

Write your reply to:

Draft