Symptoms:
- Response was extremely slow
- Only affecting a single Site Collection
- No errors in the Event Viewer
- Still able to browse the site structure through SharePoint Designer
- Errors on the screen said something like:
- Error occurred while rendering navigation requested url
- An unexpected error occured while manipulating the navigational structure of this Web.
- Noticed that, when a page did load, it had dozens (hundreds?) of Navigation nodes on Current navigation and Global Navigation
Suspected Cause:
Thought that maybe the reason this was
taking so long to load a page, was that the Navigation is corrupt and it was
trying to build out this enormous navigation structure.
To fix:
Open PowerShell on the server, check the size of those
objects at the top level:
$siteUrl = "http://WebAppURL/sites/scname"
$spWeb = Get-SPWeb $siteUrl
$spWeb.Navigation.QuickLaunch | ft Title
$spWeb.Navigation. TopNavigationBar | ft Title
Then, if this looks like the problem, delete the QuickLaunch
Nodes, then delete the TopNavigationBar Nodes, as required:
$siteUrl = "http://WebAppURL/sites/scname"
$spWeb = Get-SPWeb $siteUrl
Foreach($node in ($spWeb.Navigation.QuickLaunch))
{
write-host
"The node title is "$node.Title
$node.Delete()
}
$spWeb.Dispose()
$siteUrl = "http://WebAppURL/sites/scname"
$spWeb = Get-SPWeb $siteUrl
Foreach($node in ($spWeb.Navigation.TopNavigationBar))
{
write-host
"The node title is "$node.Title
$node.Delete()
}
$spWeb.Dispose()
Note that I had to run these commands several times.
It looked like it would delete 80% of them, then get an error. If this
happens, then just run it again:
Add caption |
excellent......can you please tell me what line from ULS log suggested you that there is some issue the Top and Left Nav...:)
ReplyDeleteExcellent. This helped me resolve the same issue. Not sure how it can prevented, though. The page that was causing issues for me had commas "," in the filename. I had to delete the page using SharePoint Manager in order to get the script to run faster.
ReplyDeleteThanks you. This fixed the problem on our SharePoint farm.
ReplyDeleteNo worries Arun. Happy to be of assistance. :)
DeleteIt works like a charm. Thank You.
ReplyDeleteI <3 U thank you so much!!!
ReplyDeleteYes. It worked for me too. Thank you for your post.
ReplyDeleteSuperb solution! worked for me too.. Thanks a lot!
ReplyDeletethx man ! my dev was really slow because of this, gave me headach for 1 week
ReplyDeleteactually if i run the script again it still shows me the pages, as if the db was not updated... but at least the site is not slow anymore and the navigation page is loading.
DeleteThe recommended solution is to install CU April 2013, or SP2013 SP1 ! I will give it a try
Thank you all lot. You've saved my life
ReplyDeleteThank you all lot. You've saved my life
ReplyDelete