SharePoint 2013 – Left Navigation and top Navigation bar does not render links and shows error: “An error occurred while rendering navigation for requested URL”


 

On the SharePoint site, we were seeing error in navigation in the quick launch. If we try to go to the navigation link in the site collection that failed as well. The error that showed up was:

An error occurred while rendering  navigation for requested  URL: /sites/<toplevelsite>/<variation>. Exception message: Object reference not set to an instance of an object. Stack trace: at Microsoft.SharePoint.publishing.publishingpage.geteffectivepagecacheprofileid

 

image

 

In ULS logs, we could see messages like:

Application error when access /_layouts/15/AreaNavigationSettings.aspx, Error=Object reference not set to an instance of an object. 

at Microsoft.SharePoint.Publishing.PublishingPage.GetEffectivePageCacheProfileId(Boolean anonUserProfile)   

at Microsoft.SharePoint.Publishing.CachedPage..ctor(PublishingPage page, SPListItem altItem, String id, String parentId, CachedUserResource title, String url, CachedUserResource description, CachedObjectFactory factory, List`1& fieldInfo)   

at Microsoft.SharePoint.Publishing.CachedPage.CreateCachedPage(PublishingPage page, SPListItem altItem, CachedObjectFactory factory, List`1& fieldInfo)   

at Microsoft.SharePoint.Publishing.CachedListItem.CreateCachedListItem(SPListItem item, SPListItem alternateItem, Boolean parentIsWeb, CachedObjectFactory factory, List`1& fieldInfo)   

at Microsoft.SharePoint.Publishing.CachedObjectFactory.CreateWrappedObject(SPListItem superUserVersion, SPListItem superReaderVersion, List`1& fieldInfo)   

at Microsoft.SharePoint.Publishing.CachedArea.GetChildForListByQuery(String listName, SPQuery query, SPWeb contextWeb, Boolean onlyPopulateCache, Boolean skipIfThrottled, List`1& itemsFetched)   

at Microsoft.SharePoint.Publishing.Navigation.PortalWebSiteMapNode.FetchDynamicItems(PublishingWeb pubWeb, NodeTypes includedTypes, Boolean& websFetched, Boolean& pagesFetched)   

at Microsoft.SharePoint.Publishing.Navigation.PortalWebSiteMapNode.PopulateNavigationChildrenInner(NodeTypes includedTypes)   

at Microsoft.SharePoint.Publishing.Navigation.PortalWebSiteMapNode.PopulateNavigationChildren(NodeTypes includedTypes)   

at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode.GetNavigationChildren(NodeTypes includedTypes, NodeTypes includedHiddenTypes, Boolean trimmingEnabled, OrderingMethod ordering, AutomaticSortingMethod method, Boolean ascending, Int32 lcid)   

at Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaNavigationSettingsPage.AddChildrenToControl(String parentId, PortalSiteMapNode node, Int32 depth, Int32 maxDepth)   

at Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaNavigationSettingsPage.InitializeNavigationEditSort()   

at Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaNavigationSettingsPage.OnLoad(EventArgs e)   

at System.Web.UI.Control.LoadRecursive()   

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

————————————————————————–

System.NullReferenceException: Object reference not set to an instance of an object.  

at Microsoft.SharePoint.Publishing.PublishingPage.GetEffectivePageCacheProfileId(Boolean anonUserProfile)   

at Microsoft.SharePoint.Publishing.CachedPage..ctor(PublishingPage page, SPListItem altItem, String id, String parentId, CachedUserResource title, String url, CachedUserResource description, CachedObjectFactory factory, List`1& fieldInfo)   

at Microsoft.SharePoint.Publishing.CachedPage.CreateCachedPage(PublishingPage page, SPListItem altItem, CachedObjectFactory factory, List`1& fieldInfo)   

at Microsoft.SharePoint.Publishing.CachedListItem.CreateCachedListItem(SPListItem item, SPListItem alternateItem, Boolean parentIsWeb, CachedObjectFactory factory, List`1& fieldInfo)   

at Microsoft.SharePoint.Publishing.CachedObjectFactory.CreateWrappedObject(SPListItem superUserVersion, SPListItem superReaderVersion, List`1& fieldInfo)   

at Microsoft.SharePoint.Publishing.CachedArea.GetChildForListByQuery(String listName, SPQuery query, SPWeb contextWeb, Boolean onlyPopulateCache, Boolean skipIfThrottled, List`1& itemsFetched)   

at Microsoft.SharePoint.Publishing.Navigation.PortalWebSiteMapNode.FetchDynamicItems(PublishingWeb pubWeb, NodeTypes includedTypes, Boolean& websFetched, Boolean& pagesFetched)   

at Microsoft.SharePoint.Publishing.Navigation.PortalWebSiteMapNode.PopulateNavigationChildrenInner(NodeTypes includedTypes)   

at Microsoft.SharePoint.Publishing.Navigation.PortalWebSiteMapNode.PopulateNavigationChildren(NodeTypes includedTypes)   

at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode.GetNavigationChildren(NodeTypes includedTypes, NodeTypes includedHiddenTypes, Boolean trimmingEnabled, OrderingMethod ordering, AutomaticSortingMethod method, Boolean ascending, Int32 lcid)   

at Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaNavigationSettingsPage.AddChildrenToControl(String parentId, PortalSiteMapNode node, Int32 depth, Int32 maxDepth)   

at Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaNavigationSettingsPage.InitializeNavigationEditSort()   

at Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaNavigationSettingsPage.OnLoad(EventArgs e)   

at System.Web.UI.Control.LoadRecursive()   

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

After a lot of troubleshooting (we engaged Microsoft) this was final the resolution to fix the issue:

 

———————————

Resolution:

———————————

§  First, disabled and re-enabled Publishing feature and Navigation feature for all sites using the powershell script  which would loop through all subsites:

Get-SPWeb -site http://server/sites/channel -limit ALL | ForEach-Object {Disable-SPFeature Publishing -Url $_.Url -confirm:$false}

Get-SPWeb -site http://server/sites/channel -limit ALL | ForEach-Object {Disable-SPFeature PublishingWeb -Url $_.Url -confirm: $false}

IISreset

Get-SPWeb -site http://server/sites/channel -limit ALL | ForEach-Object {Enable-SPFeature Publishing -Url $_.Url -confirm:$false}

Get-SPWeb -site http://server/sites/channel -limit ALL | ForEach-Object {Enable-SPFeature PublishingWeb -Url $_.Url -confirm: $false}

 

§ Unchecked following options in the site collection output cache settings:

                Publishing sites can use a different page output cache profile

                Page layouts can use a different page output cache profile

 

image

 

After we disabled, Site OutPut cache, the error disappeared. The reason seems to be that I had not set separate Portal Super User and Portal Super Reader accounts. Instead, SharePoint was trying to application pool account was or service account  to display cached information for every user who opened the page. This was resulting in Navigation to be corrupted.

If you would like to use Output Cache for performance is your site it is recommended to setup object cache user accounts (Portal Super User and Portal Super Reader accounts). Please refer following article for details:

http://technet.microsoft.com/en-us/library/ff758656.aspx

(I tried this at my box, but even after enabling Portal Super User and Portal Super Reader accounts as per above, it did not fix the issue for me. I had to keep the Site Output Cache disabled to Navigation to work )

Advertisements

One response to “SharePoint 2013 – Left Navigation and top Navigation bar does not render links and shows error: “An error occurred while rendering navigation for requested URL”

  1. I have encountered this a lot recently. Typically an IIS reset fixes for me, but good to know the other potential issues.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s