Examine/Lucene errors when two nodes published at same time.
I have a client that has a rather large site (umbraco.config around 37mb). There are a few indexes setup on the site, and every once and a while the site search stops working. Generally the error we get is the following:
[UmbracoExamine] (NAME_OF_INDEX)Cannot create index, the index is currently locked,, IndexSet: NAME_OF_INDEX
The usual fix is to delete the index files and cycle the app pool. The only way that we have been able to reproduce this issue is by publishing two nodes at the same time. We get mixed results while doing this so I guess it is a timing issue, but with a few tries we can get it in a state where it will not recover without manual intervation. While doing this we get a number of other erors like, "Error indexing queue items, Object reference not set to an instance of an object." and "Failed to add document with id X to Lucene search index" and "System.IO.FileNotFoundException: Could not find file 'X'." where X is the name of an index cfs file.
When the index gets in this locked up state there is the write.lock file sitting in the index folder and it doesn't leave.
So, any ideas how we can stop this from happening? Manually fixing the search every week isn't a practical option. One option is to set enableDefaultEventHandler to false and reindex via a scheduled task but I would rather find a way to make things work when a document is published.
The site is running on a windows VPS in full trust. Here is the config for the search:
Found some legacy code in the system that had an action handler listening on document publishing and was working directly with Lucene to add the node to the index. As soon as I removed that action handler things started working fine with examine.
Examine/Lucene errors when two nodes published at same time.
I have a client that has a rather large site (umbraco.config around 37mb). There are a few indexes setup on the site, and every once and a while the site search stops working. Generally the error we get is the following:
[UmbracoExamine] (NAME_OF_INDEX)Cannot create index, the index is currently locked,, IndexSet: NAME_OF_INDEX
The usual fix is to delete the index files and cycle the app pool. The only way that we have been able to reproduce this issue is by publishing two nodes at the same time. We get mixed results while doing this so I guess it is a timing issue, but with a few tries we can get it in a state where it will not recover without manual intervation. While doing this we get a number of other erors like, "Error indexing queue items, Object reference not set to an instance of an object." and "Failed to add document with id X to Lucene search index" and "System.IO.FileNotFoundException: Could not find file 'X'." where X is the name of an index cfs file.
When the index gets in this locked up state there is the write.lock file sitting in the index folder and it doesn't leave.
So, any ideas how we can stop this from happening? Manually fixing the search every week isn't a practical option. One option is to set enableDefaultEventHandler to false and reindex via a scheduled task but I would rather find a way to make things work when a document is published.
The site is running on a windows VPS in full trust. Here is the config for the search:
<add name="MYINDEX"
type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
runAsync="true"
supportUnpublished="false"
supportProtected="true"
interval="10"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"
indexSet=" MYINDEX "
enableDefaultEventHandler="true"
logLevel="verbose"/>
I am on Umbraco 4.7.1 btw.
Found some legacy code in the system that had an action handler listening on document publishing and was working directly with Lucene to add the node to the index. As soon as I removed that action handler things started working fine with examine.
Hi Erik,
Any idea what the handler you removed was?
is working on a reply...