SharePoint 2013 Following sites not working
I found an interesting issue in one of my SharePoint 2013 environments related to following sites. When a regular user clicks on the “Follow” button displayed in the top right corner of the screen the user will get an error.
If you look into the ULS log you will find the following error:
SQL Database ‘Databasename’ on SQL Server instance ‘InstanceName’ not found. Additional error information from SQL Server is included below. Cannot open database “Databasename” requested by the login. The login failed. Login failed for user ‘Domain\Username’.
Interesting about this issue is, that the account which doesn’t have permission to open the database is the application pool identity of the portal webapplication in which the site lives which the user would like to follow.
The Mysites reside in a different webapplication then the site the user wants to follow.
After a little investigation I tried to set the “GrantAccessToProcessIdentity” for the mysite webapplication for the applicationpool identity of the webapplication where the site the user want to follow resides in.
For that I used the below Powershell, which grants the account specified connect permissions on the database level. (This was also used in my previous blogposts “PowerPoint / Word WebApps–PowerPoint / Word WebApp cannot open this presentation / document” and “Excel calculation services–The Workbook can not be opened” to grant the proper permissions)
$webApp = Get-SPWebApplication “YourWebapp”
After running this I double-checked the permission of the database in SQL and found the permissions granted to the account as expected. When the user now tries to follow a site everything works as expected.
I don’t know if this is the proper way to solve this issue, I have encountered it only once due to the fact that it is still very early in the SP2013 implementation timeframe, I just wanted to share my experiences with this issue and will continue to keep my eyes open. If you experience the same problems please let me know.