Getting access denied trying to start appfabric cache cluster from powershell

William picture William · Sep 7, 2011 · Viewed 21k times · Source

I have some code that uses appfabric and was getting server unavailability errors. Following the instructions at http://msdn.microsoft.com/en-us/library/ff921031.aspx I found that my cache cluster was down. I opened up powershell as an administrator and ran Start-CacheCluster. After a few minutes I receive an error message:

Start-CacheCluster : Could not start cluster: ErrorCode<ERRCAdmin025>:SubStatus
<ES0001>:Time-out occurred in starting the cluster.
At line:1 char:19
+ Start-CacheCluster <<<<
    + CategoryInfo          : NotSpecified: (:) [Start-CacheCluster], DataCach
   eException
    + FullyQualifiedErrorId : ERRCAdmin025,Microsoft.ApplicationServer.Caching
   .Commands.StartCacheClusterCommand

Checking the event logs reveals this:

Service cannot be started. System.TypeInitializationException: The type initializer for 'Microsoft.ApplicationServer.Caching.ConfigManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.Fabric.Common.ConsoleSink' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Access to the path 'C:\Windows\System32\AppFabric\DistributedCacheService.exe.config' is denied. (C:\Windows\System32\AppFabric\DistributedCacheService.exe.config) ---> System.UnauthorizedAccessException: Access to the path 'C:\Windows\System32\AppFabric\DistributedCacheService.exe.config' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBU...

Has anyone with more AppFabric experience seen this before?

-Thanks

Answer

David Pokluda picture David Pokluda · Sep 8, 2011

Try Microsoft, Windows, Application Server-System Services and Admin log. Sometimes this log will give you some more info that is not present in the regular eventlog. For more information about cache cluster monitoring see Health Monitoring Tools.

Regarding your issue. The only think I would say is that after starting the cache cluster it loads configuration and because it fails, it will eventually crash the AppFabric Caching Service (you will see that information in the eventlog mentioned above).

Make sure you have AppFabric Caching Service configured to run under an account that has access to the configuration file DistributedCacheService.exe.config as well as to the configuration repository (Velocity configuration DB or configuration XML).