Asp.net mvc 3 Azure AppFabric缓存。错误代码<;ERRCA0017>;:亚状态<;ES0006>;

Asp.net mvc 3 Azure AppFabric缓存。错误代码<;ERRCA0017>;:亚状态<;ES0006>;,asp.net-mvc-3,azure,appfabric,appfabric-cache,Asp.net Mvc 3,Azure,Appfabric,Appfabric Cache,发生了一件非常奇怪的事情 我在Azure WebRole中部署了一个MVC 3制作的网站 它运行良好,最初是在VS2010中制造的 现在我使用VS2012 我决定做一些小的改动,它似乎可以正常工作,但会以随机间隔出现故障 这就是正在发生的事情 在随机间隔之后,我得到这个错误ErrorCode:SubStatus 获取此错误2-3分钟后,站点似乎工作正常 我没有更改与缓存相关的网站的上一版本的任何内容 在staging或本地环境中测试时,不会发生此错误 在我的代码中没有我以编程方式访问此缓存的位置

发生了一件非常奇怪的事情
我在Azure WebRole中部署了一个MVC 3制作的网站
它运行良好,最初是在VS2010中制造的
现在我使用VS2012
我决定做一些小的改动,它似乎可以正常工作,但会以随机间隔出现故障
这就是正在发生的事情

在随机间隔之后,我得到这个错误
ErrorCode:SubStatus

获取此错误2-3分钟后,站点似乎工作正常

我没有更改与缓存相关的网站的上一版本的任何内容
staging
本地环境中测试时,不会发生此错误
在我的代码中没有我以编程方式访问此缓存的位置
我已经从azure门户复制粘贴了整个配置,我知道它是正确的,因为这些配置设置与以前的配置设置相同
我只是使用
Azure AppFabric缓存
,因为我需要将
会话
保存到一些地方。因此,唯一提到它的地方就是我的网站
webconfig
,正如我所说的,所有的配置都可以假定是正确的。

这是stacktrace,如果有帮助的话

[DataCacheException: 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.)]
   Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody) +616
   Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg, IMonitoringListener listener) +29
   Microsoft.ApplicationServer.Caching.DataCache.InternalGetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle, String region, Boolean lockKey, IMonitoringListener listener) +227
   Microsoft.ApplicationServer.Caching.<>c__DisplayClass78.<GetAndLock>b__77() +103
   Microsoft.ApplicationServer.Caching.DataCache.GetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle) +258
   Microsoft.Web.DistributedCache.<>c__DisplayClass31`1.<PerformCacheOperation>b__30() +19
   Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action) +208
   Microsoft.Web.DistributedCache.DataCacheForwarderBase.GetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle) +190
   Microsoft.Web.DistributedCache.BlobBasedSessionStoreProvider.GetItem(HttpContextBase context, String id, Boolean acquireWriteLock, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +593
   Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +125
   System.Web.SessionState.SessionStateModule.GetSessionStateItem() +178
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1076
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +115
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375

这是新的堆栈跟踪

[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [IP-ADDRESS]:[PORT]]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +305
   System.Net.Sockets.Socket.Connect(EndPoint remoteEP) +162
   System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout) +774

[EndpointNotFoundException: Could not connect to [SOCKET-ENDPOINT]. The connection attempt lasted for a time span of 00:00:21.0308462. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 111.221.89.111:22233. ]
   System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase) +518
   System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData) +401
   Microsoft.ApplicationServer.Caching.OpenDelegate.EndInvoke(IAsyncResult result) +0
   Microsoft.ApplicationServer.Caching.ChannelContainer.Opened(IAsyncResult ar) +122

一年前有一篇关于这个错误的有趣的博文:

在初始化DataCacheFactory之前,请修改 的DataCacheFactoryConfiguration.ChannelOpenTimeout 您正在使用的dataCacheFactoryConfiguration实例用于更大的 值为2分钟。(无法使用配置设置值,因为 在允许的限制内20秒)。此外,本建议仅适用于 用于调试目的,理想情况下不应在生产中使用 环境。这使底层能够以实际错误进行响应 事情发生了。现在,如果您检查内部异常,您应该会看到 是什么导致请求失败的

请按照以下步骤查找内部异常,该异常将解释请求失败的原因


<强>注:如果这是由一个临时故障引起的,您应该考虑使用(也支持AppCuffCache)来实现重试策略。

我不能这样做。因为我没有按照我提到的程序做任何事情。我只是在webconfig中添加了一些配置值,没有其他内容。请看下面的博文:不要使用web.config,而是在web应用程序启动时配置缓存。您只需执行此操作即可更改ChannelOpenTimeout并找到真正的错误。一旦你掌握了内部异常,你可以简单地切换回web.config配置。我已经更新了我的问题,我认为问题不在于数据量大,而在于超时。这很奇怪,因为我使用同一个数据中心来托管服务,对于缓存,我也面临同样的问题。。。完全相同的问题。你有什么解决办法吗。升级到VS 2012后,NHibernate二级缓存(NHibernate.Caches.AppFabric)无法连接到缓存服务器。正常的cacheService使用新的DataCacheFactory(),工作正常。它仅支持NHibernate二级缓存,无法communicate@rbg-通过与azure技术支持人员交谈,我解决了这个错误,他们告诉我这是azure中的内部错误,如果我删除并重新部署我的服务,就会消失,谢天谢地,这为我解决了问题
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [IP-ADDRESS]:[PORT]]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +305
   System.Net.Sockets.Socket.Connect(EndPoint remoteEP) +162
   System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout) +774

[EndpointNotFoundException: Could not connect to [SOCKET-ENDPOINT]. The connection attempt lasted for a time span of 00:00:21.0308462. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 111.221.89.111:22233. ]
   System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase) +518
   System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData) +401
   Microsoft.ApplicationServer.Caching.OpenDelegate.EndInvoke(IAsyncResult result) +0
   Microsoft.ApplicationServer.Caching.ChannelContainer.Opened(IAsyncResult ar) +122