最も奇妙なこと。SDK v1.7と新しいACSに切り替えていますが、ログインに成功すると、この奇妙なエラーが発生します。AzureCacheServiceのSessionStateプロバイダーに関連しているようです。
プレビューを使用していませんが、SDK 1.7を使用しており、プレビュー機能が有効になっているWindowsAzureアカウントを使用しています。
これは、ACS / CacheServiceSDKの奥深くにあるものが台無しになっているようなものです。
これが私のキャッシュ設定です:
<dataCacheClients>
<dataCacheClient name="default">
<tracing sinkType="DiagnosticSink" traceLevel="Verbose" />
<hosts>
<host name="[[newCacheNamespace]].cache.windows.net" cachePort="22233" />
</hosts>
<securityProperties mode="Message">
<messageSecurity authorizationInfo="[[secret]]">
</messageSecurity>
</securityProperties>
</dataCacheClient>
<dataCacheClient name="SslEndpoint">
<tracing sinkType="DiagnosticSink" traceLevel="Verbose" />
<hosts>
<host name="[[newCacheNamespace]].cache.windows.net" cachePort="22243" />
</hosts>
<securityProperties mode="Message" sslEnabled="true">
<messageSecurity authorizationInfo="[[secret]]">
</messageSecurity>
</securityProperties>
</dataCacheClient>
</dataCacheClients>
これが私のセッション状態プロバイダーの構成です。
<sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
<add name="AppFabricCacheSessionStoreProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" useBlobMode="true" dataCacheClientName="default" />
</providers>
</sessionState>
以下は私が得るエラーです:
Server Error in '/' Application.
--------------------------------------------------------------------------------
The remote name could not be resolved: '[[oldCacheNamespace]]-cache.accesscontrol.windows.net'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote name could not be resolved: '[[oldCacheNamespace]]-cache.accesscontrol.windows.net'
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The remote name could not be resolved: '[[oldCacheNamespace]]-cache.accesscontrol.windows.net']
System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data) +1243
System.Net.WebClient.UploadValues(String address, String method, NameValueCollection data) +179
Microsoft.ApplicationServer.Caching.AcsHelpers.GetToken(String serviceNamespace, String acsHostName, String issuerName, String issuerKey, String appliesTo) +523
[DataCacheException: ErrorCode<ERRCA0030>:SubStatus<ES0001>:ACS request for token failed. One of the reasons could be an invalid authorization token.]
Microsoft.ApplicationServer.Caching.AcsHelpers.GetToken(String serviceNamespace, String acsHostName, String issuerName, String issuerKey, String appliesTo) +1875
Microsoft.ApplicationServer.Caching.ClientAcsSecurity.get_Token() +242
Microsoft.ApplicationServer.Caching.CacheResolverChannel..ctor(CacheResolverCommunicatorType communicatorType, IDuplexSessionChannel innerChannel, DataCacheSecurity dataCacheSecurity) +559
[CommunicationException: ErrorCode<ERRCA0030>:SubStatus<ES0001>:ACS request for token failed. One of the reasons could be an invalid authorization token.]
Microsoft.ApplicationServer.Caching.CacheResolverChannel..ctor(CacheResolverCommunicatorType communicatorType, IDuplexSessionChannel innerChannel, DataCacheSecurity dataCacheSecurity) +833
Microsoft.ApplicationServer.Caching.CacheResolverChannelFactory`1.System.ServiceModel.Channels.IChannelFactory<TChannel>.CreateChannel(EndpointAddress to) +274
Microsoft.ApplicationServer.Caching.EndPointIdentityChannelFactory`1.System.ServiceModel.Channels.IChannelFactory<TChannel>.CreateChannel(EndpointAddress to) +186
Microsoft.ApplicationServer.Caching.WcfClientChannel.CreateChannel(EndpointID endpoint) +557
Microsoft.ApplicationServer.Caching.ChannelContainer.CreateChannel() +153
[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) +693
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCacheProperties(RequestBody request, SimpleSendReceiveModule sendRcvModule) +1194
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName) +701
Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFromFactory(DataCacheFactory factory, String cacheName) +63
Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler`1 fetchingHandler, EventHandler`1 fetchedHandler) +356
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateInternalProvider(IHttpRuntime httpRuntime, SessionInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler`1 cacheFetching, EventHandler`1 cacheFetched) +447
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetInternalProvider() +315
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateNewStoreData(HttpContext context, Int32 timeout) +59
System.Web.SessionState.SessionStateModule.InitStateStoreItem(Boolean addToContext) +182
System.Web.SessionState.SessionStateModule.CompleteAcquireState() +374
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +2007
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +477
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +312