Wednesday, October 23, 2013

The site is not valid. The 'Pages' document library is missing. - SharePoint 2010

Recently I was involved in upgrading SharePoint sites from MOSS 2007 SharePoint 2010. After upgrade found that user is not able to create new pages in Page library of publishing sites. But this issue was not present in MOSS 2007. Below is the details on how I resolved the issue.

Issue Description :
I try to create new page in Pages library and it throw an error message with correlation id. Then I looked into log file and below error was associated with correlation id.

Microsoft.SharePoint.Publishing.InvalidPublishingWebException: The site is not valid. The 'Pages' document library is missing.

Root Cause :
 - Publishing Feature is not activated
 - The value stored in "__PageListId" property bag is not same as the actual page library list id

Solution :
 - Make sure publishing feature is active
 - Try to de-activate and re-activate the publishing feature if you see the publishing feature is showing active
 - Run the following PowerShell script to fix the inconsistency of the actual Pages library and try to de-activate and re-activate the publishing feature again.

$web = get-spweb "Affected Site URL"
$correctId = $web.Lists["Pages"].ID
$web.AllProperties["__PagesListId"] = $correctId.ToString()
$web.Update()

Please validate and enjoy !!!

Please post your feedback or queries related to this.


No comments:

Post a Comment