Getting access denied trying to start appfabric cache cluster from powershell
Asked Answered
M

6

6

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

Module answered 7/9, 2011 at 19:54 Comment(0)
B
9

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).

Berndt answered 8/9, 2011 at 3:0 Comment(1)
Granting the service account permission to the DistributedCacheService.exe.config file located under \Program Files\AppFabric 1.1 for Windows Server\ did the trick for me. Thanks Dave!Detain
R
5

You need to run the "Caching administration Windows PowerShell" as Administrator.

Radioactivity answered 12/9, 2011 at 13:42 Comment(0)
P
4

Have you checked that the AppFabricCachingService logon has read access to DistributedCacheService.exe.config?

In my case, I am using an XML provider and have a config share named "CacheConfig". My server is not joined to a domain so I have configured a local "AppFabric" user for the cache host. I am using PowerShell to script the config:

Register-CacheHost -Provider XML -ConnectionString "\\MY-HOST\CacheConfig" -Account "AppFabric" -CachePort 22233 -ClusterPort 22234  -ArbitrationPort 22235 -ReplicationPort 22236 -HostName MY-HOST
Add-CacheHost -Provider XML -ConnectionString "\\MY-HOST\CacheConfig" -Account "AppFabric"
#...
Start-CacheCluster
#...

When I ran the script the Start-CacheCluster statement failed with the same access denied error as in your question. I then checked the AppFabricCachingService logon and found it was set to NETWORK SERVICE. When I checked the file permissions on C:\Windows\System32\AppFabric\DistributedCacheService.exe.config, I found that there was a read permission for the AppFabric user, but no permissions for NETWORK SERVICE. This indicates to me that the Register-CacheHost or Add-CacheHost applet assumes that the cache host account and the service account will be the same.

In my case I added a read permission to the file for NETWORK SERVICE and that fixed the problem.

Peyote answered 27/3, 2012 at 0:29 Comment(0)
I
0

The following isn't your exact problem, but may help: http://social.msdn.microsoft.com/Forums/en-US/velocity/thread/4fd844f6-3530-4115-8982-d7562e699627/#6bf2825a-cd1d-4659-b6ce-375a0fb0ab38

Irretrievable answered 18/10, 2011 at 12:53 Comment(0)
N
0

I also ran into the problem since my AppFabric server suffered something unknown. I spent much time for finding the solution. Finally the only way I tried successfully is to uninstall / re-install the AppFabric. And configure the settings once again. Hope this helps !

Nous answered 30/1, 2015 at 3:29 Comment(0)
G
0

I had same issue cause I installed appfabric cache service more than one times. Each times hostId was changed it must be same hostId with ClusterConfig.xml and DistributedCacheService.exe.config file

Gripping answered 15/3, 2016 at 10:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.