Cant get Azure Cache to work. "There is a temporary failure. Please retry later."

2.4k views Asked by At

So, today I

  1. installed the azure SDK 2.1, and
  2. created a new project With a single WorkerRole,
  3. got the Caching package using NuGet,
  4. set the caching for the role to "Collocated"
  5. Set the Host to "WorkerRole1" in the app.config
  6. commented the security section since this is only a test
  7. inserted the following line on the "Run" `DataCache c = new DataCacheFactory().GetDefaultCache();
  8. Hit Debug

and got this error trying to execute the line above:

There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.)

I looked around a lot (for about 5 hours) and found no explanation for this... Can anyone help?

4

There are 4 answers

1
Leonardo On BEST ANSWER

I installed the older version of the SDK (versions 1.8 and 2.0) and now its working... go figure...

2
TJBeanz On

I've run into this when the Cloud Service project was not properly upgraded to 2.1. Make sure that the project is definitely using the 2.1 SDK, then make sure all your NuGet packages are updated. The latest Azure Caching NuGet package requires the Windows Azure 2.1 SDK.

1
Fil On

I have run into the same error, and the issue for me was that I've installed the Caching package from NuGet (by following instructions from here: http://www.windowsazure.com/en-us/documentation/articles/cache-dotnet-how-to-use-in-role/#NuGet) which installs the latest version by default and have neglected the fact that my project was on an older version of Azure (2.1). Consequently some components from the caching package referenced Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0 which was a higher version than the referenced Diagnostics assembly in the project.

I fixed it by uninstalling the Azure Cache package (v 2.2) and manually installing the coinciding version (v 2.1) by running this command in the Package Manager Console:

PM> Install-Package Microsoft.WindowsAzure.Caching -Version 2.1
0
edymtt On

In my case I've got the same exception (with Azure SDK 2.1 and Windows Azure Caching 2.1) when I disable the cache from the designated role and run the hosted service in the compute emulator (I need this behavior to disable caching based only on csdef configuration, without additional settings).

In previous version of Azure Caching this scenario caused an exception in DataCacheFactory constructor, now I have no longer this exception but the role hangs in the DataCache constructor call for three minutes and than I've got the exception you describe.

I've solved this problem by changing the code that detects if cache is disabled -- you can read more details in this SO question.