KNOWLEDGE BASE

Value Cannot Be Null, Error in Umbraco When Publishing Node


Umbraco 4, while publishing content from the admin control panel.

Sometimes, when publishing a node in Umbraco, we were experiencing the odd error: "Value Cannot Be Null, Parameter Name: Attribute" as shown below:

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) +163158
UmbracoExamine.UmbracoContentIndexer.ReIndexNode(XElement node, String type) +193
Examine.ExamineManager._ReIndexNode(XElement node, String type, IEnumerable`1 providers) +93
umbraco.DocumentCacheEventHandler.Invoke(Document sender, DocumentCacheEventArgs e) +0
umbraco.content.UpdateDocumentCache(Document d) +1064
umbraco.library.UpdateDocumentCache(Int32 DocumentId) +122
umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e) +541
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +187
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +3707

This is caused by the XML cache being out of sync with the database. In most cases, simply unpublishing and republishing the website or node will solve this issue and bring everything into step. In some rare cases (as we were experiencing), this may still give you the error, in which case you can rebuild the entire XML cache by accessing the following URL on your website:

/umbraco/dialogs/republish.aspx?xml=true

This will cause Umbraco to rebuild the entire XML cache and should solve the problem (But beware! This can take some time, particularly for large websites). For instance, a website with tens of thousands of nodes this could over 30 minutes in some cases!


Need an Umbraco Master?

Here at Simon Antony, we have an in house certified Umbraco Grand Master available for hire. Got a problem with your site, need architecture advice, give us a call to speak to Simon directly and see how we can help

Contact Simon Today!