When I'm trying to rebuild my examine index I get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
UmbracoExamine.UmbracoContentIndexer.OnGatheringNodeData(IndexingNodeDataEventArgs e) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\UmbracoExamine\UmbracoContentIndexer.cs:254
Examine.LuceneEngine.Providers.LuceneIndexer.GetDataToIndex(XElement node, String type) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\Examine\LuceneEngine\Providers\LuceneIndexer.cs:749
UmbracoExamine.UmbracoContentIndexer.GetDataToIndex(XElement node, String type) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\UmbracoExamine\UmbracoContentIndexer.cs:346
Examine.LuceneEngine.Providers.LuceneIndexer.AddNodesToIndex(IEnumerable`1 nodes, String type) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\Examine\LuceneEngine\Providers\LuceneIndexer.cs:496
UmbracoExamine.BaseUmbracoIndexer.AddNodesToIndex(String xPath, String type) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\UmbracoExamine\BaseUmbracoIndexer.cs:240
UmbracoExamine.BaseUmbracoIndexer.PerformIndexAll(String type) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\UmbracoExamine\BaseUmbracoIndexer.cs:194
Examine.LuceneEngine.Providers.LuceneIndexer.IndexAll(String type) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\Examine\LuceneEngine\Providers\LuceneIndexer.cs:465
UmbracoExamine.BaseUmbracoIndexer.PerformIndexRebuild() in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\UmbracoExamine\BaseUmbracoIndexer.cs:125
Examine.LuceneEngine.Providers.LuceneIndexer.RebuildIndex() in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\Examine\LuceneEngine\Providers\LuceneIndexer.cs:425
usercontrols.Umbraco.ExamineIndexAdmin.RebuildClick(Object sender, EventArgs e) +124
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
If I try to publish a node (that always worked) I get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Value cannot be null.
Parameter name: attribute
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: attribute
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: attribute]
System.Xml.Linq.XAttribute.op_Explicit(XAttribute attribute) +90598
UmbracoExamine.UmbracoContentIndexer.ReIndexNode(XElement node, String type) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\UmbracoExamine\UmbracoContentIndexer.cs:196
Examine.ExamineManager._ReIndexNode(XElement node, String type, IEnumerable`1 providers) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\Examine\ExamineManager.cs:135
UmbracoExamine.UmbracoEventManager.content_AfterUpdateDocumentCache(Document sender, DocumentCacheEventArgs e) in C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Examine\UmbracoExamine\UmbracoEventManager.cs:210
umbraco.DocumentCacheEventHandler.Invoke(Document sender, DocumentCacheEventArgs e) +0
umbraco.content.FireAfterUpdateDocumentCache(Document sender, DocumentCacheEventArgs e) +26
umbraco.content.UpdateDocumentCache(Document d) +736
umbraco.content.UpdateDocumentCache(Int32 pageId) +52
umbraco.library.UpdateDocumentCache(Int32 DocumentId) +106
umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e) +383
System.EventHandler.Invoke(Object sender, EventArgs e) +0
umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +46
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Yes I'm using DAMP on the node that throws the exception and I'm also using Embedded Content on some other nodes. Do you have any idea what might be the problem?
I've seen this before where Examine chooses to index XML nodes that aren't Umbraco XML nodes, but I haven't gone deeper into it to work it out. It might be something different in your case, but I'll have a look to see if I can reproduce it locally.
I dug into this a bit further: for me this error occurs if there is a non-umbraco node in the content XML that has an "id" attribute.
I had it occur when DAMP included the Embedded Content XML from a media node in RLZ (though it could equally occur if the Embedded Content field was included directly).
If this does describe your problem, the patch below seems to fix it. I'll submit this once I've prettied up the test case. The patch is against Examine 1.0 RTM: if you want the binary I can email it to you.
Index: UmbracoExamine/BaseUmbracoIndexer.cs
===================================================================
--- UmbracoExamine/BaseUmbracoIndexer.cs (revision 61308)
+++ UmbracoExamine/BaseUmbracoIndexer.cs (working copy)
@@ -144,7 +144,7 @@
if (!SupportedTypes.Contains(type))
return;
- string xPath = "//*[(number(@id) > 0){0}]"; //we'll add more filters to this below if needed
+ string xPath = "//*[(number(@id) > 0 and (@isDoc or @nodeTypeAlias)){0}]"; //we'll add more filters to this below if needed
StringBuilder sb = new StringBuilder();
@skiltz: Shannon has posted the Examine 1.1 beta which includes this fix as well as others. I highly recommend you download and use that now. It also includes a fantastic new multi index searcher which is awesome if you're doing custom indexes.
If you guys can please test the 1.1 beta and make sure everything is in check on your side (reindexing, republishing nodes, searching) and let me know (post back here if you like) if its all good I'll release the RTM this weekend.
Examine OnGatheringNodeData error
Hello,
When I'm trying to rebuild my examine index I get the following error:
If I try to publish a node (that always worked) I get the following error:
Anyone got an idea what might go wrong?
Jeroen
It happens when I try to rebuild the InternalIndexer. Other indexes work.
Jeroen
Are you by any chance using DAMP or Embedded Content - or both?
Yes I'm using DAMP on the node that throws the exception and I'm also using Embedded Content on some other nodes. Do you have any idea what might be the problem?
Jeroen
What umbraco version?
Can you put a link to the XML file for your site?
I've seen this before where Examine chooses to index XML nodes that aren't Umbraco XML nodes, but I haven't gone deeper into it to work it out. It might be something different in your case, but I'll have a look to see if I can reproduce it locally.
I dug into this a bit further: for me this error occurs if there is a non-umbraco node in the content XML that has an "id" attribute.
I had it occur when DAMP included the Embedded Content XML from a media node in RLZ (though it could equally occur if the Embedded Content field was included directly).
If this does describe your problem, the patch below seems to fix it. I'll submit this once I've prettied up the test case. The patch is against Examine 1.0 RTM: if you want the binary I can email it to you.
Great, will put the fix in.
I'm facing the same issue. Any chance you could send me the binary james :) mskiltonATgmail.com... thanks...
@skiltz: Shannon has posted the Examine 1.1 beta which includes this fix as well as others. I highly recommend you download and use that now. It also includes a fantastic new multi index searcher which is awesome if you're doing custom indexes.
If you guys can please test the 1.1 beta and make sure everything is in check on your side (reindexing, republishing nodes, searching) and let me know (post back here if you like) if its all good I'll release the RTM this weekend.
THANKS!
I just tested the 1.1 beta and it's solved! Many thanks.
Jeroen
Looks good to me :)
thanks guys. just waiting on feedback from a few others and will release.
@Shannon: what are the chances of the updated Examine release making it into the 4.7 umbraco release? I'm guessing pretty slim, right?
That's not going to happen. Just got a twitter message from Niels Hartvig.
Jeroen
I'm running 1.1 on a couple of live sites and its working fine for me.
is working on a reply...