Exception while using Windows Azure Caching : No such host is known
Asked Answered
S

3

8

I am trying to get started with Azure and am trying to use the Caching feature. I created a cloud service project and added a Cache worker role and a web role. I installed "Windows Azure Caching" nuget into projects for both the roles and added the name of cache worker role as identifier in DataCacheClients element in web.config of the web role.

I added the following code into the web role:

DataCacheFactory cf = new DataCacheFactory();
DataCache c = cf.GetDefaultCache();

When I try to run this locally on the emulator, I get the following exception:

    ErrorCode<ERRCA0017>:SubStatus<ES0006>: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.). 
Additional Information : The client was trying to communicate  with the server: net.tcp://MvcWebRole1:24233.


Inner Exception : No such host is known

Can you please tell me what I am missing here?

Azure SDK used : v2.0

Socialminded answered 1/8, 2013 at 10:13 Comment(1)
Tragically, the timing of this question is good for me too. :-)Terrific
I
14

Timing of your question couldn't be better. We also faced exactly the same issue and were scrathing our head as to what the problem could be. We had one project where everything worked perfectly fine and in one we were getting the same error. Based on our research, we have identified the problem with the Nuget package for caching. It seems a new version (2.1.0.0) was released yesterday and we found that if we install that package, we get this error. Can you check the package version in your case? The documentation states that this new version can only be used with the latest SDK (2.1) released today.

One solution would be to uninstall version 2.1.0.0 and install version 2.0.0.0. To install version 2.0.0.0, open Package Manager Console (View --> Other Windows --> Package Manager Console) and type following command there:

Install-Package Microsoft.WindowsAzure.Caching -Version 2.0.0.0

This fixed our problem. Hopefully it should fix yours too.

Ignorant answered 1/8, 2013 at 13:4 Comment(3)
And also timing of your answer could not be better. It solved my problem. Thank you.Atlas
I'm curious how you figured out the root cause...I spent a few hours to get down to the problem but to no avail...sharing debugging techniques to identify such issues would be of great helpSocialminded
We had one project where everything worked perfectly fine and in one we were getting this error. I just compared both projects and found that there was a change in WindowsAzure.Caching dll's version in both projects. I removed the new one (2.1.0.0) and referenced the old dll (2.0.0.0) , it worked fine.Ignorant
L
2

Here is a link to the Windows Azure Cloud Integration Engineering blog on how to deal with this same issue. They recommend upgrading to Azure SDK v 2.1 or rolling back as the accepted answer states.

http://blogs.msdn.com/b/cie/archive/2013/08/08/windows-azure-caching-2-1-0-0-no-such-host-is-known.aspx

Lilalilac answered 28/8, 2013 at 20:43 Comment(1)
Thanks. Thought I did: "They recommend upgrading to Azure SDK v 2.1 or rolling back as the accepted answer states."Lilalilac
T
1

This exception could also occur under compute emulator if for the role in the client library configuration there is no cache configured. In my case this happened on purpose, since the cache emulator has some problems that can slow down the test and debugging on the service.

In previous version of Windows Azure Caching, in this scenario the construction of DataCacheFactory would fail with an exception (handled by my code); with Windows Azure Caching 2.1 (and Azure SDK 2.1) in this same scenario the code would consider the role name as a server address and thus on DataCache construction would try to communicate with the non existing cache -- this leads to a 3 minute wait and the exception reported in the question.

I have changed my code to detect the new situation for this scenario -- you can find more detail in this SO question.

Transmission answered 7/10, 2013 at 18:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.