api/SP.UserProfiles.PeopleManager Web Service Error in User Profile REST API
While we were testing the passive SharePoint farm, Developers started to get this error in their REST API calls.It occurred during reading the user information through User Profile “_api/SP.UserProfiles.PeopleManager”
I have verified below
- User Profile Service is up and running
- user Profile Synchronization Service is successfully running on the App Server
- FFM Service successfully running on the server
- Profile Synchronization is successfully executed with Active directory
- My sites Web Application is available.
But Still we got below error on the Browser when we try the service UR
Error
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>
-1, Microsoft.SharePoint.Client.ResourceNotFoundException
</m:code>
<m:message xml:lang="en-US">
Cannot find resource for the request GetProperties.
</m:message>
</m:error>
When I dig in to the ULS Logs I was able to see below detail error messages.
Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.Portal.WebControls.PropertyImage.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at Microsoft.SharePoint.WebControls.AjaxDelta.RenderChildren(HtmlTextWriter output)
at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)
at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
at Microsoft.SharePoint.WebControls.AjaxDelta.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at Microsoft.SharePoint.WebControls.SharePointForm.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
Finally I was able to identify below specific error message
SPMicrofeedContext.SetMySiteHostForContext failed System.UriFormatException: Invalid URI: The URI is empty.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
atMicrosoft.Office.Server.Microfeed.SPMicrofeedContext.SetMySiteHostForContext()
Solution
Based on above Error Message, Finally I have realized issue. My sites are not loading for the users.Because Operations team has re-created the User Profile Service and My Site Web App URL was not mapped in the User Profile Service.
The moment I have specified the My site URL in the User Profile Service Properties, web service Started to work and My sites successfully loaded
Cheers