Copied to clipboard

Flag this post as spam?

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


  • John Arnold 1 post 71 karma points
    Aug 17, 2018 @ 09:56
    John Arnold
    0

    Umbraco MediaService Lucene lockWaitTimeout

    I'm having an issue using the Umbraco MediaService to delete images:

    var mService = ApplicationContext.Current.Services.MediaService;
    
    IMedia media = mService.GetById(id);
    
    if (media != null)
    {
         mService.Delete(media);
    
    }
    
    This gives the following error:
    
    at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout)
       at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create, Boolean closeDir, IndexDeletionPolicy deletionPolicy, Boolean autoCommit, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit)
       at Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, Boolean create, MaxFieldLength mfl)
       at Examine.LuceneEngine.Providers.LuceneIndexer.WriterFactory(Directory d)
       at Examine.LuceneEngine.WriterTracker.<>c__DisplayClass7_0.<GetWriter>b__0(String s)
       at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
       at Examine.LuceneEngine.WriterTracker.GetWriter(Directory dir, Func`2 factory)
       at Examine.LuceneEngine.Providers.LuceneIndexer.CreateIndexWriter()
       at UmbracoExamine.BaseUmbracoIndexer.CreateIndexWriter()
       at Examine.LuceneEngine.Providers.LuceneIndexer.GetIndexWriter()
       at Examine.LuceneEngine.Providers.LuceneIndexer.GetSearcher()
       at System.Lazy`1.CreateValue()
       at System.Lazy`1.LazyInitValue()
       at System.Lazy`1.get_Value()
       at UmbracoExamine.BaseUmbracoIndexer.get_InternalSearcher()
       at UmbracoExamine.UmbracoContentIndexer.DeleteFromIndex(String nodeId)
       at Examine.ExamineManager._DeleteFromIndex(String nodeId, IEnumerable`1 providers)
       at Umbraco.Web.Search.ExamineEvents.DeleteIndexForEntity(Int32 entityId, Boolean keepIfUnpublished)
       at Umbraco.Web.Search.ExamineEvents.MediaCacheRefresherCacheUpdated(MediaCacheRefresher sender, CacheRefresherEventArgs e)
       at Umbraco.Core.Cache.CacheRefresherBase`1.OnCacheUpdated(TInstanceType sender, CacheRefresherEventArgs args)
       at Umbraco.Core.Cache.JsonCacheRefresherBase`1.Refresh(String json)
       at Umbraco.Web.Cache.MediaCacheRefresher.Refresh(String jsonPayload)
       at Umbraco.Core.Sync.ServerMessengerBase.DeliverLocal(ICacheRefresher refresher, MessageType messageType, IEnumerable`1 ids, String json)
       at Umbraco.Core.Sync.ServerMessengerBase.Deliver(IEnumerable`1 servers, ICacheRefresher refresher, MessageType messageType, IEnumerable`1 ids, String json)
       at Umbraco.Core.Sync.ServerMessengerBase.PerformRefresh(IEnumerable`1 servers, ICacheRefresher refresher, String jsonPayload)
       at Umbraco.Web.Cache.DistributedCache.RefreshByJson(Guid factoryGuid, String jsonPayload)
       at Umbraco.Web.Cache.DistributedCacheExtensions.RemoveMediaCachePermanently(DistributedCache dc, Int32[] mediaIds)
       at Umbraco.Web.Cache.CacheRefresherEventHandler.MediaService_Deleted(IMediaService sender, DeleteEventArgs`1 e)
       at Umbraco.Core.Events.TypedEventHandler`2.Invoke(TSender sender, TEventArgs e)
       at Umbraco.Core.Events.EventDefinition`2.RaiseEvent()
       at Umbraco.Core.Events.ScopeEventDispatcher.ScopeExitCompleted()
       at Umbraco.Core.Events.ScopeEventDispatcherBase.ScopeExit(Boolean completed)
       at Umbraco.Core.Scoping.Scope.<>c__DisplayClass70_0.<RobustExit>b__1()
       at Umbraco.Core.Scoping.Scope.TryFinally(Int32 index, Action[] actions)
       at Umbraco.Core.Scoping.Scope.TryFinally(Int32 index, Action[] actions)
       at Umbraco.Core.Scoping.Scope.RobustExit(Boolean completed, Boolean onException)
       at Umbraco.Core.Scoping.Scope.DisposeLastScope()
       at Umbraco.Core.Scoping.Scope.Dispose()
       at Umbraco.Core.Persistence.UnitOfWork.ScopeUnitOfWork.DisposeResources()
       at Umbraco.Core.DisposableObject.Dispose(Boolean disposing)
       at Umbraco.Core.DisposableObject.Dispose()
       at Umbraco.Core.Services.MediaService.Umbraco.Core.Services.IMediaServiceOperations.Delete(IMedia media, Int32 userId)
       at Umbraco.Core.Services.MediaService.Delete(IMedia media, Int32 userId)
       at GCWebsite.Controllers.AppealsAPIController.RemoveImage() in c:\vs\Website\Controllers\APIController.cs:line 148
    

    Can anyone suggest how to resolve this please

Please Sign in or register to post replies

Write your reply to:

Draft