In SharePoint 2013, the Newsfeed relies on data cached in the distributed cache service which behind the scenes is using the appfabric cluster service. Newsfeed data is lost when you restart a server in your farm running this service without doing a graceful shutdown (http://technet.microsoft.com/en-us/library/jj219613.aspx#graceful).
Stop-SPDistributedCacheServiceInstance -Graceful Remove-SPDistributedCacheServiceInstance
Sometimes you have to restart all servers in the farm and then your newsfeed will be empty. There is a timer job that runs every 5 minutes called “Feed Cache Repopulation Job” which according to this website http://technet.microsoft.com/en-us/library/jj219560.aspx is supposed to autopopulate the newsfeed cache from the content stored in SharePoint. Our SharePoint 2013 farm is on the March 2013 PU and this job did not seem to be repopulating the cache.
The article seemed to imply you could run some powershell scripts as well to accomplish the same thing. I tried these:
Update-SPRepopulateMicroblogLMTCache Update-SPRepopulateMicroblogFeedCache
The parameter for the first one was easy, just pass in your UPA proxy. The second one also needed this proxy but it could also include an account name or a site url (http://technet.microsoft.com/en-us/library/jj219749.aspx). The wording states that when using the account name use the “user account name for the user profile service application”. I took this to mean the UPA service account. I tried that and even after waiting several hours, there still wasn’t any repopulation. So I tried the site url option passing in the mysite host url. Still nothing.
I finally figured out after using reflector on the source code that the account name it was expecting was an account of a user to repopulate THAT user’s information. I updated my script to the code below to run the Update-SPRepopulateMicroblogFeedCache for EACH user in the UPA and my newfeed cache started coming back to life!
$proxy = Get-SPServiceApplicationProxy | ? {$_.Name -eq "MySite User Profile Service"} Update-SPRepopulateMicroblogLMTCache -ProfileServiceApplicationProxy $proxy [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles") $url = "https://mysite.company.com" $contextWeb = New-Object Microsoft.SharePoint.SPSite($url); $ServerContext = [Microsoft.Office.Server.ServerContext]::GetContext($contextWeb); $UserProfileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext); $Profiles = $UserProfileManager.GetEnumerator(); foreach ($oUser in $Profiles ) { if ($oUser.item("SPS-PersonalSiteCapabilities").Value -eq 14 ){ $personalurl = $url + $oUser.item("personalspace").Value Write-Host $oUser.item("AccountName").Value Update-SPRepopulateMicroblogFeedCache -ProfileServiceApplicationProxy $proxy -accountname $oUser.item("AccountName").Value #-siteurl $personalurl } } $contextWeb.Dispose()
The first time through I got a couple of errors so I added the if statement to check for the personalsitecapabilities being equal to 14. After that I got less errors but there still were a few. That’s when I tried going the site url route. I was thinking if I send in the url of a user’s personal site, that it might work better. I didn’t get any errors but it also didn’t repopulate the newsfeed for the users. Oh well…
I now believe that the siteurl parameter is to repopulate the newsfeed cache for any sites that have the newsfeed on the homepage like the new SP 2013 team site template. I know our environment doesn’t have any of these so I skipped this part. I was thinking at some point I will need to figure this out though. Hopefully it won’t involve looping through all sites in my farm but my gut says it will. If someone else has figured out a good solution, please post the powershell code in the comments. Thanks.
Update 3/29/2014:
This issue has been resolved in Service Pack 1 (SP1).
Hi Steve, I’m having similar issues as you. Wondering if you have found a resolution to this.
I still have my case open with MS. They have not provided an automatic fix for this yet. Your best bet is to run the powershell script I provided above whenever you restart the server(s) running the distributed cache.
This issue has now been fixed in Service Pack 1 (SP1).
Thanks for the update Steve, I haven’t tested this yet, but had hoped SP1 resolved this issue.
Hello Steve,
would you please be so Kind to post the link to the News from Microsoft containing the actual info about Fixing the issue. I looked through the description of SP1 but did not find anything about a fix for this issue there.
This would be very Kind of you.
Thank you,
Andy
Andy, that’s the weird thing. They couldn’t find any type of bug report internally regarding this issue. The engineer I talked to actually had it working using the August 2013 CU whereas I was on the March 2013 PU. Other MS engineers were able to repro the issue using RTM and the March 2013 PU. So it seems like the fix was slid in under the covers somewhere and wasn’t properly documented.
Steve, we are running SP1 and i can confirm that this has not been fixed with SP1. Any other ideas??
That is weird, it’s been working pretty well for me. Can you verify that the timer jobs are running? See here: http://technet.microsoft.com/en-us/library/jj219560.aspx#timerjob2
Thank you for the starter piece, I took it and expanded a bit.
Cool, thanks!
The script wont work. Tried to boot the server but could not get feed of some sites visible until i clicked unfollow/follow.
Check the Proxy name variable and ensure it matches your environment.
Other than that you can try altering line 57 from:
if ($profile.item(“SPS-PersonalSiteCapabilities”).Value -eq 14 ) {
to:
if ($profile.item(“PersonalSpace”).Value -like “/personal/*” ) {
Yea, the script only repopulates the user feeds, not the site feeds. There are some different powershell for that.
Also running SP1 with Sept 2014 CU, and restarting every night to backup the farm virtual machines. Newsfeed still not repopulated automatically. Anyone making progress with this?
That is weird, because since SP1 this has worked correctly for me. I’ve had to restart my servers running my distributed cache service a few times since then and all of my feeds eventually show up again. Now, not everything will show up back up. Some activities such as tag activities and document activities are ONLY written to the cache, and since it’s been wiped, they will not repopulate. See this article: http://technet.microsoft.com/en-us/library/jj219700(v=office.15).aspx
Hi Steve,
may be you can give a hint to look for:
Some probs with User profile sync.
I can access “Manage User Properties” through the individual tenant admin site. Accessing through central administration a error is thrown.
Application error when access /_layouts/15/MgrProperty.aspx, Error=UserProfileApplicationNotAvailableException_Logging :: UserProfileApplication.PartitionProperties does not have paritionID0c37852b-34d0-418e-91c6-2ac25af4be5b at Microsoft.Office.Server.Administration.UserProfileApplication.PartitionPropertiesCache.GetPartitionProperties(Guid partitionID)
Due some problem during installation/ setup I had some ou twice. Due lack of possibilties I delete then manually from the database. Can this be problem? And if how to “clean it up”.
Thanks
Bernhard
Hi Steve,
Thanks for this great blog-post. We also do have SP1 installed and have troubles with lost feeds.
You told that the script above only repopulates the user feeds and not site feeds. Do you have an example for repopulating also the site feeds?
Could not find a script for this… Thanks in advance.
Regards,
Simon
Hi Steve,
I am facing the issue in Newsfeed , I have activated Feature required for the newsfeed. however though i am still getting error “SharePoint returned the following error: A required SharePoint feature is not enabled. Internal type name: Microsoft.Office.Server.Microfeed.MicrofeedException. Internal error code: 46. Contact your system administrator for help in resolving this problem.” Eventvwr log details: The Execute method of job definition Microsoft.Office.Server.UserProfiles.LMTRepopulationJob (ID 09695e4b-e5aa-409f-9891-79548e454c67) threw an exception. More information is included below.
Unexpected exception in FeedCacheService.BulkLMTUpdate: Region not found..
My SharePoint server is updated with September CU . I have tried various option including your script to repopulate user feeds.
Other Options are detaching distrubuted services and adding it back.
Our server –> SharePoint + SQL + PHA .
I have been struggling on this for about 2 weeks time. Your help would be saving me. Thanks in advance