I came up with this error when I manually created a ‘Pages’ library and was trying to create New page in the library.
The site is not valid. The ‘Pages’ document library is missing. at Microsoft.SharePoint.Publishing.PublishingWeb.get_PagesList()
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.BaseP….…agesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The issue is that the ‘Pages’ library is created automagically by a Team Site template but not with a Blank Site template. My quickie solution was to recreate the new site that I was just starting and use the Team Site template instead of the Blank template and just remove the other components that I did not need.
I am sure there is a better way but I’ll look for it later. Expedience is, as always, the driver.