Friday, November 20, 2009

‘Unknown Error’ when attempting to activate the Publishing Site Collection Feature in SharePoint

Jeremy Williams, Sr. Director, Modern Workplace

Have you ever created a SharePoint site that doesn’t have the Publishing Infrastructure features enabled by default, and later attempt to activate them, only to be met with a cryptic error?  Typically, this is as easy as navigating to Site Actions – Site Settings – Site Collection Features - Office SharePoint Server Publishing Infrastructure; then click ‘Activate’.   However, if your deployment of SharePoint is using a multitude of service accounts (as per best practices) or you have a somewhat customized deployment of SharePoint, you may get the most annoying ‘Unknown Error’ screen after clicking on Activate. 

Luckily, the fix for this is pretty straightforward since it’s a permissions issue in SQL.  First, navigate to your SharePoint server and open the Event Viewer – Application Log.  You’re looking for an error similar to the one below (to find it easily, try activating the feature right before you open the log).

From the error message properties, you can see the database name that SharePoint is attempting to access in order to activate Publishing.  Before you go anywhere, make sure you know the service account that is running your web application.  Hop on over to your SQL Server and open SQL Management Studio; grant the web-application service account db_owner privileges.  Restart IIS so SharePoint can reconnect to the DB, then you’re free to activate Publishing. 

If you don’t want to leave that user account with db_owner privileges, you can go back into SQL Management Studio after the feature activate and retract those permissions.