Monday, March 30, 2015

The main causes of failing to enable publishing feature

Last year I submitted a post regrading how to properly disable/re-enable publishing feature. That's not the silver bullet, however.

Recently I got some more trouble shooting tasks. The error message appeared (attached below), when site collection administrators failed to enable publishing feature. After some investigation, I found there were a few possible problems.

1. Some (hidden) OOTB site columns are missing.

2. Some (hidden) OOTB site content types are missing.

3. Some (hidden) content types which are part of publishing feature are assigned to hidden document library, before enabling publishing feature.

4. Some (hidden) document libraries or lists are missing.

These are all caused by disabling publishing feature improperly.  I recommend to rebuild the site collection. But, if really necessary, it's still possible to fix the problem manually.


ULS log:

SPContentTypeBindingElement.ElementActivated(). An error occurred binding content type '0x01010007FF3E057FA8AB4AA42FCB67B453FFC100E214EEE741181F4E9F7ACC43278EE811' to list '/sites/ONEBRAND/_catalogs/masterpage' on web 'http://projectsqa.domain.local/sites/ONEBRAND'.  Exception 'A duplicate content type "Page Layout" was found.'.

Publishing Resources Feature activation failed. Exception: Microsoft.SharePoint.SPException: Provisioning did not succeed. Details: Failed to create the '_catalogs/masterpage' library. OriginalException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.    
 at Microsoft.SharePoint.Publishing.PublishingSite.GetPageLayouts(Boolean excludeObsolete)    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.ConfigureMasterPageGallery(SPList cacheProfiles)     -
 -- End of inner exception stack trace ---    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.ConfigureMasterPageGallery(SPList cacheProfiles)    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.b__0()    
 at Microsoft.Office.Server.Utilities.Security.SecurityUtilities.RunWithAllowUnsafeUpdates(SPWeb web, Action secureCode)    
 at Microsoft.SharePoint.Publishing.CmsSecurityUtilities.RunWithAllowUnsafeUpdates(SPWeb web, CodeToRun secureCode)    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.Provision()    
 at Microsoft.SharePoint.Publishing.PublishingResourcesFeatureHandler.<>c__DisplayClass3.b__0()    
 at Microsoft.Office.Server.Utilities.CultureUtility.RunWithCultureScope(CodeToRunWithCultureScope code)    
 at Microsoft.SharePoint.Publishing.CmsSecurityUtilities.RunWithWebCulture(SPWeb web, CodeToRun webCultureDependentCode)    
 at Microsoft.SharePoint.Publishing.PublishingResourcesFeatureHandler.FeatureActivated(SPFeatureReceiverProperties receiverProperties).

Feature receiver assembly 'Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c', class 'Microsoft.SharePoint.Publishing.PublishingResourcesFeatureHandler', method 'FeatureActivated' for feature 'aebc918d-b20f-4a11-a1db-9ed84d79c87e' threw an exception: Microsoft.SharePoint.SPException: Provisioning did not succeed. Details: Failed to create the '_catalogs/masterpage' library. OriginalException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.    
 at Microsoft.SharePoint.Publishing.PublishingSite.GetPageLayouts(Boolean excludeObsolete)    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.ConfigureMasterPageGallery(SPList cacheProfiles)     -
 -- End of inner exception stack trace ---    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.ConfigureMasterPageGallery(SPList cacheProfiles)    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.b__0()    
 at Microsoft.Office.Server.Utilities.Security.SecurityUtilities.RunWithAllowUnsafeUpdates(SPWeb web, Action secureCode)    
 at Microsoft.SharePoint.Publishing.CmsSecurityUtilities.RunWithAllowUnsafeUpdates(SPWeb web, CodeToRun secureCode)    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.Provision()    
 at Microsoft.SharePoint.Publishing.PublishingResourcesFeatureHandler.<>c__DisplayClass3.b__0()    
 at Microsoft.Office.Server.Utilities.CultureUtility.RunWithCultureScope(CodeToRunWithCultureScope code)    
 at Microsoft.SharePoint.Publishing.CmsSecurityUtilities.RunWithWebCulture(SPWeb web, CodeToRun webCultureDependentCode)    
 at Microsoft.SharePoint.Publishing.PublishingResourcesFeatureHandler.FeatureActivated(SPFeatureReceiverProperties receiverProperties)    
 at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)

Windows events log:

Event log message was: 'Failed to create the '_catalogs/masterpage' library.'. Exception was: 'System.NullReferenceException: Object reference not set to an instance of an object.    
 at Microsoft.SharePoint.Publishing.PublishingSite.GetPageLayouts(Boolean excludeObsolete)    
 at Microsoft.SharePoint.Publishing.Internal.RootProvisioner.ConfigureMasterPageGallery(SPList cacheProfiles)'




No comments:

Post a Comment