title: Umbraco V6.1.3 Lucene Index Corruption
body: <p>Just upgraded an Umbraco V6.1.1 site to V6.1.3. All went well on my workstation. Copied the files up to the web server after deleting all that was there, did the same with the database. Set all the directory permissions and ran the site.  Site (which is MVC) runs BUT with two issues which I can't fathom and would really appreciate some help with.</p>
  
  <p>One page errors with a Read Past EOF error. This is the view it's trying to run. The error is on link in Bold.</p>
  
  <pre><code>@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
  
  @{
      Layout = "BasePage.cshtml";
  }
            &lt;div class="row-fluid"&gt;
                &lt;div class="span12"&gt;
                    &lt;h1&gt;@Umbraco.Field("pageName")&lt;/h1&gt;
                    @Umbraco.Field("pageText")
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;div class="row-fluid"&gt;
                &lt;div class="span12"&gt;
                  @foreach (var page in Model.Content.Children) {
                      &lt;section class="well"&gt;
                      &lt;h3&gt;@page.Name&lt;/h3&gt;
                      @if(page.Children.Count() &gt; 0) {
                          &lt;ul&gt;
                          **@foreach (var pub in page.Children) {**
                             &lt;li&gt;&lt;a href="@Umbraco.Media(pub.GetPropertyValue("publication")).Url" title="@pub.Name" target="_blank"&gt;@pub.Name&lt;/a&gt;&lt;/li&gt;
                          }
                          &lt;/ul&gt;
                      }
                      &lt;/section&gt;
                  }
                    &lt;/div&gt;
            &lt;/div&gt;
  </code></pre>
  
  <p>The Stack Trace is</p>
  
  <pre><code>[IOException: read past EOF]
     Lucene.Net.Index.FindSegmentsFile.Run(IndexCommit commit) +2040
     Lucene.Net.Index.DirectoryReader.Open(Directory directory, IndexDeletionPolicy deletionPolicy, IndexCommit commit, Boolean readOnly, Int32 termInfosIndexDivisor) +57
     Lucene.Net.Search.IndexSearcher..ctor(Directory path, Boolean readOnly) +29
     Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher(Boolean forceReopen) +136
  </code></pre>
  
  <p>The other (I think related issue) is in the CMS, when opening the Developer Section, I get a javascript alert with a huge error message in it relating to Lucene</p>
  
  <pre><code>error: {"Message":"An error has occurred.","ExceptionMessage":"The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.","ExceptionType":"System.InvalidOperationException","StackTrace":null,"InnerException":{"Message":"An error has occurred.","ExceptionMessage":"Could not create an index searcher with the supplied lucene directory","ExceptionType":"System.ApplicationException","StackTrace":"   at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher(Boolean forceReopen)\r\n   at Examine.LuceneEngine.Providers.LuceneSearcher.GetSearcher()\r\n   at Umbraco.Web.Search.ExamineExtensions.GetIndexReaderForSearcher(BaseLuceneSearcher searcher)\r\n   at Umbraco.Web.Search.ExamineExtensions.GetIndexDocumentCount(LuceneIndexer indexer)\r\n   at Umbraco.Web.WebServices.ExamineManagementApiController.CreateModel(BaseIndexProvider indexer)\r\n   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n   at Newtonsoft.Json.Serialization.JsonArrayContract.CreateWrapper(Object list)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value)\r\n   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value)\r\n   at System.Net.Http.Formatting.JsonMediaTypeFormatter.&lt;&gt;c__DisplayClassd.&lt;WriteToStreamAsync&gt;b__c()\r\n   at System.Threading.Tasks.TaskHelpers.RunSynchronously(Action action, CancellationToken token)","InnerException":{"Message":"An error has occurred.","ExceptionMessage":"read past EOF","ExceptionType":"System.IO.IOException","StackTrace":"   at Lucene.Net.Index.SegmentInfos.FindSegmentsFile.Run(IndexCommit commit)\r\n   at Lucene.Net.Index.DirectoryReader.Open(Directory directory, IndexDeletionPolicy deletionPolicy, IndexCommit commit, Boolean readOnly, Int32 termInfosIndexDivisor)\r\n   at Lucene.Net.Search.IndexSearcher..ctor(Directory path, Boolean readOnly)\r\n   at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher(Boolean forceReopen)"}}}
  </code></pre>
  
  <p>Have tried the Umbraco forum but have had no replies. If it's a no-brainer, I still need to know of course. </p>
  
  <p>Any advice would be greatly appreciated.</p>