AppFabric unable to create a DataCache (LMTRepopulationJob FAILS)

9.3k views Asked by At

Well first of all, I am learning sharepoint 2013 and I have been following a few tutorials, so far I just setup a farm and everything seems to be working properly except for this service that is being logged into the event viewer every 5 minutes:

The Execute method of job definition Microsoft.Office.Server.UserProfiles.LMTRepopulationJob (ID 1e573155-b7f6-441b-919b-53b2f05770f7) threw an exception. More information is included below.

Unexpected exception in FeedCacheService.BulkLMTUpdate: Unable to create a DataCache. SPDistributedCache is probably down..

I found out that this is a job that is configured to execute every 5 minutes

enter image description here

But regarding the assumption that the SPDistributedCache is probably down, I already verified it and it is running

enter image description here

enter image description here

As you can see, it is actually running, also I checked the host cache via SP powershell (get-cachehost and get-cacheclusterhealth) and still all seems fine

enter image description here

Yet when I execute the command get-cache I am getting only the default value, and for what I have read there should be listed another cache types like:

DistributedAccessCache_XXXXXXXXXXXXXXXXXXXXXXXXX DistributedBouncerCache_XXXXXXXXXXXXXXXXXXXXXXXX DistributedSearchCache_XXXXXXXXXXXXXXXXXXXXXXXXX DistributedServerToAppServerAccessTokenCache_XXXXXXX DistributedViewStateCache_XXXXXXXXXXXXXXXXXXXXXXX

Among others which I think probably should include DataCache

enter image description here

Until now I already tried a few workaround but without success

Restart-Service AppFabricCachingService
Remove-SPDistributedCacheServiceInstance
Add-SPDistributedCacheServiceInstance
Restart-CacheCluster

Even this script that it seems to work on many cases to repair the AppFabric Caching Service

$SPFarm = Get-SPFarm
$cacheClusterName = "SPDistributedCacheCluster_" + $SPFarm.Id.ToString()
$cacheClusterManager = [Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheClusterInfoManager]::Local
$cacheClusterInfo = $cacheClusterManager.GetSPDistributedCacheClusterInfo($cacheClusterName);
$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername}
$serviceInstance.Delete()
Add-SPDistributedCacheServiceInstance
$cacheClusterInfo.CacheHostsInfoCollection

Well if anyone has any suggestion, I will appreciate very much, thank you in advance!

3

There are 3 answers

0
Craig On BEST ANSWER

This is a generic error message, meaning that the real issue isn't known (hence the word "Probably").

I believe that the key to solving this problem when it is not the Probably , is in looking in the ULS log for the events that have occurred just before it. Events of type "Unexpected", do not appear in the events log and are often seen before a generaic type of error.

In many cases you might see something like "File not Found". This usually means that the noted file is not in the assembly cache. Since the distributed Cache utilizes the AppFabric, which is outside of Sharepoint, then the only way for Sharepoint to find it's file, is to look in the assembly cache. The sharepoint pre Installer should have put the files there, but it might have failed or maybe someone uninstalled the App Fabric and re Installed it manually, which would have removed the files from the assembly and not put them back.

2
Keven Scharaswak On

have you changed the distributed cache account from the farm account? what build number are you on? is this a single server farm?

off the top of my head, the only thing left is this:

Grant-CacheAllowedClientAccount -Account "domain\ProfileserviceWebAppIdentity"

i would do an iisreset and restart the owstimer service after you run this command.

0
Ramiro Mosquera On

Before Restart-CacheCluster you could specify the connection to your SharePoint Database (The catalog name could be not the same)

Use-CacheCluster -ConnectionString "Data Source=(SharePoint DB Server)
\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;
Integrated Security=True" -ProviderType System.Data.SqlClient

NOTE: It doesn't work permanently

NOTE 2: If you don't have named instance on DB Server, just put the name of your server without "\".

If you don't have a catalog, you could follow this script

***
Remove-Cache default
New-Cache SharePointCache
Get-CacheConfig SharePointCache
Set-CacheConfig SharePointCache -NotificationsEnabled True
***
New-CacheCluster -Provider System.Data.SqlClient -ConnectionString  "Data     Source=(SharePoint DB Server)\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True" -Size Small

Register-CacheHost -Provider System.Data.SqlClient -ConnectionString  "Data Source=(SharePoint DB Server)\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True"  -Account "Domain\spservices_account" -CachePort 22233 -ClusterPort 22234  -ArbitrationPort 22235 -ReplicationPort 22236 -HostName  [Name_of_your_server]

Add-CacheHost -Provider System.Data.SqlClient -ConnectionString  "Data Source=(SharePoint DB Server)\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True" -Account "Domain\spservices_account"

Add-CacheAdmin -Provider System.Data.SqlClient -ConnectionString  "Data Source=(SharePoint DB Server)\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True" 

Use-CacheCluster

You could specify or check your database configuration in regedit

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppFabric\V1.0\Configuration

Look for ConnectionString string value, and set your connection string

Data Source=(SharePoint DB Server)\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True

To query the status of the server you could use:

Get-SPServiceInstance | ? {($_.service.tostring()) -eq “SPDistributedCacheService Name=AppFabricCachingService”} | select Server, Status
Get-SPServer | ? {($_.ServiceInstances | % TypeName) -contains "Distributed Cache"} | % Address
Get-AFCache | Format-Table –AutoSize
Get-CacheHost

Aditional: If you need to change your service account, you could do this procedure:

$f = Get-SPFarm
$svc = $f.Services | ? {$_.Name -eq "AppFabricCachingService"}
$acc = Get-SPManagedAccount -Identity "Domain\spservices_account"
$svc.ProcessIdentity.CurrentIdentityType = "SpecificUser"
$svc.ProcessIdentity.ManagedAccount = $acc
$svc.ProcessIdentity.Update()
$svc.ProcessIdentity.Deploy()