【问题标题】:Umbraco Lucene Index Device not readyUmbraco Lucene 索引设备未准备好
【发布时间】:2015-08-04 20:26:32
【问题描述】:

所以我在 Windows 共享主机上的 Umbraco 7 实例上遇到了异常。似乎在任意时间后,Lucene Index(我不直接调用其 API)出现问题,并且应用程序进入错误状态,直到我刷新应用程序池。任何帮助将不胜感激。

2015-08-04 05:57:08,413 [7] ERROR Umbraco.Core.UmbracoApplicationBase 
- [Thread 342] An unhandled exception occurred
System.IO.IOException: The device is not ready.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.ReadCore(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.FileStream.Read(Byte[] array, Int32 offset, Int32 count)
   at System.IO.BinaryReader.Read(Byte[] buffer, Int32 index, Int32 count)
   at Lucene.Net.Store.SimpleFSDirectory.SimpleFSIndexInput.ReadInternal(Byte[] b, Int32 offset, Int32 len)
   at Lucene.Net.Store.BufferedIndexInput.Refill()
   at Lucene.Net.Store.BufferedIndexInput.ReadByte()
   at Lucene.Net.Store.IndexInput.ReadVInt()
   at Lucene.Net.Index.TermBuffer.Read(IndexInput input, FieldInfos fieldInfos)
   at Lucene.Net.Index.SegmentTermEnum.Next()
   at Lucene.Net.Index.SegmentTermEnum.ScanTo(Term term)
   at Lucene.Net.Index.TermInfosReader.Get(Term term, Boolean useCache)
   at Lucene.Net.Index.TermInfosReader.Terms(Term term)
   at Lucene.Net.Index.SegmentReader.Terms(Term t)
   at Lucene.Net.Index.DirectoryReader.MultiTermEnum..ctor(IndexReader topReader, IndexReader[] readers, Int32[] starts, Term t)
   at Lucene.Net.Index.DirectoryReader.Terms(Term term)
   at Lucene.Net.Search.WildcardTermEnum..ctor(IndexReader reader, Term term)
   at Lucene.Net.Search.WildcardQuery.GetEnum(IndexReader reader)
   at Lucene.Net.Search.MultiTermQuery.ConstantScoreAutoRewrite.Rewrite(IndexReader reader, MultiTermQuery query)
   at Lucene.Net.Search.WildcardQuery.Rewrite(IndexReader reader)
   at Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
   at Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
   at Lucene.Net.Search.IndexSearcher.Rewrite(Query original)
   at Lucene.Net.Search.Query.Weight(Searcher searcher)
   at Lucene.Net.Search.Searcher.CreateWeight(Query query)
   at Lucene.Net.Search.Searcher.Search(Query query, Filter filter, Int32 n, Sort sort)
   at Examine.LuceneEngine.SearchResults.DoSearch(Query query, IEnumerable`1 sortField, Int32 maxResults)
   at Examine.LuceneEngine.Providers.BaseLuceneSearcher.Search(ISearchCriteria searchParams, Int32 maxResults)
   at Examine.LuceneEngine.Providers.BaseLuceneSearcher.Search(ISearchCriteria searchParams)
   at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetUmbracoMedia(Int32 id)
   at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetById(UmbracoContext umbracoContext, Boolean preview, Int32 nodeId)
   at Umbraco.Web.PublishedCache.ContextualPublishedCache`1.GetById(Boolean preview, Int32 contentId)
   at Umbraco.Web.UmbracoHelper.TypedMedia(Object id)
   at ASP._Page_Views_HomePageCarouselItem_cshtml.Execute() in g:\pleskvhosts\crossfitbyob.com\httpdocs\Views\HomePageCarouselItem.cshtml:line 7
   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.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)
   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model)
   at ASP._Page_Views_HomePageCarouselFolder_cshtml.Execute() in g:\pleskvhosts\crossfitbyob.com\httpdocs\Views\HomePageCarouselFolder.cshtml:line 8
   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.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)
   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model)
   at ASP._Page_Views_HomePage_cshtml.Execute() in g:\pleskvhosts\crossfitbyob.com\httpdocs\Views\HomePage.cshtml:line 9
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.StartPage.RunPage()
   at System.Web.WebPages.StartPage.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.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

【问题讨论】:

  • 网站是否负载均衡或托管在 Azure 上?
  • 不是。它正在为 windows 使用 godaddy 共享主机。
  • @JulesMeyer,我也看到了同样的情况,而且它不仅限于 GoDaddy。这里有更多信息(事实上,我在帖子中链接到你的问题):our.umbraco.org/forum/getting-started/installing-umbraco/…

标签: asp.net-mvc lucene umbraco umbraco7


【解决方案1】:

Azure 网站使用远程文件系统,这可能会对 Lucene 造成严重破坏,我们已经多次看到此错误。我只能假设 Godaddy 也为他们的 IIS 网站使用远程文件服务器。

基本上,解决方案是在本地临时 asp.net 存储上运行 Umbraco lucene 索引。在最新版本的 Umbraco (7.2.8+) 中,此功能内置于核心中,您可以为索引器和搜索器使用 LocalOnly 配置标志,例如:

  <add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
       supportUnpublished="true"
       supportProtected="true" 
       analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"
       useTempStorage="LocalOnly"/>

  <add name="InternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
       analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net" 
       useTempStorage="LocalOnly"/>

如果您使用的是旧版本的 Umbraco,您可以使用名为 TempStorage 的自定义库:https://github.com/Shazwazza/UmbracoExamine.TempStorage

此问题已在此处记录:http://issues.umbraco.org/issue/U4-3222,但大部分讨论和解决方案都在此处:https://our.umbraco.org/forum/getting-started/installing-umbraco/20999-Disable-Lucene-Examine#comment-228320

【讨论】:

  • 有趣的是我迄今为止看到的最实质性的回应。我相信我目前在 7.2.4 上,但这绝对值得升级几个小版本来尝试。我让你知道情况如何。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-01-24
  • 1970-01-01
  • 2011-08-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-18
相关资源
最近更新 更多