Thank you for reaching out to Microsoft Q&A
Based on my research, the Distributed Cache service instance on one or more servers has entered an inconsistent state where the SharePoint Configuration Database believes the service is Provisioning or Unprovisioning, but the underlying Windows Service (AppFabric) has stalled.
This creates a mismatch object in the configuration database:
- Cannot be Removed: Standard
Remove-SPDistributedCacheServiceInstancecommands fail because the object is locked in a "failed" status transition. - Cannot be Added:
Add-SPDistributedCacheServiceInstancefails because the stale object ID still exists, preventing a new instance from being created on the same server.
Given this, to resolve this, you can try the approach below:
1. Stop the Windows Service Manually
Sometimes the SharePoint Timer Service is waiting for the Windows Service to stop.
- Open
Services.mscon the affected server. - Find AppFabric Caching Service.
If it is Running or stopping, force it to Stop.
2. Clear the Configuration Cache
- This forces the local server to re-read the object state from the database, which might clear a local "stale" lock.
- Stop the SharePoint Timer Service on all servers.
- Delete the XML files in
%ProgramData%\Microsoft\SharePoint\Config\<GUID>\(DO NOT delete cache.ini). - Edit
cache.iniand set the number to 1 then start the SharePoint Timer Service on all servers.
Hope my answer will help you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.