ASP.NET Core 2, IIS应用程序池崩溃并停止运行。

11

我刚刚将一个Web应用程序更新为在运行Windows Server 2008 R2上的IIS 7.5上运行的ASP.NET Core 2.0。自从升级以来,该应用程序会随机崩溃,并留下“503服务不可用响应”。它可以运行数小时后崩溃。

在崩溃之前,事件查看器中会出现一些警告,然后是一个错误。

警告示例:

A process serving application pool '<My app pool>' terminated unexpectedly. The process id was '14896'. The process exit code was '0x0'.

另一个警告的例子:

A process serving application pool '<My app pool>' suffered a fatal communication error with the Windows Process Activation Service. The process id was '18252'. The data field contains the error number.

错误示例:

Application pool '<My app pool>' is being automatically disabled due to a series of failures in the process(es) serving that application pool.

我猜这个崩溃/错误是由IIS中的快速失败功能引起的,但我无法确定原始警告的原因。

我也有一些像下面这样的运行时错误,但我不确定它们与此问题有多大关联:

{
  "@t": "2017-11-20T15:24:24.3190000Z",
  "@m": "Request timed out.",
  "@i": "0307d0fb",
  "@l": "Error",
  "@x": "Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Request timed out.\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.PipeCompletion.ThrowFailed()\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.Pipe.GetResult(ReadResult& result)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.Pipe.Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.IReadableBufferAwaiter.GetResult()\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.ReadableBufferAwaitable.GetResult()\r\n   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.<ConsumeAsync>d__24.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()",
  "SourceContext": "xxxx.Extensions.GlobalExceptionFilter",
  "ActionId": "97118189-7c25-427b-82c7-10b3d885a146",
  "ActionName": "xxxx.Controllers.FileController.Upload (xxxx)",
  "RequestId": "0HL9G4JA0VTIJ:00000073",
  "RequestPath": "/api/file"
}

事件查看器还会为涉及的应用程序池报告此类错误:

An unhandled win32 exception occurred in w3wp.exe [18244]. Just-In-Time debugging this exception failed with the following error: Debugger could not be started because no user is logged on.

Check the documentation index for 'Just-in-time debugging, errors' for more information.

并且...

Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: aspnetcore.dll, version: 7.1.1982.0, time stamp: 0x594ab904
Exception code: 0xc0000005
Fault offset: 0x000000000000fe3b
Faulting process id: 0x1ef0
Faulting application start time: 0x01d3622d8eb0e8c0
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\system32\inetsrv\aspnetcore.dll
Report Id: ce37e890-ce20-11e7-9f93-00155dc82c03

我真的需要帮忙找出这些崩溃的源头。


你是否已经在IIS上安装了aspnetcore模块?如果只是在该机器上运行dotnet run,它是否能够正常运行? - Muqeet Khan
是的。应用程序可以启动并运行多个小时,然后突然崩溃。 - Johan Nordberg
AspNetCoreModule github项目上正在跟踪一个类似的错误。 - Aymeric Barthe
我们有同样的问题。到目前为止有什么解决方案吗? - SepehrM
不是我的问题。最终创建了一个定时任务,每五分钟尝试启动池。 - Johan Nordberg
很不幸。我们正在将东西存储在内存缓存中,无法承受每小时丢失它们的代价。 - SepehrM
1个回答

3
微软现已更新了ASP.NET Core的IIS模块,这解决了该问题。

你有关于IIS模块更新的参考资料吗(例如“我可以安装KB吗”)? - Igor Soloydenko
1
请查看我在Github上关于AspNetCoreModule问题的倒数第二个评论。 https://github.com/aspnet/AspNetCoreModule/issues/258 - Johan Nordberg
所以,这是.NET Core的更新,而不是通过KB的IIS更新,我理解得对吗?谢谢提供链接。 - Igor Soloydenko
1
这是针对 .NET Core 的 IIS 模块的更新,因此不是 KB 号。 - Johan Nordberg

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接