6

我正在尝试使用同位缓存。在云模拟器启动过程中出现以下异常:

Application: CacheInstaller.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.ApplicationServer.Caching.ConfigStoreException
Stack:
   at Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility.RetryExponentialTask(System.Func`1<Boolean>, System.Predicate`1<System.Exception>, System.TimeSpan, System.TimeSpan, System.TimeSpan, Int32)
   at Microsoft.ApplicationServer.Caching.AzureCommon.Package.InitializeExternalStore(Microsoft.ApplicationServer.Caching.ICustomProvider)
   at Microsoft.ApplicationServer.Caching.AzureCommon.Package.InitializeExternalStoreIfRequired()
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

我的配置:

  <dataCacheClients>
    <tracing sinkType="DiagnosticSink" traceLevel="Error" />
    <dataCacheClient name="default">
      <autoDiscover isEnabled="true" identifier="Web" />
    </dataCacheClient>
  </dataCacheClients>

有人可以帮助我吗?:)

编辑

我正在使用 VS 2010 SP1,Windows 7。我删除了 SDK 1.6 并重新安装了 1.7。

云配置(网络角色):

<ServiceConfiguration serviceName="Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" schemaVersion="2012-05.1.7">
  <Role name="Web">
    <Instances count="1" />
    <ConfigurationSettings>
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="..." />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="..." />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="..." />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="..." />
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=...;AccountKey=..." />
      <Setting name="DiagnosticsConnectionString" value="DefaultEndpointsProtocol=https;AccountName=...;AccountKey=..." />
      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{&quot;caches&quot;:[{&quot;name&quot;:&quot;default&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:10,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0}]}" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.Loglevel" value="" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.CacheSizePercentage" value="30" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="UseDevelopmentStorage=true" />
    </ConfigurationSettings>
    <Certificates>
      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="..." thumbprintAlgorithm="sha1" />
    </Certificates>
  </Role>
</ServiceConfiguration>

编辑2

我试图创建空的测试项目:

  1. 创建 Windows Azure 云服务项目
  2. 选定的 ASP.NET Web 角色
  3. 在 Web 角色属性的缓存选项卡中启用缓存(位于同一位置)
  4. 安装的 Windows Azure 缓存预览
  5. 使用 NuGet 启动云项目
  6. 同样的例外

编辑3

我安装了 VS 2012 RC 并尝试创建测试项目。发生了同样的问题。

编辑4

异常详情:

Microsoft.ApplicationServer.Caching.ConfigStoreException:
  Windows Azure Storage Service is not ready/available.  StorageAccountName = DevStorage, BlobNamePrefix = deployment17(44)__Web --->
  Microsoft.WindowsAzure.StorageClient.StorageClientException: ERROR --->
  System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebRequest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
   --- End of inner exception stack trace ---
   at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
   at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
   at Microsoft.WindowsAzure.StorageClient.CommonUtils.<LazyEnumerateSegmented>d__0`1.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.ApplicationServer.Caching.WindowsAzureBlobProvider.IsInitialized()
   --- End of inner exception stack trace ---
   at Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility.RetryExponentialTask(Func`1 doTask, Predicate`1 shouldRethrow, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff, Int32 retryCount)
   at Microsoft.ApplicationServer.Caching.AzureCommon.Package.InitializeExternalStore(ICustomProvider customProvider)
   at Microsoft.ApplicationServer.Caching.AzureCommon.Package.InitializeExternalStoreIfRequired()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
4

1 回答 1

2

在我看来,当它尝试初始化缓存的后备存储时出现问题。您从 Blob 存储提供商处收到 400 错误请求。如果没有配置缓存,您是否能够从另一个测试项目访问您的开发存储中的 BLOB 存储?devstorage 模拟器是否正在运行?

通过查看通知区域/系统托盘并右键单击模拟器的 Azure 小图标,检查存储模拟器是否正在运行。如果其中一个内容菜单是“启动存储模拟器”,则存储服务未运行,请单击它。如果它认为它正在运行,则单击 Show Storage Emulator 并确保检查 Blob 和其他服务并具有运行状态。如果是这种情况,请尝试使用另一个测试应用程序或第三方工具(如 Cerebrata 的 Cloud Storage Studio)读取/写入您的开发 blob 存储。

缓存系统正在尝试在 BLOB 存储中创建一个名为 cacheclusterconfigs 的文件夹,集群的每个成员都可以在其中查看配置。无论出于何种原因,您都无法访问 BLOB 存储来执行此操作。

要回答您的其他问题,是的,CacheInstaller 确实会记录。当您启动实例时,即使在它完全启动之前,您也应该能够查看计算模拟器并选择一个实例。然后右键单击该实例并选择“打开本地存储”。这将打开一个资源管理器窗口,模拟器将特定于每个实例的文件放在其中。它将类似于 C:\Users{user}\AppData\Local\dftmp\Resources\8d403f60-3b09-481a-8b9c-86ab9e06954b。GUID 是实例。从该窗口挖掘到以下目录:\directory\Microsoft.WindowsAzure.Plugins.Caching.FileStore。在这里,您将看到来自缓存服务的日志文件。如果您的安装卡住了,那么您应该在此目录中看到一个文件,例如 DedicatedCacheLogs_CacheInstaller_xxxx.log(xxxx 是数字)。这可能会帮助你。

请注意,cacheinstaller.exe.config 和相关的可执行文件实际上是从 C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\2012-06\bin\ 复制到包中,然后复制到模拟器的实例中插件\缓存目录。如果您无法从我上面指出的实例目录中找到所需的内容,也许您可​​以从该 SDK 目录向 exe.config 添加另一个跟踪侦听器并让它吐出其他信息。

希望这些提示对您有所帮助。除非我为 Azure 中的帐户提供了错误的存储帐户地址,否则我无法最终重新创建该问题,即使那样它也不是 100% 匹配您的错误。

于 2012-06-18T00:38:50.143 回答