none
Co-Located Cache - No such host is known

    Question

  • I have moved to SDK V2.1 and have the latest version of the Caching Nuget too 2.1.  This is not a new project.  I have added in my web.config config which looks like so:

      <dataCacheClients>
        <dataCacheClient name="default">
          <autoDiscover isEnabled="true" identifier="ConsumerWeb4" />
        </dataCacheClient>
    </dataCacheClients>

    ConsumerWeb4 being my role.  I initiate the caching client using:

    using Microsoft.ApplicationServer.Caching;

    /

    /

    DataCache AgencyCache = new DataCache();

    When it hits this code in Azure it just goes around in circles on the browser.  If I hit a page I don't call this then its fine.  When I get the intellitrace logs, the error is repeated down the log System.Net.Sockets.SocketException - No such host is known.

    I really want to get this caching working as it looks great.  Can someone please advise what I have done wrong.  I have reinstalled the SDK thinking it may have errored but nothing has helped.

    If I set autoDiscover to false, I get the following error:

    ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty.]

    Tuesday, October 22, 2013 1:25 PM

Answers

  • OK Folks, I have fixed this very annoying issue.  In my cloud project I use multiple Service Definitions/configurations by using transforms.  The powershell script that runs as part of the Azure Caching install failed on updating definitions due to this.  (I hadn't spotted this as it stated it installed successfully).

    By failing to run this it did not add the following line in the definition:     

    <Import moduleName="Caching" />

    When I built it, it did complain about a missing configuration so I entered my own thinking this was something I had to do myself for Microsoft.WindowsAzure.Plugins.Caching.NamedCaches etc..   This was wrong!!! (even though it appeared to work).

    I removed these lines and added the import line and hey presto.  It started working. 

    Microsoft, there were a few things you could have done here to help me spot this or stop me from getting here.

    Hopefully this assists anyone else who has fallen into this trap or is getting my scenarios. 

    • Marked as answer by Steve.Newton Friday, October 25, 2013 10:57 PM
    Friday, October 25, 2013 10:57 PM

All replies

  • Hi Steve,

    Thanks for posting!

    From the error message, I guess it may be version mismatch. There have two options

    1. Upgrade your Azure SDK to the latest version (v2.1) (this should be the right and recommended way)

    2. If for some reason, you can not upgrade your Azure SDK at the moment, then you can manually install previous version of Azure Caching. (of course you will be missing on the new things v2.10.0 has to offer)

    • a. Go to Visual Studio –> Open your project where you want to install Azure Caching libraries 
    • b. Tools –> Library Package Manager –> Package Manager Console
    • c. This should bring up ‘Package Manager Console’ window
    • d. Run following command in that console window

    >Install-Package Microsoft.WindowsAzure.Caching -Version 2.0.0.0

    This should install the v2.0.0.0 of Azure Caching which you can use with your older versions of Azure SDK (<v2.1)

    About this issue, here is a blog (http://blogs.msdn.com/b/asgoyal/archive/2013/08/08/windows-azure-caching-2-1-0-0-no-such-host-is-known.aspx), Please refer to it.

    Thanks.

    If I am misunderstanding, please let me know.

    Regards,

    Will


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 23, 2013 4:50 AM
    Moderator
  • Thanks will. I have seen the post you used and that is what prompted the sdk reinstall. I am already on sdk2.1 and the upgraded cache nuget. I am using mvc, not that this should make any different but though i would mention it. Therefore initiating from a controller.

    i tried to go back to the previous version but got into issues with the service runtime. This is an old issue which i ignored and just stopped trying to use code to record which instance is doing what.may be totally unrelated but thought i would mention it.

    i have seen a couple of others with this issue, exactly as mine. Probably some kind of mismatch but with what is the question, the error is not helpful.

    Edit/  Just spotted something in the stack trace 1 second before the message related to server collection:

    Type: System.IO.FileNotFoundException Message: Can't find config file.

    Microsoft.Fabric.Common.ConfigFile.Load()
    Microsoft.Fabric.Common.ConfigFile.get_Config()
    Microsoft.Fabric.Common.EventLogWriter.LoadSinkFromConfig()

    Microsoft.Fabric.Common.EventLogWriter..cctor()

    Edit/ Having turned autoDiscover back on.  I now get another error:

    System.InvalidOperationException: No Endpoints found


    Edit/ Noticed my cloud project was setup to OSFamily 1 so thought that would be it, updated to 3 and confirmed upgrade to 2012.  It now displays the No such host is known after spining around in circles for a while.  Portal confirms SDK 2.1.6493.1.
    • Edited by Steve.Newton Wednesday, October 23, 2013 10:42 PM
    Wednesday, October 23, 2013 9:38 AM
  • OK Folks, I have fixed this very annoying issue.  In my cloud project I use multiple Service Definitions/configurations by using transforms.  The powershell script that runs as part of the Azure Caching install failed on updating definitions due to this.  (I hadn't spotted this as it stated it installed successfully).

    By failing to run this it did not add the following line in the definition:     

    <Import moduleName="Caching" />

    When I built it, it did complain about a missing configuration so I entered my own thinking this was something I had to do myself for Microsoft.WindowsAzure.Plugins.Caching.NamedCaches etc..   This was wrong!!! (even though it appeared to work).

    I removed these lines and added the import line and hey presto.  It started working. 

    Microsoft, there were a few things you could have done here to help me spot this or stop me from getting here.

    Hopefully this assists anyone else who has fallen into this trap or is getting my scenarios. 

    • Marked as answer by Steve.Newton Friday, October 25, 2013 10:57 PM
    Friday, October 25, 2013 10:57 PM