You get the exception below when browsing to your SharePoint site. In my case this happened on a brand new site that I just created.
Server Error in ‘/’ Application.
Object reference not set to an instance of an object.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties() +134
Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs() +44
Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext) +329
Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalAvailable() +44
Microsoft.Office.Server.WebControls.MyLinksRibbon.EnsureMySiteUrls() +60
Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalMySiteUrlAvailable() +15
Microsoft.Office.Server.WebControls.MyLinksRibbon.OnLoad(EventArgs e) +91
….
Searching for this on Google will turn up quite a number of hits. Some people reported that deleting and recreating the User Profile Service Application (UPSA) fixed the issue. However, this isn’t always an option – it certainly wasn’t in my case.
In my case the problem was because the app pool account of the web application did not have permission to the UPSA. I fixed this by:
- Go to Central Admin, then Manage service applications
- Click on the row (not the link) of the UPSA to highlight it
- From the ribbon, click Permissions then grant the app pool account of the web application Full Control (the only option)
- Do not use the Administrators button on the ribbon. Adding the app pool account to the Administrators list did not fix the issue in my case.