Copied to clipboard

Flag this post as spam?

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


  • Dan Sørensen 102 posts 327 karma points
    Nov 11, 2015 @ 09:35
    Dan Sørensen
    0

    Deleting items error 7.3.1

    I got this error alot of times when I try to delete items im using version 7.3.1

    Received an error from the server
    Failed to delete item 14729
    
    Lock obtain timed out: NativeFSLock@C:\inetpub\wwwroot\zbc dev\App_Data\TEMP\ExamineIndexes\ZBC-WEB\External\Index\write.lock: System.IO.IOException: The process cannot access the file 'C:\inetpub\wwwroot\zbc dev\App_Data\TEMP\ExamineIndexes\ZBC-WEB\External\Index\write.lock' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at Lucene.Net.Store.NativeFSLock.Obtain()
    Exception Details:
    Lucene.Net.Store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@C:\inetpub\wwwroot\zbc dev\App_Data\TEMP\ExamineIndexes\ZBC-WEB\External\Index\write.lock: System.IO.IOException: The process cannot access the file 'C:\inetpub\wwwroot\zbc dev\App_Data\TEMP\ExamineIndexes\ZBC-WEB\External\Index\write.lock' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at Lucene.Net.Store.NativeFSLock.Obtain()
    Stacktrace:
    
    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.CreateIndexWriter() in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1670
    
       at Examine.LuceneEngine.Providers.LuceneIndexer.GetIndexWriter() in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1689
    
       at Examine.LuceneEngine.Providers.LuceneIndexer.get_InternalSearcher() in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 336
    
       at UmbracoExamine.BaseUmbracoIndexer.get_InternalSearcher()
    
       at UmbracoExamine.UmbracoContentIndexer.DeleteFromIndex(String nodeId)
    
       at Examine.ExamineManager._DeleteFromIndex(String nodeId, IEnumerable`1 providers) in x:\Projects\Examine\Examine\Projects\Examine\ExamineManager.cs:line 214
    
       at Umbraco.Web.Search.ExamineEvents.DeleteIndexForEntity(Int32 entityId, Boolean keepIfUnpublished)
    
       at Umbraco.Web.Search.ExamineEvents.PublishedPageCacheRefresherCacheUpdated(PageCacheRefresher sender, CacheRefresherEventArgs e)
    
       at Umbraco.Web.Cache.PageCacheRefresher.Remove(IContent instance)
    
       at Umbraco.Core.Sync.ServerMessengerBase.DeliverLocal[T](ICacheRefresher refresher, MessageType messageType, Func`2 getId, IEnumerable`1 instances)
    
       at Umbraco.Core.Sync.ServerMessengerBase.Deliver[T](IEnumerable`1 servers, ICacheRefresher refresher, MessageType messageType, Func`2 getId, IEnumerable`1 instances)
    
       at Umbraco.Web.Cache.DistributedCache.Remove[T](Guid factoryGuid, Func`2 getNumericId, T[] instances)
    
       at Umbraco.Web.Cache.DistributedCacheExtensions.RemovePageCache(DistributedCache dc, IContent[] content)
    
       at Umbraco.Web.Cache.CacheRefresherEventHandler.PublishingStrategy_UnPublished(IPublishingStrategy sender, PublishEventArgs`1 e)
    
       at Umbraco.Core.Events.TypedEventHandler`2.Invoke(TSender sender, TEventArgs e)
    
       at Umbraco.Core.Services.ContentService.UnPublishDo(IContent content, Boolean omitCacheRefresh, Int32 userId)
    
       at Umbraco.Core.Services.ContentService.Umbraco.Core.Services.IContentServiceOperations.UnPublish(IContent content, Int32 userId)
    
       at Umbraco.Core.Services.ContentService.Umbraco.Core.Services.IContentServiceOperations.MoveToRecycleBin(IContent content, Int32 userId)
    
       at Umbraco.Web.Editors.ContentController.DeleteById(Int32 id)
    
       at lambda_method(Closure , Object , Object[] )
    
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
    
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, 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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    
       at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
    
    --- 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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
    
    --- End of stack trace from previous location where exception was thrown ---
    
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
    
    --- 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.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
    
    --- 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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
    
    --- End of stack trace from previous location where exception was thrown ---
    
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
    
    --- 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.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
    
    --- 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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
    
    --- End of stack trace from previous location where exception was thrown ---
    
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
    
    --- 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.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
    
    --- 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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
    
    --- End of stack trace from previous location where exception was thrown ---
    
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
    
    --- 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.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
    
    --- 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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    
       at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
    
    --- 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.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
    
    --- 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.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
    
    --- 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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    
       at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()
    
  • David Armitage 188 posts 761 karma points
    Mar 29, 2016 @ 09:18
    David Armitage
    0

    Hi,

    I am also getting a similar error.

    I am running through some background tasks (Sending email alerts). There is a few other things going on such as deleting nodes and inserting new nodes.

    I have noticed a few times now that sometimes to background tasks fail because...

    contentService.SaveAndPublishWithStatus(data);

    Tells me that it is been used by another process. I assume that the previous background task still has access to this.

    I added a try catch to see if I can get some more data to see how often this this happening..

    Full Code:

    try { var contentService = ApplicationContext.Current.Services.ContentService;

                string documentType = "FailedEmailAlert";
                var name = DateTime.Now.ToShortDateString() + "(" + DateTime.Now.ToShortTimeString() + ")" + " - " + model.AlertType + " (" + model.RecipientEmail + ")"; ;
                var data = contentService.CreateContent(name, 6449, documentType, 0);
    
                data.SetValue("AlertType", model.AlertType);
                data.SetValue("Subject", model.Subject);
                data.SetValue("SenderName", model.SenderName);
                data.SetValue("SenderEmail", model.SenderEmail);
                data.SetValue("RecipientName", model.RecipientName);
                data.SetValue("RecipientEmail", model.RecipientEmail);
                data.SetValue("Body", model.Body);
                data.SetValue("Cc", model.Cc);
                data.SetValue("Bcc", model.Bcc);
                data.SetValue("Exception", model.Exception);
                data.SetValue("ExceptionDetails", model.ExceptionDetails);
    
                // save and publish
                contentService.SaveAndPublishWithStatus(data);
    
                return data.Id;
            }
            catch(Exception ex)
            {
                LogHelper.Error(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "msg", ex);
            }
    

    Is there any way to get around this? Possible check if the content service is been used and wait.

    Or am I doing something wrong and should be full disposing the content service differently?

    Kind Regards David

Please Sign in or register to post replies

Write your reply to:

Draft