11

I have setup a development environment for SharePoint 2013 so we can begin testing our 2010 content, however I am running into trouble starting the Distributed Cache service. Note that this is currently a clean install, there is no 2010 content or installation. We are using Server 2012, SQL Server 2012 (v11.0.2100) and SharePoint 2013. AppFabric 1.1 was installed as a prerequisite for Sharepoint 2013.

Looking at the Windows Server Services, I can see that the AppFabric Caching Service is Running.

I have ensured that AppFabric is installed and configured correctly, and have setup a network share, however, when I go to start the Distributed Cache service, I get the error:

cacheHostInfo is null

When digging into the logs using the correlation id, I end up with this line here:

A failure occurred in SPDistributedCacheServiceInstance::Provision. cacheHostInfo is null for host 'my_server_name'.

where my_server_name is the name of the dev server.

I looked at the AppFabric Config wizard, and it states "This machine is a part of an AppFabric Caching cluster." So according to AppFabric, it is all setup, and the network share is linked correctly.

The service is linked to a user account which I have created for this purpose and have given it the permissions required through Local Security Policy (Bypass traverse checking, Generate security audits, Log on as a service). This user has been granted access to the network share.

Is there anything else I need to check or try to get this running? Or has anyone seen this error before?

4
  • Even I am facing the same issue, i set the cachesize to 300 MB but still not working. I am running standalone sharepoint solution on 8Gb ram Machine. My search service is not working because of it. Everytime i start the service it gives me the "cacheHostInfo is null" error. I tried via UI as well as powershell, but same error. Any Help on this?
    – user14456
    Jan 28, 2013 at 9:59
  • Hi Dhaval, I ended up doing three things to resolve this. Ensure enough RAM is free when running normally (as per answer below), remove and re-install AppFabric (Install file here: microsoft.com/en-us/download/details.aspx?id=27115), and set the cache to use 100Mb. Hope this helps. Jan 29, 2013 at 0:02
  • Thanks Chris. How much memory/RAM should be fine for the stand alone server ?
    – user14561
    Jan 31, 2013 at 17:13
  • As mentioned below, the minimum would be 8Gb RAM and a 4 core processor. This seems to be fine for me, but look at how much you will be doing with the server to make sure. (I only have a few small sites on there right now, running OOB features) Jan 31, 2013 at 22:54

7 Answers 7

4

Follow the steps from Plan and use the Distributed Cache service in SharePoint Server 2013 under the section titled "Repairing a Cache Host".

-Run Get-SPServiceInstance to find the GUID in the ID section of the Distributed Cache Service that is causing an issue.

-Run these commands:

$s = get-spserviceinstance GUID 
$s.delete()

-Recreate the Service with this command:

Add-SPDistributedCacheServiceInstance
2
  • +1 for providing a supported solution. I will see if I can jump onto my old VM and confirm the fix when I have time Jul 3, 2013 at 22:11
  • 1
    Finally got back to looking at this, as we will be starting our upgrades to SP2013 in the next few months. It works like a charm. Thanks for the info, should help others with this in future. Jan 9, 2014 at 11:12
7

When you install the SharePoint 2013 it installs the service by default and assigns the Distributed Cache service 10 percent of the total physical memory on the server (see more details)

It might be you'r having less memory on your SP Installation. So you might need to update the distributed Cache Service to specify the amount of RAM or increase the RAM for overall SP installation.

Update: Just did a small PS script that delete and re provisions the service again:

$Farm = Get-SPFarm
$Name = "SPDistributedCacheCluster_" + $Farm.Id.ToString()
$Manager = [Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheClusterInfoManager]::Local
$Info = $Manager.GetSPDistributedCacheClusterInfo($Name);
$instance ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.Service.Tostring()) -eq $instance -and ($_.Server.Name) -eq $env:computername}

if([System.String]::IsNullOrEmpty($Info.CacheHostsInfoCollection))
{
    $serviceInstance.Delete()
    Add-SPDistributedCacheServiceInstance
    $Info.CacheHostsInfoCollection
} 
10
  • I have made the change to the cache size using the PS command Update-SPDistributedCacheSize -CacheSizeInMB 250. I have then attempted to provision the cache again, however I am still getting the same error, whether I use PS or the web interface. Are you aware of any way to verify the current cache size? Jan 3, 2013 at 22:44
  • Can you try setting the cache size to 100MB? Jan 3, 2013 at 22:45
  • Thanks for your help so far, it seems that the 100MB cache is still not starting, with the same error message 'cacheHostInfo is null'. I also tried 50 and 150 MB. This shouldn't really be a problem though, as I have had 3Gb of free RAM on the machine. Jan 7, 2013 at 21:12
  • how much have you assigned to the whole development enviroment? Jan 7, 2013 at 22:06
  • I have assigned 6GB total for the server Jan 7, 2013 at 22:36
0

I hope it could help you to find out what the problem is

http://rakasatria.wordpress.com/2013/02/04/sharepoint-2013-spdistributedcacheserviceinstance-cachehostinfo-is-null/

really hope that it could help you.

Regards, Raka

3
  • While this may theoretically answer the question, we prefer inclusion of the essential parts of the answer here, and to provide the link for reference. See answer for general guidelines.
    – SPDoctor
    Feb 7, 2013 at 16:34
  • Hi Raka, As I had an old version of the server instance that still has this problem, I fired it up and tried your script. Unfortunately it has not resolved the core issue, but thanks for your suggestion. Feb 7, 2013 at 21:24
  • This link no longer works
    – Steven
    Jul 12, 2017 at 15:20
0

I have noted the common issues and solutions w.r.t distributedcache http://sharepointjournal.com/2014/08/19/sharepoint-2013-distributed-cache-boon-or-bane/

0

The marked answer is absolutely correct and works. However, there is one thing that can be a nightmare to you and the suggested answer will not work.

I had the same problem and my Distributed Cache was not working. The AppFabric cache stayed in Disabled state. Even after recreating the farm multiple times and clean installations, it didn't work. When i ran below command, it worked without any error. The GUID is the ID of the service. (See Marked Answer).

$s = get-spserviceinstance GUID 
$s.delete()

But when i tried to run below command, it said that the Host Name is already present in cluster.

Add-SPDistributedCacheServiceInstance

The below command didn't work for me even a single time.

Remove-SPDistributedCacheServiceInstance

I keep getting multiple wired error, i manually put the stuff in registry, force started the DCS in SharePoint and it took me nearly a month to troubleshoot the issue but still no result.

Finally, i came to a blog and below commands helped to solve my issue. I had to manually Unregister cache host and and the add it again. It worked like a charm.

Unregister-CacheHost -HostName "PROVIDE YOUR SERVER NAME"

Provider Type : SPDistributedCacheClusterProvider

I got provider type and connection string information from Registery 
Path - "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppFabric\V1.0\Configuration"

After running this, run the below command and things should work for you.

Add-SPDistributedCacheServiceInstance

I hope it will save someone's time.

Cheers

0

None of the solutions worked for me. I tried to remove the distributed cache service from the server using the following PowerShell:-

$serviceInstance = Get-SPServiceInstance -Server {SERVERNAME} | ?{$_.TypeName -like "Distributed*"};
$serviceInstance.Delete();
Remove-SPDistributedCacheServiceInstance
Add-SPDistributedCacheServiceInstance

I ended up installing the App Fabric 1.1 Cumulative Update 4 based on Wictor Wilen's blog. Hotfix Link: http://support.microsoft.com/kb/2800726

I did not install Cumulative Update 5 as I have read that there are some issues with it.

The process is (perform on all servers in farm):-

  • Stop Distributed Cache gracefully - Stop-SPDistributedCacheServiceInstance -Graceful
  • Patch by running Cumulative Update install
  • Apply AppSettings to c:\program files\appfabric 1.1\distributedcacheservice.exe.config

    <appSettings><add key="backgroundGC" value="true"/></appSettings>
    
  • Start Distributed Cache Service by running the PowerShell

    $serviceInstance = Get-SPServiceInstance -Server {SERVERNAME} | ?{$_.TypeName -like "Distributed*"};
    $serviceInstance.Delete();
    Remove-SPDistributedCacheServiceInstance;
    Add-SPDistributedCacheServiceInstance;
    

HTH

0

I was able to solve the issue in three steps:

  1. based on: https://swapnilkh.wordpress.com/cachehostinfo-is-null-error-while-starting-distributed-cache-service-from-central-admin/ i removed distributed cache from server with problems:
# Run below command to remove the Distributed Cache Service instance.
Remove-SPDistributedCacheServiceInstance

# If above command fails with below error: cacheHostInfor is null
# Then run below set of commands to delete the service instance.
$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:SERVERNAME}
$serviceInstance.Delete()
  1. In second step I removed in Programs and features: AppFabric 1.1 for windows Server, and restarted server

  2. In third step I runned from Sharepoint installation installation: PrerequisiteInstaller to reinstall AppFabric. Restarted the server.

That solved this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.