Copied to clipboard

Flag this post as spam?

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


  • nickornotto 312 posts 674 karma points
    Aug 10, 2020 @ 03:39
    nickornotto
    0

    Umbraco Lucene & GetUmbracoMediaCacheValues error appearing suddenly and crashing the entire website

    We started getting the following Lucene error yesterday.

    It crashes the entire website with 500 error and only restarting works.

    Just to mention there was no changes to the code in the last 2-3 weeks and it just started appearing out of the blue.

    Exception information: 
        Exception type: NullReferenceException 
        Exception message: Object reference not set to an instance of an object.
       at Lucene.Net.Index.SegmentReader.Norm.DecRef()
       at Lucene.Net.Index.SegmentReader.DoClose()
       at Lucene.Net.Index.IndexReader.DecRef()
       at Lucene.Net.Index.DirectoryReader.DoClose()
       at Lucene.Net.Index.IndexReader.DecRef()
       at Lucene.Net.Index.IndexReader.Close()
       at Examine.LuceneEngine.OpenReaderTracker.CloseStaleReaders(Directory dir, TimeSpan ts) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\OpenReaderTracker.cs:line 44
       at Examine.LuceneEngine.Providers.LuceneSearcher.ReaderReopener.MaybeReopen() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 618
       at Examine.LuceneEngine.Providers.LuceneSearcher.ReaderReopener.ScheduleReopen() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 471
       at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 368
       at Examine.LuceneEngine.Providers.LuceneSearcher.GetSearchFields() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 245
       at UmbracoExamine.UmbracoExamineSearcher.GetSearchFields()
       at Examine.LuceneEngine.Providers.BaseLuceneSearcher.CreateSearchCriteria(String type, BooleanOperation defaultOperation) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\BaseLuceneSearcher.cs:line 117
       at UmbracoExamine.UmbracoExamineSearcher.CreateSearchCriteria(String type, BooleanOperation defaultOperation)
       at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetUmbracoMediaCacheValues(Int32 id)
       at Umbraco.Core.Cache.DictionaryCacheProviderBase.<>c__DisplayClass10_0.<GetSafeLazy>b__0()
    
    
    
    Request information: 
        Request URL: https://www.mydomain.com:443/umbraco/RenderMvc?id=25821 
        Request path: /umbraco/RenderMvc 
        User host address: ...
        User: ...
        Is authenticated: True 
        Authentication Type: ApplicationCookie 
    
    Thread information: 
        Thread ID: 77 
        Thread account name: ...
        Is impersonating: False 
        Stack trace:    at Lucene.Net.Index.SegmentReader.Norm.DecRef()
       at Lucene.Net.Index.SegmentReader.DoClose()
       at Lucene.Net.Index.IndexReader.DecRef()
       at Lucene.Net.Index.DirectoryReader.DoClose()
       at Lucene.Net.Index.IndexReader.DecRef()
       at Lucene.Net.Index.IndexReader.Close()
       at Examine.LuceneEngine.OpenReaderTracker.CloseStaleReaders(Directory dir, TimeSpan ts) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\OpenReaderTracker.cs:line 44
       at Examine.LuceneEngine.Providers.LuceneSearcher.ReaderReopener.MaybeReopen() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 618
       at Examine.LuceneEngine.Providers.LuceneSearcher.ReaderReopener.ScheduleReopen() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 471
       at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 368
       at Examine.LuceneEngine.Providers.LuceneSearcher.GetSearchFields() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 245
       at UmbracoExamine.UmbracoExamineSearcher.GetSearchFields()
       at Examine.LuceneEngine.Providers.BaseLuceneSearcher.CreateSearchCriteria(String type, BooleanOperation defaultOperation) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\BaseLuceneSearcher.cs:line 117
       at UmbracoExamine.UmbracoExamineSearcher.CreateSearchCriteria(String type, BooleanOperation defaultOperation)
       at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetUmbracoMediaCacheValues(Int32 id)
       at Umbraco.Core.Cache.DictionaryCacheProviderBase.<>c__DisplayClass10_0.<GetSafeLazy>b__0()
    

    It appears to happen straight after such error where for some reason it has problem getting the media root:

    at Lucene.Net.Store.BufferedIndexInput.ReadBytes(Byte[] b, Int32 offset, Int32 len, Boolean useBuffer) 
    at Lucene.Net.Index.SegmentReader.Norm.Bytes() at Lucene.Net.Index.SegmentReader.GetNorms(String field) 
    at Lucene.Net.Index.SegmentReader.Norms(String field) at Lucene.Net.Search.TermQuery.TermWeight.Scorer(IndexReader reader, Boolean scoreDocsInOrder, Boolean topScorer) at Lucene.Net.Search.BooleanQuery.BooleanWeight.Scorer(IndexReader reader, Boolean scoreDocsInOrder, Boolean topScorer) at Lucene.Net.Search.BooleanQuery.BooleanWeight.Scorer(IndexReader reader, Boolean scoreDocsInOrder, Boolean topScorer) at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Collector collector) 
    at Examine.LuceneEngine.SearchResults.DoSearch(Query query, IEnumerable`1 sortField, Int32 maxResults) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\SearchResults.cs:line 110 
    at Examine.LuceneEngine.Providers.BaseLuceneSearcher.Search(ISearchCriteria searchParams, Int32 maxResults) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\BaseLuceneSearcher.cs:line 182 
    at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetAtRoot(UmbracoContext umbracoContext, Boolean preview) 
    at Umbraco.Web.PublishedCache.ContextualPublishedCache`1.GetAtRoot(Boolean preview) 
    at Umbraco.Web.PublishedContentQuery.TypedMediaAtRoot() 
    at MyDomain.Services.MediaService.GetRootMedia(String mediaFolder) 
    at MyDomain.Services.MediaService.GetSupplierMediaFolderId(IPublishedContent supplierContent) 
    at MyDomain.Controllers.MemberController.<ProductImageSave>d__25.MoveNext()
    

    The only thing that this bit of code does is:

        public IPublishedContent GetRootMedia(string mediaFolder)
        {
            var mediaRoots = _umbHelper.TypedMediaAtRoot();
            return mediaRoots.FirstOrDefault(f => f.Name == mediaFolder);
        }
    

    mediaRoots returns empty collection despite there are a few media folders at root. This seems to happen every some time though - not every time or not for every member.

    var mediaRoots = _umbHelper.TypedMediaAtRoot();
    

    returns empty list asa well.

    Umbraco 7.15.3

  • David Armitage 369 posts 1561 karma points
    Aug 13, 2020 @ 05:07
    David Armitage
    0

    Hi,

    The first thing I would do is delete the App_Data/Temp Folder and delete everything in the AppData/cache folder.

    Every time I have had similar issues like this then clearing out the cache and indexes like this seem to have fixed things.

    Regards

    David

  • nickornotto 312 posts 674 karma points
    Aug 16, 2020 @ 08:18
    nickornotto
    0

    Yes but that does not clear the original issue.

    I'd rather like find a solution to prevent the cache going bust and taking the whole site unexpectedly.

    It already happened 3x during the week which is simply devastating.

  • Ismail Mayat 4511 posts 10056 karma points MVP 2x admin c-trib
    Aug 18, 2020 @ 08:53
    Ismail Mayat
    0

    Nick,

    When the issue occurs can u go into examien management and take a look at the examine dashboard are any of the indexes erroring?

    If I remember rightly when making media calls it uses the external or internal index to get media stub information. If index is down or corrupt it will use the database which is slower.

    I suspect something is corrupting the index.

    Regards

    Ismail

  • nickornotto 312 posts 674 karma points
    Sep 18, 2020 @ 06:49
    nickornotto
    0

    Hi Ismail, I apreciate your response but as I said before - it doesn't clear the original issue.

    Each time it happens we need to restart the server and we delete all indexes out of precaution anyway.

    We have other issues with indexes and we simply noticed that deleting indexes prevents them from happening more often.

    Having said so even if they rebuild the issue starts happening again after a few days or a week so clearly there is somthing wrong. I don't imagine umbraco was meant to be so unstable and any business cannot operate effectively with such an errorneous website.

  • Ismail Mayat 4511 posts 10056 karma points MVP 2x admin c-trib
    Sep 18, 2020 @ 08:31
    Ismail Mayat
    0

    Are you running on azure?

  • nickornotto 312 posts 674 karma points
    Sep 18, 2020 @ 08:46
    nickornotto
    0

    No. We're on dedicated hosting

Please Sign in or register to post replies

Write your reply to:

Draft