locked
Using cache service preview returning "ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty" RRS feed

  • Question

  • I have recently switch my project to use azure cache service preview which was recently using azure shared caching. I followed the steps described in this page: http://www.windowsazure.com/en-us/manage/services/cache/net/how-to-cache-service/ but I keep getting the error: 
    
    ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty. 
    
    
    Here is the list of the changes that was done with the project:
     1. Updated Azure SDK to version 2.2
     2. Changed/Added Dlls:
        a. Microsoft.ApplicationServer.Caching.AzureClientHelper (Microsoft.WindowsAzure.Caching.2.2.0.0)
        b. Microsoft.ApplicationServer.Caching.Client (Microsoft.WindowsAzure.Caching.2.2.0.0)
        c. Microsoft.ApplicationServer.Caching.Core (Microsoft.WindowsAzure.Caching.2.2.0.0)
        d. Microsoft.Web.DistributedCache (Microsoft.WindowsAzure.Caching.2.2.0.0)
        e. Microsoft.WindowsAzure.ServiceRuntime v2.2
        f. Microsoft.WindowsFabric.Common (Microsoft.WindowsAzure.Caching.2.2.0.0)
        g. Microsoft.WindowsFabric.Data.Common (Microsoft.WindowsAzure.Caching.2.2.0.0)
    3. Updated my web.config file with this configuration:
        a. 
      
    <configSections>
      <!-- Existing sections omitted for clarity. -->
      <section name="dataCacheClients" 
        type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection,
              Microsoft.ApplicationServer.Caching.Core" 
        allowLocation="true" 
        allowDefinition="Everywhere" />
    
    <section name="cacheDiagnostics" 
        type="Microsoft.ApplicationServer.Caching.AzureCommon.DiagnosticsConfigurationSection,
              Microsoft.ApplicationServer.Caching.AzureCommon" 
        allowLocation="true" 
        allowDefinition="Everywhere" />
        b. 
      
    <dataCacheClients>
      <dataCacheClient name="default">
     
        <autoDiscover isEnabled="true" identifier="rolename.cache.windows.net" />
    
        <securityProperties mode="Message" sslEnabled="false">
          <messageSecurity authorizationInfo="[authkey]" />
        </securityProperties>
      </dataCacheClient>
    </dataCacheClients>

    Could you tell me the cause of the problem and how to resolve? Or could anyone tell me what are the possible causes for the error to occur?

    I have also attached the image of the exception:



    Monday, November 25, 2013 7:11 AM

Answers

  • Hi Andrew,

    Thanks for posting!

    Windows Azure Cache settings in the web.config file are not automatically available from in the context of the RoleEntryPoint class (typically defined in the WebRole.cs file). When you attempt to create a DataCache object in the RoleEntryPoint class methods, the following error occurs:

    {"ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty."}
    

    This happens because the dataCacheClient settings in the web.config file are not automatically being applied to the new DataCache client object. Specifically, the attributes of the autoDiscover element are unavailable, so the DataCache object is unable to target the role that hosts Cache.

    I suggest you could refer to this document (http://msdn.microsoft.com/en-us/library/windowsazure/jj852128.aspx) and try this code sample (http://msdn.microsoft.com/en-us/library/windowsazure/jj189876.aspx ).

    Thanks

    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.

    Tuesday, November 26, 2013 3:28 AM

All replies

  • Hi Andrew,

    Thanks for posting!

    Windows Azure Cache settings in the web.config file are not automatically available from in the context of the RoleEntryPoint class (typically defined in the WebRole.cs file). When you attempt to create a DataCache object in the RoleEntryPoint class methods, the following error occurs:

    {"ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty."}
    

    This happens because the dataCacheClient settings in the web.config file are not automatically being applied to the new DataCache client object. Specifically, the attributes of the autoDiscover element are unavailable, so the DataCache object is unable to target the role that hosts Cache.

    I suggest you could refer to this document (http://msdn.microsoft.com/en-us/library/windowsazure/jj852128.aspx) and try this code sample (http://msdn.microsoft.com/en-us/library/windowsazure/jj189876.aspx ).

    Thanks

    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.

    Tuesday, November 26, 2013 3:28 AM
  • Hi Will,

    I had the same problem as Andrew and followed your links, but I get an error of 

     Could not load type 'Microsoft.ApplicationServer.Caching.DataCacheAutoDiscoverProperty' from assembly 'Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

    I have the latest Azure SDK and on VS 2013. 

    The project builds properly.

    Thanks

    James

    Friday, December 6, 2013 6:12 PM
  • James, did you manage to fix this exception? I have the same problem now. It sounds like it could be a version issue.
    Monday, May 19, 2014 11:31 PM