title: ErrorCode<ERRCA0017>:SubStatus<ES0006> while using Azure Cache Service(Preview)
body: <p>So I am getting the same error which a lot of users have experienced - </p>
  
  <pre><code>&gt; Home Page. Modify this template to jump-start your ASP.NET MVC
  &gt; application.Microsoft.ApplicationServer.Caching.DataCacheException:
  &gt; ErrorCode&lt;ERRCA0017&gt;:SubStatus&lt;ES0006&gt;:There is a temporary failure.
  &gt; Please retry later. (One or more specified cache servers are
  &gt; unavailable, which could be caused by busy network or servers. For
  &gt; on-premises cache clusters, also verify the following conditions.
  &gt; Ensure that security permission has been granted for this client
  &gt; account, and check that the AppFabric Caching Service is allowed
  &gt; through the firewall on all cache hosts. Also the MaxBufferSize on the
  &gt; server must be greater than or equal to the serialized object size
  &gt; sent from the client.). Additional Information : The client was trying
  &gt; to communicate with the server:
  &gt; net.tcp://hamzacachetrial.cache.windows.net:24233. at
  &gt; Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus
  &gt; errStatus, Guid trackingId, Exception responseException, Byte[][]
  &gt; payload, EndpointID destination) at
  &gt; Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody
  &gt; respBody, EndpointID destination) at
  &gt; Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable`1
  &gt; servers, RequestBody request, Func`3 sendMessageDelegate,
  &gt; DataCacheReadyRetryPolicy retryPolicy) at
  &gt; Microsoft.ApplicationServer.Caching.SocketClientProtocol.&lt;&gt;c__DisplayClass5.&lt;Initialize&gt;b__2(RequestBody
  &gt; req) at
  &gt; Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendReceive(IVelocityRequestPacket
  &gt; request, Func`2 delegate, EndpointID&amp; destination) at
  &gt; Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable`1
  &gt; servers) at
  &gt; Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String
  &gt; cacheName, CreateNewCacheDelegate cacheCreationDelegate,
  &gt; DataCacheInitializationViaCopyDelegate initializeDelegate) at
  &gt; Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String
  &gt; cacheName) at MvcWebRole1.Controllers.HomeController.Index() in
  &gt; c:\Users\hk7654\Documents\Visual Studio
  &gt; 2012\Projects\CacheTrial\MvcWebRole1\Controllers\HomeController.cs:line
  &gt; 46
  </code></pre>
  
  <hr>
  
  <p>This is my function-</p>
  
  <pre><code>`public ActionResult Index()
      {
          var retryStrategy = new FixedInterval(5, TimeSpan.FromSeconds(60));
          var retryPolicy = new RetryPolicy&lt;CacheTransientErrorDetectionStrategy&gt;(retryStrategy);
          DataCache cache = null;
  
          retryPolicy.Retrying += (sender1, args) =&gt;
          {
              var msg = String.Format("Retry - Count:{0}, Delay:{1}, Exception:{2}",
                  args.CurrentRetryCount, args.Delay, args.LastException);
              Trace.Write(msg);
          };
  
          try
          {
               DataCacheFactoryConfiguration config = new DataCacheFactoryConfiguration();
               config.TransportProperties.ReceiveTimeout = new TimeSpan(45000);
               config.ChannelOpenTimeout = new TimeSpan(150000);
  
               DataCacheFactory cacheFactory = new DataCacheFactory(config);
               cache = cacheFactory.GetCache("default");
  
               retryPolicy.ExecuteAction(
               () =&gt;
                  {
                      cache.Add("name" + _i++, "hamza");
  
                  });
  
           }
           catch (DataCacheException ex)
           {
                Trace.Write(ex.GetType().ToString() +  ex.Message.ToString()+ex.StackTrace.ToString());
           }
  
      }`
  </code></pre>
  
  <p>I have used Transient Fault Handling as well as ChannelOpenTimeout and TransportProperties.ReceiveTimeout as mentioned in some solutions. This is the datacacheclient section of the web config - </p>
  
  <pre><code> &lt;dataCacheClients&gt;
  &lt;dataCacheClient name="default"&gt;
  
    &lt;autoDiscover isEnabled="true" identifier="hamzacachetrial.cache.windows.net" /&gt;
    &lt;securityProperties mode="Message" sslEnabled="false"&gt;
      &lt;messageSecurity authorizationInfo="XXXXXXXXXX" /&gt;
    &lt;/securityProperties&gt;
  &lt;/dataCacheClient&gt;
  </code></pre>
  
  <p></p>
  
  <p>Nothing seems wrong here either.</p>
  
  <p>When I use In-Role Caching I face no such problem but the dedicated cache service just does not work.
  The cache is a Standard 4GB Cache I have also tried with the basic 128 MB cache. One more thing I need to know is are the ClientPerfCounters necessary? They shouldnt be but just to be sure.I understand a lot of people have asked this but none of the solutions have worked for me. Help Please!!!</p>