Post-October 2011 CU- Running the 'Update-SPProfilePhotoStore' PowerShell command fails with a 'The pipeline has been stopped' error

After you apply the October2010 Cumulative Update for SharePoint Server 2010 (14.0.6112.5000), the profile picture import can run into some issues.

  1. Profile picture is not imported or updated after running a full synchronization.

The ULS logs will show the following entry:

SavePictureToLibrary: Error processing the photo URL picture_GUID.jpg for user 1: System.UriFormatException: Invalid URI: The hostname could not be parsed. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri.CreateUri(Uri baseUri, String relativeUri, Boolean dontEscape) at System.Uri..ctor(Uri baseUri, String relativeUri) at Microsoft.SharePoint.WebPartPages.Utility.CanonicalizeFullOrRelativeUrlCore(String fullOrRelativeUrl, Boolean includeQueryString, Boolean& isFullUrl) at Microsoft.SharePoint.SPWeb.GetList(String strUrl) at Microsoft.Office.Server.UserProfiles.UserProfileGlobal.LoadPictureLibrary(SPWeb rootWeb, ProfileType profileType) at Microsoft.Office.Server.UserProfiles.UserProfileGlobal.GetOrCreatePictureFolder(UserProfileManager userProfileManager) at Microsoft.Office.Server.UserProfiles.UserProfileGlobal.SaveImportedPictureToLibrary(UserProfileManager userProfileManager, Int64 recordId, Byte[] binaryPicture)

      2.    Additionally, the PowerShell command 'Update-SPProfilePhotoStore' to fix the existing pictures and library also fails.

Here's the command that is run to fix the issue with existing pictures:

  Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation https://mysite

However, it fails with an error that looks something like this:

Update-SPProfilePhotoStore : The pipeline has been stopped
At line:1 char:27
+ Update-SPProfilePhotoStore <<<< -CreateThumbnailsForImportedPhotos $true -MySiteHostLocation "https://<MySiteURL> "
+ CategoryInfo : InvalidData: (Microsoft.Offic...ofilePhotoStore:SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], PipelineStoppedException
+ FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletUserProfilePhotoStore

Update-SPProfilePhotoStore : Invalid URI: The hostname could not be parsed.
At line:1 char:27
+ Update-SPProfilePhotoStore <<<< -CreateThumbnailsForImportedPhotos $true -MySiteHostLocation "https://<MySiteURL> "
+ CategoryInfo : ObjectNotFound: (:) [Update-SPProfilePhotoStore], UriFormatException
+ FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletUserProfilePhotoStore

image

So far, the issue seems to be limited to environments where the my site is hosted on a root site collection (' / ').

In order to fix this, follow the steps listed below:

  • Create new site collection under the root of MySite web and specify the new URL in MySite host settings under the User profile Service Application settings
  • Access the MySite and you should be directed to the new URL for my site.
  • Upload a picture on to your profile page and it should be successful.
  • You should be able to run the 'Update-SPProfilePhotoStore' PowerShell command to fix the existing pictures and libraries. 

Update

The December 2011 CU should do the trick. Here are the links: 

KB.2597058 - SharePoint Foundation 2010

KB.2597014 - SharePoint Server 2010

The build number of the cumulative update package is 14.0.6114.5000

 After you install this hotfix, you must restart the User Profile Synchronization Service for profile synchronization to function correctly.

 Apply the update and the PowerShell script should work again.