简体   繁体   中英

Constant crashes of ASP.NET Core app on IIS with Windows10

We are running a web application using ASP CORE. Unfortunately while inspecting Event Viewer Manager I noticed weird crashes and restarts of the app.

Error log looks like this:

Faulting application name: dotnet.exe, version: 1.1.0.1179, time stamp: 0x58224b03
Faulting module name: KERNELBASE.dll, version: 10.0.14393.1770, time stamp: 0x59bf2ba6
Exception code: 0xe0434352
Fault offset: 0x0000000000033c58
Faulting process id: 0x3ec4
Faulting application start time: 0x01d3885e41a55d69
Faulting application path: C:\Program Files\dotnet\dotnet.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: 20b0cbe4-423e-4adf-ba0f-848a38ea967b
Faulting package full name:
Faulting package-relative application ID:

What I investigated was memory leaks of dotnet.exe process. But it doesn't seem to be the issue since private bytes parameter doesn't rise. Here I attach the graph of 20 minutes of app runtime. Crashes and restarts are constant and occur every 2 minutes.

在此处输入图片说明

Have you got any ideas how can I investigate my issue?

Ok, I found what was causing the problem. Digging into stdout logs of application I noticed:

Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'C:\...\wwwroot\...\...\XYZ-v.json' is denied.
at System.IO.Win32FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at XYZ.Utils.Dashboard.DashboardController.SaveToFile()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()

The solution was to add full permissions for IIS user to this file.

Silly me :)

可能,您可以尝试在应用程序池上启用 32 位应用程序

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM