【问题标题】:Sitecore logging exceptionSitecore 日志记录异常
【发布时间】:2014-07-29 13:12:36
【问题描述】:

我最近开始在一个新系统上与 Sitecore 合作。我安装了 IIS,对其进行了配置,并且能够很好地在 IIS 上构建和加载项目。在试图弄清楚为什么启动时间如此缓慢时,它开始给我这个错误。

 Value cannot be null.
Parameter name: message
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.ArgumentNullException: Value cannot be null.
Parameter name: message

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:

[ArgumentNullException: Value cannot be null.
Parameter name: message]
   Sitecore.Diagnostics.Log.Info(String message, Object owner) +309
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +557
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +530
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Value cannot be null.
Parameter name: message]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12966756
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12806561

我尝试了以下方法:

  • 为 TFS 执行完整获取(覆盖所有)并重新构建
  • 提取开发环境中文件的精确副本(有效)
  • 在 Sitecore 中禁用日志记录
  • 从我的本地系统中删除项目并从 TFS 中再次将其拉下,重建
  • 删除 IIS 指向的 inetpub www 文件夹并重新构建
  • 删除并重新添加 IIS 站点和应用程序池
  • 卸载 IIS 并重新安装
  • 从 .NET 框架文件夹中删除临时 ASP.NET 文件
  • 清除 IIS 配置文件(以及重新安装)
  • 清除 .NET machine.config 文件并修复 .NET
  • 向 IIS 重新注册 .NET
  • 更改应用程序池用户
  • 向 inetpub 文件夹、.NET 框架文件夹 (C:\Windows\Microsoft.NET...) 授予非常宽松的权限
  • 将应用程序池用户添加到性能日志用户、性能监视​​器用户
  • 从 /App_Config/Include/ 中删除所有配置文件

目前我不确定还可以尝试什么。

有什么想法吗?

【问题讨论】:

  • 听起来您在某个地方遇到了配置问题。我将首先从 SDN 上的可下载 zip 替换 web.config 和 /App_Config 中的所有内容,然后再次部署您的代码。如果您仍然遇到问题,请同时删除 /bin 中的所有内容,从 zip 中替换并重新部署
  • 我不相信是这样的。从开发环境(运行良好)复制文件没有任何效果 - 它仍然会给出错误。如果这是一个配置问题,要么 dev 也会被破坏,或者精确的副本在本地可以正常工作。
  • 我用库存的 Sitecore 6.6 webconfig 替换了 web 配置,清除了 /App_Config/Include 并将其他 /App_Config 文件更新为默认值。没有改善:(

标签: iis-7.5 sitecore sitecore6


【解决方案1】:

Sitecore 做的第一件事就是开始写出一条消息,上面写着“HttpModule 正在初始化”。在获得异常之前,您是否在日志中看到此消息?您遇到的异常似乎表明初始加载正在尝试提取要记录的消息的详细信息,但没有收到任何信息。

如果您检查您的日志文件,您应该能够看到日志在收到“空”消息并崩溃之前可以达到多远。从那里,将更容易确定下一个典型信息行将是什么并追踪正在发生的事情。

例如,这是一个典型的 6.6 INFO 块,从日志文件的开头开始:

10024 10:26:13 INFO  HttpModule is being initialized
10024 10:26:13 INFO  
10024 10:26:13 INFO  **********************************************************************
10024 10:26:13 INFO  **********************************************************************
10024 10:26:13 INFO  Sitecore started
10024 10:26:13 INFO  Sitecore.NET 6.6.0 (rev. 130529)
10024 10:26:13 INFO  
10024 10:26:13 INFO  C:\Src\TFS\Path\Website\bin\Sitecore.Client.dll (Sitecore CMS, Sitecore Client Application, 6.6.0 rev. 130529)
10024 10:26:13 INFO  C:\Src\TFS\Path\Website\bin\Sitecore.Kernel.dll (Sitecore CMS, Sitecore CMS Kernel Library, 6.6.0 rev. 130529)
10024 10:26:13 INFO  C:\Src\TFS\Path\Website\bin\Sitecore.Nexus.dll (Sitecore.Nexus)
10024 10:26:13 INFO  
10024 10:26:13 INFO  Operating system Microsoft Windows NT 6.1.7601 Service Pack 1
10024 10:26:13 INFO  
10024 10:26:13 INFO  Microsoft.NET version 4.0.30319.18444
10024 10:26:13 INFO  
10024 10:26:13 INFO  Process id: 12132
10024 10:26:13 INFO  Windows identity used by the process: IIS APPPOOL\MyAppPoolUser. Impersonation: True
10024 10:26:13 INFO  Managed pipeline mode: Integrated
10024 10:26:13 INFO  
10024 10:26:13 INFO  EventQueues enabled: False
10024 10:26:13 INFO  Instance Name:MyInstanceName
10024 10:26:13 INFO  
10024 10:26:13 INFO  Threshold settings
10024 10:26:13 INFO    Show threshold warnings: False
10024 10:26:13 INFO  
10024 10:26:13 INFO  Databases
10024 10:26:13 INFO    core
10024 10:26:13 INFO    master
10024 10:26:13 INFO    web
10024 10:26:13 INFO    filesystem
10024 10:26:13 INFO  
10024 10:26:13 INFO  Domains
10024 10:26:13 INFO  Heartbeat - Initializing
10024 10:26:13 INFO  Heartbeat - Interval set to: 00:00:02
10024 10:26:13 INFO  Heartbeat - Worker thread started
10024 10:26:13 INFO  Trying to load XML configuration /App_Config/Security/Domains.config
10024 10:26:13 INFO    sitecore
10024 10:26:13 INFO    extranet
10024 10:26:13 INFO    default
10024 10:26:13 INFO  **********************************************************************
10024 10:26:13 INFO  **********************************************************************
10024 10:26:13 INFO  Attempting to get ASP.NET process history
10024 10:26:13 WARN  No process history available

【讨论】:

  • Jay,很遗憾没有创建日志文件(尽管所有日志记录设置都已打开)。我也没有得到一个elmah。日志文件在 dev 上生成,并在此开始之前在本地生成。
  • 那么接下来的事情可能就是按照@jammykam 的建议去做,并尝试在您的机器上运行一个全新的 Sitecore 安装。如果可行,那么您可以开始查看 Sitecore 的干净版本与您的构建之间的差异。您可能缺少必要的包含文件或 DLL。
  • 哦,它确实通过额外的尝试生成了一些日志。这就是全部内容:(这不过是 3 次)2552 14:15:38 WARN Counter category 'Sitecore.System' does not exist on this server.
  • 您可能希望确保您的日志记录一直打开(即 INFO 或 DEBUG)以确保您看到所有内容。如果您收到的第一条消息是警告,则可能表明您的日志记录级别不够高,无法查看所有消息
  • 此外,该特定错误表明应用程序正在请求 Sitecore 计数器,但它们不可用。
猜你喜欢
  • 2011-10-23
  • 2011-01-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-02
  • 1970-01-01
  • 2011-07-04
相关资源
最近更新 更多