Copied to clipboard

Flag this post as spam?

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


  • webmonger 130 posts 285 karma points
    Feb 18, 2011 @ 18:40
    webmonger
    1

    Examine Index file locking problem when creating a lot of documents

    I'm trying to dynamically create a lot of documents all at once the API seems to been handeling this very well but the ExamineIndex is failing.

    Part way through the creation I recieve this error:

    System.IO.IOException: The process cannot access the file 'UMBRACO_PATH\App_Data\TEMP\ExamineIndexes\Internal\COMPUTER.lck' 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)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
    at System.IO.StreamWriter.CreateFile(String path, Boolean append)
    at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
    at System.IO.StreamWriter..ctor(String path, Boolean append)
    at System.IO.FileInfo.CreateText()
    at Examine.LuceneEngine.SerializableDictionaryExtensions.SaveToDisk[TKey,TValue](SerializableDictionary`2 sd, FileInfo fi)
    at Examine.LuceneEngine.IndexerExecutive.TimestampLck()
    at Examine.LuceneEngine.IndexerExecutive.get_IsExecutiveMachine()
    at Examine.LuceneEngine.Providers.LuceneIndexer.SafelyProcessQueueItems()
    at Examine.LuceneEngine.Providers.LuceneIndexer.AddNodesToIndex(IEnumerable`1 nodes, String type)
    at UmbracoExamine.UmbracoContentIndexer.AddSingleNodeToIndex(XElement node, String type)
    at Examine.LuceneEngine.Providers.LuceneIndexer.ReIndexNode(XElement node, String type)
    at UmbracoExamine.BaseUmbracoIndexer.ReIndexNode(XElement node, String type)
    at UmbracoExamine.UmbracoContentIndexer.ReIndexNode(XElement node, String type)
    at Examine.ExamineManager._ReIndexNode(XElement node, String type, IEnumerable`1 providers)
    at UmbracoExamine.UmbracoEventManager.IndexMedia(Media sender)
    at UmbracoExamine.UmbracoEventManager.Document_AfterSave(Document sender, SaveEventArgs e)
    at umbraco.cms.businesslogic.web.Document.SaveEventHandler.Invoke(Document sender, SaveEventArgs e)
    at umbraco.cms.businesslogic.web.Document.FireAfterSave(SaveEventArgs e)
    at umbraco.cms.businesslogic.web.Document.Save()
    at PROJECT.Core.Code.Migration.MigrateServices.SaveServicesToUmbraco(IList`1 services) in UMBRACO_PATH\Code\Migration\MigrateServices.cs:line 510
    at PROJECT.Core.usercontrols.MigrateServices.MigrateContent_Click(Object sender, EventArgs e) in UMBRACO_PATH\usercontrols\MigrateServices.ascx.cs:line 25

    So far i've followed Shannon's instructions :

    Delete your entire Examine folder with all indexes (if you get file 
    lock errors, it means that something is still hanging on to the files, 
    you'll have to bump your web.config file)
    Reset file/folder permissions on App_Data to make sure that the IIS user can read/write/delete (full control)
    Set your indexers to run in async mode.
    Log into Umbraco and publish 1 node... this will re-index all of your content.
    Wait about a minute for the async operations to work.

    I've worked with Lucene before and had all kinds of problems with Locking indexes, in this case i'd even be happy to turn the index off for a period as an initial work around.

    Cheers

    Jon

     

  • Alex Norcliffe 222 posts 287 karma points
    Feb 18, 2011 @ 18:49
    Alex Norcliffe
    0

    Hi Jon - quick q, are you running your app pool in webgarden mode (i.e. multiple worker processes)? The stack trace is showing a lock on Examine's equivalent of a mutex which is a file on disk whose job it is to prevent other processes from attempting an index at the same time, so at that point it's not yet Lucene which is causing the lock

  • Alex Norcliffe 222 posts 287 karma points
    Feb 18, 2011 @ 18:51
    Alex Norcliffe
    0

    Second quick q :) are you running any kind of file-sync or anti-virus on the environment which could be taking its own lock on file the UMBRACO_PATH\App_Data\TEMP\ExamineIndexes\Internal\COMPUTER.lck

  • webmonger 130 posts 285 karma points
    Feb 18, 2011 @ 18:52
    webmonger
    0

    Hi Alex - No it's single worker process. .net 4.0, Umbraco 4.6.1, IIS 7, SQL Express 2k8

  • webmonger 130 posts 285 karma points
    Feb 18, 2011 @ 18:56
    webmonger
    0

    Using AVG on my local machine, Had not thought of that, not sure i can switch it off for a folder. I'll have a look though.

  • Alex Norcliffe 222 posts 287 karma points
    Feb 21, 2011 @ 15:08
    Alex Norcliffe
    0

    Did you find if this was the issue or not?

  • webmonger 130 posts 285 karma points
    Feb 22, 2011 @ 12:23
    webmonger
    0

    Hey Alex

    Still no joy with this one. I disbaled my antivirus and added a 2 second delay between each write to the database and it still errored with the problem above.

    Jon

  • webmonger 130 posts 285 karma points
    Feb 24, 2011 @ 10:57
    webmonger
    0

    I've tried this again a couple of times since my last post and i'm still having the same problem. Does anyone have any idea why Examine is locking the index?

  • webmonger 130 posts 285 karma points
    Feb 25, 2011 @ 15:49
    webmonger
    2

    I finally managed to get this fixed by turning Examine Off.

    Open ExamineSettings.config and add the attribute

    enableDefaultEventHandler="false"

    Documentation: http://examine.codeplex.com/wikipage?title=Full%20Configuration%20Markup%20%26%20Options&referringTitle=UmbracoExamine

    This turned Examine off and i did not recieve the error once.

    Thanks for your input Alex as always very much appreciated :)

    Jon

  • Martin Lingstuyl 202 posts 379 karma points
    May 04, 2012 @ 16:38
    Martin Lingstuyl
    0

    Hi Guys,

     

    Does this disabling Examine through enableDefaultEventHandler=false really work? Just for advice...

    I'm having huge problems with examine locking during large Content imports, and at one point the Examine Queue contained millions of little files. I couldnt even open up the folder in ftp due to the completely exeeding number / file size.

     

    Hoping to get rid of examine once and for all now.

     

    Martin

  • AlisaBin 4 posts 24 karma points
    Sep 22, 2012 @ 12:01
    AlisaBin
    0

    Examine Index file locking problem when creating a lot of documents???

    Ok I am suffering this problem a lot of days. At lest I find a solution, Long Path Tool helped me in this situation. http://PathTooDeep.com. Thank you so much.

  • rowindas 4 posts 24 karma points
    Oct 12, 2012 @ 15:09
    rowindas
    0

     

    I have a same problem of you, but long path tool help me in this situation. So you can download a latest version of “Long Path Tool" for solve this problem.

  • rowindas 4 posts 24 karma points
    Oct 12, 2012 @ 15:12
    rowindas
    0

     

    I have a same problem of you, but long path tool help me in this situation. So you can download a latest version of “Long Path Tool" for solve this problem.

  • rowindas 4 posts 24 karma points
    Oct 12, 2012 @ 15:15
    rowindas
    0

     

    I have a same problem of you, but long path tool help me in this situation. So you can download a latest version of “Long Path Tool" for solve this problem.

  • arwinis 3 posts 23 karma points
    Oct 23, 2012 @ 12:29
    arwinis
    0

    Hello can’t delete/ copy/ remove….. File? Please, make sure, LONG PATH Error Fixer helped me in this situation. Download it from “Long Path Tool” and fix any following problem.

Please Sign in or register to post replies

Write your reply to:

Draft