If you are a SharePoint admin or use, you have probably seen this error message on your SharePoint 2013 MySite Newsfeed:
“We’re still collecting the latest news. You may see more if you try again a little later.”
Hopefully this article will help explain a few common scenarios I have ran into, and how to resolve any errors. Please post if you have any tips or suggestions, as I am always looking for thoughts from the community on this.
This article will address:
- Common reasons for newsfeed data not displaying
- What is distributed cache?
- Distributed cache configuration
- Shutdown/Reboot WFE procedure for maintenance so you don’t lose your cache
- Repopulating cache (if server stopped unexpectedly)
- References
Common reasons for newsfeed data not displaying
-
Someone rebooted all your Distributed Cache servers at the same time
- Check the task manager uptime to see how long the servers with distributed cache have been running, or if they were rebooted unexpectedly
- Fix: Repopulate cache using PowerShell, or maybe wait a long time for new news
- Prevent it from happening again: Shut down one server at a time, stopping the cache first, rebooting, and then starting the cache again.
-
“Everyone” is empty because it only keeps company conversations for 14 days by default.
- Fix: Increase the retention time, or encourage people to post to the company newsfeed (not site newsfeeds). See this article for more information on what appears in site newsfeeds vs company newsfeeds. https://support.office.com/en-za/article/What-items-appear-in-your-newsfeed-bd3d9268-0408-4ad4-bc51-2e4ec5406e16#__toc327280723
-
Distributed cache is not configured right
- Fix: Configure it right J this one is so simple, yet so difficult I find. See configuration below.
What is distributed cache?
Distributed cache is a framework Microsoft uses to quickly host social information in SharePoint within the SP servers ram. This can be enabled on one or many SP servers in your farm.
Official definition can be found on this poster, https://www.microsoft.com/en-us/download/details.aspx?id=35557
What uses distributed cache?
Pretty much anything social, but some of the social data comes from content databases and user profile databases. Company newsfeed posts are stored in distributed cache.
- Newsfeeds
- Authentication
- OneNote client access
- Security Trimming
- Page load performance
Distributed cache configuration
Note: Run any scripts/commands logged in as the SPFarm account, and be sure to run SharePoint Management Shell as administrator if you have UAC enabled (like a good administrator)
Caution: configuration deletes the cache, so you will need to repopulate the cache after configuring it.
Determine servers to host the distributed cache service
Usually the WFE servers, not servers running search or excel. AutoSPInstaller has a limit of 4 servers, but typically it does not configure distributed cache correctly.
Configuring Distributed Cache
There is a good article here on these commands, https://technet.microsoft.com/en-us/library/JJ219613.aspx and probably better than this article I am writing. But it’s very long so I wrote this article to get Admins 90%-100% of the way there.
Here is how I have been configuring distributed cache. Thanks Jon for the help!
-
Use Central Admin or PowerShell to start/stop the SharePoint Distributed Cache service on the desired servers in your farm (usually WFE’s).
-
Or you can use PowerShell to get/start-spserviceinstance of Distributed Cache on the desired servers. I like to use PowerShell to see what servers are running Distributed Cache within my farm:
- Get-SPServiceInstance | where-object {$_.typename -ilike “*distributed*”}
-
Verify Cache service is running on desired servers:
-
Use-CacheCluster
- Note, this command doesn’t configure the server, but just connects the current PowerShell session to manage the cache cluster it’s joined for the PowerShell management session. It’s actually an alias command for Connect-AFCacheClusterConfiguration.
- Get-CacheHost
- You should see each server running distributed cache listed above. If not, there might be more work to configure the cache cluster I may have missed in this post. Let me know!
-
-
Get current configuration
- Get-AFCacheHostConfiguration -ComputerName wfe01 -CachePort “22233”
- The Cache Size can be updated, see guide here https://technet.microsoft.com/en-us/library/JJ219613.aspx#memory . For 16GB of ram on our WFE servers, we go with 819MB (~5% of 16GB). Note, changing this requires the distributed cache service to be stopped on the computer you are changing it on. Update-SPDistributedCacheSize -CacheSizeInMB 819
-
Export config, verify service account for distributed cache, as well as servers.
- Export-CacheClusterConfig -Path C:\test.xml
-
- Check max cache size (default is 5% -, no more than 4GB – size depends on services on the server)
- Check servers – ensure only WFE (or desired servers are in the cluster)
- Check service account – ensure all servers use the same service account (spservice)
- Check ports
- Warning: After configuration is complete do not ever run Add-SPDistributedCacheServiceInstance or Remove-SPDistributedCacheServiceInstance. It reconfigures the cluster (and usually incorrectly)
Shutdown/Reboot WFE procedure
If you have to do reboots on the WFE for Windows Updates, etc., you might be expecting to lose your Newsfeed cache. Here is the proper procedure to retain the cache.
Summary: shutdown the cache one server at a time, reboot that server, add the server back into the cache cluster. Repeat on next server.
-
Verify Cache service is running on desired servers (more than one server too is key):
- Use-CacheCluster
- Get-CacheHost
-
Reboot SQL Server first if needed. Get this out of the way.
- Wait for SQL Server to come back online
-
Reboot WFE1
- Perform these commands on WFE1
-
Verify Cache service is running on desired servers (more than one server too is key):
- Use-CacheCluster
- Get-CacheHost
- Run Stop-spdistributedcacheserviceinstance -graceful
-
Verify Cache service is stopped on WFE1. Ensure it is stopped before proceeding:
- Get-CacheHost
- Reboot WFE1
-
Verify Cache service is running on WFE1:
- Use-CacheCluster
- Get-CacheHost
- If not, go to Central Admin Services on Server and start Distributed Cache service on WFE1, or use PowerShell.
-
Reboot WFE2
- (Repeat above Step #3, but replace WFE1 with WFE2)
-
Verify it is running
-
Verify Cache service is running on desired servers (more than one server too is key):
- Use-CacheCluster
- Get-CacheHost
-
Repopulating cache (if server stopped unexpectedly)
Replace URL with your mysite URL. This script will populate each user’s cache using Update-SPRepopulateMicroblogFeedCache and the entire user profile newsfeed cache using Update-SPRepopulateMicroblogLMTCache. I am not sure if I stole this script from anywhere, but part of it is from various user profile scripts adapted to fix the users feed cache.
Note: Run any scripts/commands logged in as the SPFarm account, and be sure to run SharePoint Management Shell as administrator if you have UAC enabled (like a good administrator). Otherwise you will get a .ctor error that will drive you crazy.
Download the script from here: http://pastebin.com/K9yR2pEk
$proxy
= Get-SPServiceApplicationProxy | ? {$_.Name -ilike
“User Profile Service Application*”}
Update-SPRepopulateMicroblogLMTCache -ProfileServiceApplicationProxy $proxy
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Office.Server”)
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Office.Server.UserProfiles”)
$url
=
“http://mysiteurl.domain.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()
After running the script on each WFE where distributed cache runs, wait 15 minutes for the Newsfeed data to populate.
Then test newsfeed.
References
http://netwovenblogs.com/2014/03/11/the-newsfeed-is-not-working-on-mysite-in-sharepoint-2013/