Forum Discussion
SharePoint SE - Distributed cache service is not enabled in this deployment.
Hi everyone,
I have been struggling for a few weeks now with a Distributed Cache issue in my SharePoint farm. The service configuration seems completely out of sync between my two Web Front Ends (WFEs).
1 Root Cause / History:
Originally, the Distributed Cache was working perfectly. However, after a Windows Update, both of our original WFE servers broke completely (we couldn't repair them using DISM). Because of this, we built two brand new WFE servers to replace them.
Crucially, because the old servers were broken, we performed the steps in this order:
1. We built and added the two new WFE servers to the farm first.
2. After adding the new ones, we removed the two broken ones using the Configuration Wizard, and subsequently deleted them from Central Administration since they were still showing up.
Because the old servers were never gracefully decoupled from the Distributed Cache before they died and were removed, the internal Distributed Cache configuration in the SharePoint configuration database is now corrupted.
2 Environment & Farm Topology:
• SharePoint Version: SharePoint Subscription Edition (SE)
• OS: Windows Server 2025
• Database: SQL Server 2025
• Topology: 2 Web Application servers (App servers) and 2 brand new Web Front End servers (Server 1 and Server 2).
• Note: All required Distributed Cache firewall ports (22233, 22234, 22235, 22236) are completely open on both servers.
3 The Current Symptoms on the New WFEs:
• Server 1: The Windows Configuration Wizard runs and completes successfully. However, in Central Administration, the Distributed Cache service status for this server is stuck on "Error Stopping".
• Server 2: Distributed Cache does not work at all. Running Get-SPCacheHost prompts for a HostName, indicating it cannot find the host in the cache configuration.
• Cache Health Error: Running Get-SPCacheClusterHealth fails completely with:
ErrorCode<ERRCAdmin040>:SubStatus<ES0001>:Failed to connect to hosts in the cluster
• Health Analyzer Errors:
1. "Distributed cache service is not enabled in this deployment."
2. "Server role configuration isn't correct." (Specifically flagging Server 2).
4 What I Have Tried So Far:
1. Cleaned up old servers from Config: I exported the cache cluster config (Export-SPCacheClusterConfig), manually removed the two old, decommissioned servers from the XML file, and imported it back.
2. Repair via Central Admin: Tried to use the built-in repair and fix options in CA, but without success.
3. Attempted Fix from Microsoft Learn: I followed the steps outlined in this Microsoft Learn thread regarding a renamed server issue: [https://learn.microsoft.com/en-ie/answers/questions/5907941/distributed-cache-not-working-on-a-renamed-sharepo]
4. Forced Deletion on Server 2: Because Remove-SPDistributedCacheServiceInstance failed with a cacheHostInfo is null error, I used PowerShell to force-delete the service instance object on Server 2:
PowerShell
$instanceName = "SPDistributedCacheService Name=SPCache"
$serviceInstance = Get-SPServiceInstance | ? { ($_.Service.ToString()) -eq $instanceName -and ($_.Server.Name) -eq "Server02" }
$serviceInstance.Delete()
5. Re-adding Server 2: When I now try to re-add the instance on Server 2 using Add-SPDistributedCacheServiceInstance, it fails with:
ErrorCode<HostAlreadyPresent>:SubStatus<ES0001>:Host name Server02 is already present in cluster configuration.
6. Configuration Wizard on Server 2: Running the SharePoint Configuration Wizard (PSConfig) on Server 2 fails with:
An exception of type System.InvalidOperationException was thrown. Additional exception information: cacheHostInfo is null.
7. Farm Rejoin: I completely removed Server 2 from the SharePoint farm and added it back again. Unfortunately, this did not resolve the Distributed Cache mismatch.
5 Summary of the Problem:
Server 1 is stuck on "Error Stopping" in CA. Server 2 is completely disconnected from the cache cluster (Failed to connect to hosts in the cluster). SharePoint throws HostAlreadyPresent when trying to add Server 2, but throws cacheHostInfo is null when trying to configure or remove it, while complaining that Server 2's role configuration is incorrect.
Any help would be greatly appreciated!
1 Reply
- MeFromMarsCopper Contributor
Hi Everyone :)
This is how I resolved the issue
# Added the WSS_WPG group and granted it Read permissions. I am not sure if this step is strictly required, but I applied it anyway
HKEYLocalMachine/SYSTEM>CurrentControlSet>Control>SecurePipeServers>Winreg
# Remove Server 2 from Farm
# Add Server 2 to Farm with the rol Front-End
# Export cluster-config to an XML-File
Export-SPCacheClusterConfig -Path "C:\Temp\cacheconfig.xml"
# Remove the server from the config
# Stop the cache service on Server 1, though you can skip this one if you are desperate! :)
Stop-SPDistributedCacheServiceInstance -Graceful
# Stop the SharePoint Timer service, the Administration service and Cluster to pause all activity
Stop-Service "SPTimerV4"
Stop-Service "SPAdminV4"
Stop-SPCacheCluster
#Import clean cluster-config
Import-SPCacheClusterConfig -Path "C:\Temp\cacheconfig.xml"
# Start the Windows SharePoint services and cluster again
Start-Service "SPAdminV4"
Start-Service "SPTimerV4"
Start-SPCacheCluster
# Synchronize the local server configuration with the database
psconfig.exe -cmd upgrade -inplace b2b -wait -cmd applicationcontent -install
# Add SPDistributedCacheServiceInstance again to server 2
Add-SPDistributedCacheServiceInstance
#Chack of the Distributed Cache is listening
netstat -ano | findstr "22233"
# Run Products Configuaration Wizard
# In CA converted the rol to Front-End with Distributed Cache
Voila :)
_/\_