gpt4 book ai didi

c# - Sitecore azure 无法启动

转载 作者:行者123 更新时间:2023-12-03 01:54:56 24 4
gpt4 key购买 nike

我们在将 sitecore 应用程序部署到 Azure 环境中时遇到问题。更新云服务后无法启动,提供信息:未处理的异常:Microsoft.ApplicationServer.Caching.DataCacheException。在 WaIISHost 进程日志中我发现这样的错误:

    0 : [00003180:00000006, 2014/09/09 06:35:16.89, ERROR] Unhandled exception: IsTerminating 'True',  Message 'System.TimeoutException: We waited for 'Boolean <CreateSymbolicLink>b__1()' that didn't finish within 00:00:30. 
at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at Sitecore.Azure.Sys.Retryer.Do.Until(Func`1 predicate, TimeSpan timeout)
at RoleRootConfigurator.CreateSymbolicLink(String relativePathToAppRoot, DirectoryInfo localResourceDir)
at WebRole.RoleRootConfigurator.ConfigureSymbolicLinksForApproot(DirectoryInfo localResourceDir)
at WebRole.OnStart()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<InitializeRole>b__0()
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()
at Sitecore.Azure.Sys.Retryer.Do.Until(Func`1 predicate, TimeSpan timeout)
at WebRole.RoleRootConfigurator.CreateSymbolicLink(String relativePathToAppRoot, DirectoryInfo localResourceDir)
at WebRole.RoleRootConfigurator.ConfigureSymbolicLinksForApproot(DirectoryInfo localResourceDir)
at WebRole.OnStart()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<InitializeRole>b__0()
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()'

我们根据 Sitecore 开发人员准备的代码创建了自定义 WebRole。下面是负责创建符号链接(symbolic link)的代码:

public void ConfigureSymbolicLinksForApproot(DirectoryInfo localResourceDir)
{
if (RoleEnvironment.IsEmulated)
return;
Trace.TraceInformation(" -- Configure app root starting...");
this.CreateSymbolicLink("temp", localResourceDir);
this.CreateSymbolicLink("App_Data/debug", localResourceDir);
this.CreateSymbolicLink("App_Data/diagnostics", localResourceDir);
this.CreateSymbolicLink("App_Data/indexes", localResourceDir);
this.CreateSymbolicLink("App_Data/logs", localResourceDir);
this.CreateSymbolicLink("App_Data/packages", localResourceDir);
this.CreateSymbolicLink("App_Data/viewstate", localResourceDir);
this.CreateSymbolicLink("App_Data/MediaCache", localResourceDir);
this.CreateSymbolicLink("App_Data/Submit_Queue", localResourceDir);
}

private void CreateSymbolicLink(string relativePathToAppRoot, DirectoryInfo localResourceDir)
{
DirectoryInfo appRootDir = new DirectoryInfo(Path.Combine(this.AppRoot.FullName, relativePathToAppRoot));
Do.ThisOnce((Action)(() => RmDir.RemoveDir(appRootDir))).Until((Func<bool>)(() => !Directory.Exists(appRootDir.FullName)));
DirectoryInfo tempLocalResourceDir = new DirectoryInfo(Path.Combine(localResourceDir.FullName, relativePathToAppRoot));
Do.ThisOnce(new Action(tempLocalResourceDir.CreateIfNotExists)).Until((Func<bool>)(() => Directory.Exists(tempLocalResourceDir.FullName)));
Do.ThisOnce((Action)(() => MkLink.CreateLink(appRootDir, tempLocalResourceDir))).WithTracePing("Waiting for '{0}' to be created as symbolic link in app root", (object)appRootDir.FullName).Until((Func<bool>)(() => Directory.Exists(appRootDir.FullName)));
}

我还在事件查看器中找到了此类信息:

Faulting application name: CacheService.exe, version: 1.0.5137.0, time stamp: 0x52304f01
Faulting module name: KERNELBASE.dll, version: 6.2.9200.16864, time stamp: 0x531d34d8
Exception code: 0xe0434352
Fault offset: 0x0000000000047b8c
Faulting process id: 0x1e80
Faulting application start time: 0x01cfcc0ca7dac7a3
Faulting application path: F:\plugins\Caching\CacheService.exe
Faulting module path: D:\Windows\system32\KERNELBASE.dll
Report Id: ee6a3966-37ff-11e4-93f6-00155d67d4ca
Faulting package full name:
Faulting package-relative application ID:

Application: CacheService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.ApplicationServer.Caching.DataCacheException
Stack:
at Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility.ProcessException(System.Exception)
at Microsoft.ApplicationServer.Caching.Colocatedservice.CacheService.<OnStart>b__0(System.Object)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

基于此,我尝试使用 Sitecore 提供的 nuget 或放置在 Azure SDK 2.2 文件夹中的 nuget 更新 Windows AzureCache 库,但没有任何变化。任何帮助将不胜感激。

最佳答案

贾克巴尔。

根据最初的异常,部署过程在创建 Windows Symbolic Links 期间失败对于以下目录:

  • \临时
  • \App_Data\调试
  • \App_Data\诊断
  • \App_Data\索引
  • \App_Data\logs
  • \App_Data\packages
  • \App_Data\viewstate
  • \App_Data\MediaCache

Sitecore Azure 使用此技巧来避免大小限制为 1.5 GB(以前为 1GB)的虚拟机上最后一个磁盘(通常是磁盘 F:/)的溢出。该磁盘用于保存您部署到 PaaS 的 ASP.NET Web 应用程序。

.NET Reflector向我展示,Sitecore.Azure.Sys.Retryer.Do.Until(Func predicate) 方法使用等于 30 秒的硬编码超时。在您的情况下,30 秒似乎不足以删除 F:\approot(又名网站)文件夹下的旧目录,在 Azure 本地存储资源中创建一个新目录并使用符号链接(symbolic link)链接它。

我建议通过 Sitecore Support 打开支持票证找出解决 30 秒硬编码值的最佳方法。

祝愿奥列格

关于c# - Sitecore azure 无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25740820/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com