It looks like there are a number of questions already open on this topic, but I believe mine might be different. My setup:
- 1 Azure Cache Worker Role
- 1 Web Role
Up until about a week ago, they existed in harmony, until I tried to upgrade to Azure caching 2.1. Once I did that, I was afflicted with the "No such host is known" problem that seems to have affected many developers out there. I found many questions and sites that directed me to upgrade my Azure SDK installation to the new 2.1 version. I have done all of these things:
- Install newest Azure SDK 2.1
- Uninstall Azure SDK 2.0
- Uninstall and Reinstall Azure Caching 2.1
- Triple check configuration of all my caching settings
- Triple check that all references are pointing to the newest versions and not the old ones
- Upgrade my Azure Project to 2.1 by right-click, going to Properties, and clicking Upgrade
and I am still getting the following (My Error):
Exception type: SocketException
Exception message: No such host is known
at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
This is different than the more typical error that most other questions and sites are showing, which is (More commonly reported error, not mine):
No such host is known
Exception message: No such host is known
at Microsoft.ApplicationServer.Caching.AsyncResultNoResult.EndInvoke()
I am about 30 hours into troubleshooting this, and could really use some help. Maybe I am just missing some step about the upgrade of the SDK? Somehow maybe sneakily it is still using an old version of a DLL? Is there some foolproof way to check this besides looking at the path of every reference in the project (which I have already done, and they all match up)?
This also is not a direct answer to your problem but I think it may prove helpful to resolve your situation.
I've got this exception when I run my hosted service in the compute emulator and the cache was disabled on purpose -- in previous version of Windows Azure Caching an exception would be thrown on
DataCacheFactory
construction and I would handle it properly, while with version 2.1 (and Azure SDK 2.1) theDataCacheFactory
is constructed without errors but then I've got stuck onDataCache
construction for 3 minutes before the exception you mention is thrown.I've used the procedure described by Gaurav Mantri in his answer and I've been able to discover that in previous versions of Windows Azure Caching the
DataCacheFactory
would throw an exception if the cache role was not found in thecsdef
, while in 2.1 it would consider the cache role name as an address in the network -- thus causing the 3 minute wait and the subsequent exception.I've thus adapted my code to detect this new behavior -- for more detail see this SO question
Not really an answer but some comments which might help you diagnose the problem:
Collect lots of cache diagnostics data - In your cache configuration section, change the
Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel
value to4
in your cache worker role's configuration section. After you do that, add the following lines of code in your cache worker role's OnStart() method:Hopefully this should give you an idea about what exactly is going on.