Copied to clipboard

Flag this post as spam?

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


  • Devin Gleason Lambert 27 posts 89 karma points
    May 02, 2016 @ 18:59
    Devin Gleason Lambert
    0

    AlreadyClosedException

    I am having an issue with my examine queries after the v6 to v7 upgrade. Now I intermittently get the exception:

    Lucene.Net.Store.AlreadyClosedException occured in Lucene.Net.dll.
    

    I am not sure how or where this came from other than something changed in v7, but I see no mention off it anywhere so maybe it was something in the configs?

    Devin

    at Lucene.Net.Index.IndexReader.EnsureOpen()
    at Lucene.Net.Index.IndexReader.IncRef()
    at Examine.LuceneEngine.SearchResults.DecrementReaderResult..ctor(IEnumerator`1 baseEnumerator, Searcher searcher) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\SearchResults.cs:line 245
    at Examine.LuceneEngine.SearchResults.GetEnumerator() in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\SearchResults.cs:line 288
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
    at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
    at ASP._Page_Views_Brand_cshtml.Execute() in c:\Dev\TourMatters Website Team Proj\TourMatters Website\Umbraco7\TourMatters.Site\Views\Brand.cshtml:line 467
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
    at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
    at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
    at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
    at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
    at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
    
  • Devin Gleason Lambert 27 posts 89 karma points
    May 03, 2016 @ 15:51
    Devin Gleason Lambert
    0

    So I have a variable

    Examine.SearchCriteria.IBooleanOperation queryBrands = ExamineManager.Instance.CreateSearchCriteria().NodeTypeAlias("Brand").And().GroupedAnd(specialtyFields, specialtyFilter); 
    var searchBrands = ExamineManager.Instance.Search(queryBrands.Compile());
    

    and I use the searchBrands variable multiple times....

    @searchBrands.Count().ToString()
    

    and

    else if (searchBrands.Count() == 1)
    

    and

    @if (searchBrands.Count() == 0)
    

    and

     searchBrands.Select(x => x.Id.ToString()).ToArray<string>()
    

    and

    foreach (var node in searchBrands.OrderBy(x => BrandHelpers.SpecialtyBrandPosition(specialtyNodes, x.Id)))
    

    Am I using the variable too long and it is causing me to time out?

    Devin

    Edit: Sorry this was actually an occasion of the same error but in a different place than the initial exception in the first post. But the scenario is similar, continued use of the ISearchResults variable.

  • netanel 2 posts 73 karma points
    May 04, 2016 @ 20:00
    netanel
    0

    Hi, im having the same issue, when using Examine to search content via UmbracoWebApi:

    · Message: "An error has occurred.", · ExceptionMessage: "The 'ObjectContent1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.", · ExceptionType: "System.InvalidOperationException", · StackTrace: null, · InnerException: { o Message: "An error has occurred.", o ExceptionMessage: "this IndexReader is closed", o ExceptionType: "Lucene.Net.Store.AlreadyClosedException", o StackTrace: " at Lucene.Net.Index.IndexReader.EnsureOpen() at Lucene.Net.Index.IndexReader.IncRef() at Examine.LuceneEngine.SearchResults.GetEnumerator() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding) at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding) at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.

    Im runing Umbraco ver 7.3.4 on Windows server 2012 this exception appear usually after reseting the IIS. does anyone know how to solve this issue? Thanks Nati

  • Devin Gleason Lambert 27 posts 89 karma points
    May 05, 2016 @ 13:14
    Devin Gleason Lambert
    0

    I am on 7.4.3

    I also noticed the issue go away but I am not completely sure why. I rebuilt all my indexes and then tested, still had the issue, maybe it was a delayed thing? I also am doing this in my dev environment so the app has been restarted plenty of times too.

    Just some notes, I will report back if it starts happening again.

    Devin

  • Devin Gleason Lambert 27 posts 89 karma points
    May 11, 2016 @ 14:56
    Devin Gleason Lambert
    0

    Happened again, I pushed my app to a new azure web app through source control, So the App_Data folder was mostly rebuilt, rebuild indexes, and republished entire site. Gonna try and rebuild indexes again and see if I still have issues.

    Devin

  • Devin Gleason Lambert 27 posts 89 karma points
    May 11, 2016 @ 15:03
    Devin Gleason Lambert
    0

    Yeah, I just rebuilt external index, still has a write.lock in the Index folder though. Opened 50 pages, no issues.

    I will try again after the write.lock goes away.

    Devin

Please Sign in or register to post replies

Write your reply to:

Draft