Azure会话缓存错误

时间:2012-10-25 10:39:02

标签: c# asp.net-mvc-3 azure azure-caching

我开始重复抛出Azure缓存错误。它似乎与过期的会话有关。这是一个随机样本 - 它发生在静态文件中。

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 10/25/2012 9:49:15 AM 
Event time (UTC): 10/25/2012 9:49:15 AM 
Event ID: 004e617f16854e59b7a857ca542ae9fc 
Event sequence: 86004 
Event occurrence: 720 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1273337584/ROOT-1-129955415508042441 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: E:\sitesroot\0\ 
    Machine name: RD00155D36A377 

Process information: 
    Process ID: 3332 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: DataCacheException 
    Exception message: ErrorCode:SubStatus:Key referred to does not exist. Create objects based on a Key to fix the error.
   at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody)
   at Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg, IMonitoringListener listener)
   at Microsoft.ApplicationServer.Caching.DataCache.InternalResetObjectTimeout(String key, TimeSpan newTimeout, String region, IMonitoringListener listener)
   at Microsoft.ApplicationServer.Caching.DataCache.c__DisplayClass68.b__67()
   at Microsoft.ApplicationServer.Caching.DataCache.ResetObjectTimeout(String key, TimeSpan newTimeout)
   at Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action)
   at Microsoft.Web.DistributedCache.DataCacheForwarderBase.ResetObjectTimeout(String key, TimeSpan newTimeout)
   at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



Request information: 
    Request URL: http://www.beko.co.uk/Scripts/jquery.nivo.slider.pack.js 
    Request path: /Scripts/jquery.nivo.slider.pack.js 
    User host address: 80.2.72.81 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 11 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody)
   at Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg, IMonitoringListener listener)
   at Microsoft.ApplicationServer.Caching.DataCache.InternalResetObjectTimeout(String key, TimeSpan newTimeout, String region, IMonitoringListener listener)
   at Microsoft.ApplicationServer.Caching.DataCache.c__DisplayClass68.b__67()
   at Microsoft.ApplicationServer.Caching.DataCache.ResetObjectTimeout(String key, TimeSpan newTimeout)
   at Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action)
   at Microsoft.Web.DistributedCache.DataCacheForwarderBase.ResetObjectTimeout(String key, TimeSpan newTimeout)
   at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

此处没有代码,它在web.config中配置

<dataCacheClients>
  <dataCacheClient name="default">
    <hosts>
      <host name="[mycachename]" cachePort="22233" />
    </hosts>
    <securityProperties mode="Message">
      <messageSecurity authorizationInfo="[mykey]"></messageSecurity>
    </securityProperties>
  </dataCacheClient>
  <dataCacheClient name="SslEndpoint">
    <hosts>
      <host name="[mycachename]" cachePort="22243" />
    </hosts>
    <securityProperties mode="Message" sslEnabled="true">
      <messageSecurity authorizationInfo="[mykey]"></messageSecurity>
    </securityProperties>
  </dataCacheClient>
</dataCacheClients>

编辑:会话状态配置如下:

<sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider">
  <providers>
    <add name="AppFabricCacheSessionStoreProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" useBlobMode="true" dataCacheClientName="default" />
  </providers>
</sessionState>

我试图了解是否存在 a)我可以做任何事情来解决这个问题 b)涉及哪个DLL,以及最新版本是什么(所以我可以看看更新是否有帮助) c)如果有人看到这个。

它是在我做了很多应用程序更新之后开始的,并且还更新了Azure中的缓存大小。因此不确定原因是什么。我不会认为代码更改是负责任的,但我们可能已经更新了一些DLL,因为我们在开发过程中使用的PC之一是新构建的。

1 个答案:

答案 0 :(得分:0)

我通过nuget更新了azure.caching和azure.configuration,然后重新发布,错误现在已经消失,没有其他代码或配置发生变化,所以看起来这是某个DLL版本之间的不兼容。