Home > SharePoint 2010, SharePoint Problems/Issues > Fixing Error: The Site Is Not Valid The ‘Pages’ Document Library is Missing in SharePoint 2010.

Fixing Error: The Site Is Not Valid The ‘Pages’ Document Library is Missing in SharePoint 2010.

Oh the Joy of SharePoint 2010.  You learn something new everyday.  But hey it’s good  job security right?

Anyways I recently exported a sub-site in SharePoint 2010 and re-imported this Site and converted it into a Site Collection, into its own managed path and into it’s own content database.

When you do this, there is some clean up that needs to be done.  This site needed to have the publishing features enabled, but it’s not a ‘true’ publishing site.  So I needed to enabled the Site Collection (SharePoint Server Publishing Infrastructure) feature, and also the Site (SharePoint Server Publishing) feature.

I’m not going to get into detail on the other steps needed to successfully convert a Site to a Site Collection in this blog  but I will blog about those procedure later.

So to make a long story short I was attempting to create a new Publishing Page but was I was receiving CorrelationID errors that prevented me from successfully creating the page.

I took the CorrelationID and searched my SharePoint ULS logs.  Based off this CorrelationID I was given this error:

The site is not valid. The ‘Pages’ document library is missing.
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: Microsoft.SharePoint.Publishing.InvalidPublishingWebException: The site is not valid. The ‘Pages’ document library is missing.

Based off this error I went to check to make sure the ‘Pages’ document library does indeed exists and is not missing.  To my surprise the ‘Pages’ document library was there.  So why am I getting this error?  I was a little confused.

This error is due to the Publishing feature storing a unique ID of the Pages library in the __PagesListId property which resides in the property bag of the publishing site.

The above listed error will occur if the value stored in the __PagesListId does not match the ID of the actual Pages library.

So somewhere between the Export/Import of the Site it lost its unique ID.

To fix this error you can run a PowerShell script to reassign/update the correct unique ID.

Below is the PowerShell script that will fix this problem.


$web = get-spweb http://portal/path-to-affected-site
$correctId = $web.Lists[“Pages”].ID
$web.AllProperties[“__PagesListId”] = $correctId.ToString()


After running the script I attempted to create the Publishing Page again and it was created successfully with no error.

I’ve only seen this error happen with an Export/Import of Sites to Site Collections in SharePoint 2010.

  1. No comments yet.
  1. No trackbacks yet.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: