The search crawler indexes content to physical index files, while it is running and this process can timeout or lock up.
When files inside the Search folder get corrupted for whatever reason, customers may see the following error in the log4net log file of DNN:
Lock obtain timed out: NativeFSLock@<root_folder>\App_Data\Search\write.lock at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout)at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create, IndexDeletionPolicy deletionPolicy, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit)
at Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, MaxFieldLength mfl) at DotNetNuke.Services.Search.Internals.LuceneControllerImpl.get_Writer()
at DotNetNuke.Services.Search.Internals.LuceneControllerImpl.Delete(Query query) at DotNetNuke.Services.Search.Internals.InternalSearchControllerImpl.DeleteSearchDocumentInternal(SearchDocument searchDocument, Boolean autoCommit)
at DotNetNuke.Services.Search.Internals.InternalSearchControllerImpl.DeleteAllDocuments(Int32 portalId, Int32 searchTypeId)
at DotNetNuke.Services.Search.SearchEngine.DeleteOldDocsBeforeReindex() at DotNetNuke.Services.Search.SearchEngineScheduler.DoWork()
The error is because the indexing scheduler is being blocked by another process. When the write.lock file exists in the Search folder, it means it's currently writing to an index file.
- To resolve this, you will need to recycle the application pool through IIS by going into IIS > Click on Application Pools > Right-click on the application pool for your website > Recycle.
- After recycling the application pool, run a reindex on your site.
- If the above steps did not resolve your issue, run a full Reindex and You can go to Settings > Scheduler > Scheduler > Manually run the Search Crawlers (File, Site, URL).
Note: You will need access to the server backend to run the full reindex. If you are an OnDemand customer, please open a support ticket so that we can resolve the issue via our SaaS team.
To test that the write.lock timeout has been resolved:
- Go to Settings > Scheduler > History and see if the crawler task was completed successfully.
- Check the Log4net files for the error again located in SiteRoot/Portals/_default/Logs folder.
Article is closed for comments.