gpt4 book ai didi

Linux 上的 Azure Web 应用程序突然停止工作

转载 作者:行者123 更新时间:2023-12-04 13:52:38 29 4
gpt4 key购买 nike

我在 Azure Web 应用程序 (Linux) 上部署了一个基于 .NET Core 5 的 Web 应用程序。 Web 应用程序的部署通过 Azure DevOps 进行,最后一次部署发生在 4 月底,没有人以任何形式接触 Web 应用程序。

但是,应用程序突然停止并使用默认 Azure 页面“您的应用程序服务已启动并正在运行”进行响应。根据 AppInsights 的数据,该应用程序没有承受任何重负载,只有少数人的网络 CPU 和 RAM 约为 20%。 “始终开启”设置已打开。

根据下面的日志,我假设运行我的网络应用程序的计算机由于某种原因重新启动(我猜是 Azure 维护)我发现它无法找到启动所需的文件,因此它使用默认的 Azure 页面。但是,我不明白为什么文件在那里,而且,正如您在 9:52 看到的,我们通过 Azure 门户手动重新启动了 Web 应用程序,它解决了问题。

我正在寻求有关防止这种行为的建议,因为这是第二次发生这种情况,第一次是 5 个月前。谢谢


/appsvctmp/volatile/logs/runtime/bf30e8c59ba178a56a30e0d094f31d1ca4dfed5fef11f3a5f521ec418a4f26a0.log
2021-06-10T09:52:45.113197498Z: [INFO] ASP .NETCore Version: 5.0.3
2021-06-10T09:52:45.113202598Z: [INFO] Note: Any data outside '/home' is not persisted
2021-06-10T09:52:45.136558888Z: [INFO] Running oryx create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -defaultAppFilePath /defaulthome/hostingstart/hostingstart.dll -bindPort 8080 -userStartupCommand ''
2021-06-10T09:52:45.143249243Z: [INFO] Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2021-06-10T09:52:45.143290643Z: [INFO] Could not find operation ID in manifest. Generating an operation id...
2021-06-10T09:52:45.143644646Z: [INFO] Build Operation ID: d16c01f9-bcff-40dc-9efb-5ece15c2dbdc
2021-06-10T09:52:46.219921700Z: [INFO] Writing output script to '/opt/startup/startup.sh'
2021-06-10T09:52:46.609737971Z: [INFO] Trying to find the startup DLL name...
2021-06-10T09:52:46.609773771Z: [INFO] Found the startup D name: MyApp.dll
2021-06-10T09:52:46.609780971Z: [INFO] Running the command: dotnet "MyApp.dll"


/appsvctmp/volatile/logs/runtime/9e3c16f1b56384c8bac17db8e768f5f5099fe35a4991801a6e83e4f337d68c9c.log
2021-06-10T09:43:08.196901399Z: [INFO] Build Operation ID: 51765fea-d04c-49e3-b4e4-9a4bbbc68436
2021-06-10T09:43:09.231514603Z: [INFO] An error occurred while trying to look for '.runtimeconfig.json' files under '/home/site/wwwroot'.
2021-06-10T09:43:09.685030062Z: [INFO] WARNING: Unable to find the startup DLL name. Could not find any files with extension '.runtimeconfig.json'
2021-06-10T09:43:10.119271456Z: [INFO] Writing output script to '/opt/startup/startup.sh'
2021-06-10T09:43:10.294162644Z: [INFO] Trying to find the startup DLL name...
2021-06-10T09:43:10.294223844Z: [INFO] Running the default app using command: dotnet "/defaulthome/hostingstart/hostingstart.dll"
2021-06-10T09:43:10.460518558Z: [INFO] Hosting environment: Production
2021-06-10T09:43:10.460618459Z: [INFO] Content root path: /defaulthome/hostingstart/
2021-06-10T09:43:10.460630159Z: [INFO] Now listening on: http://[::]:8080
2021-06-10T09:43:10.460634759Z: [INFO] Application started. Press Ctrl+C to shut down.


/appsvctmp/volatile/logs/runtime/45188b981fba42d5a512175877e15093cac84c9a73b0296a782fb5b64882be69.log
2021-06-10T09:38:11.131655396Z: [INFO] Build Operation ID: db220961-7c36-4051-b3f5-668b96e819a9
2021-06-10T09:38:12.454815722Z: [INFO] An error occurred while trying to look for '.runtimeconfig.json' files under '/home/site/wwwroot'.
2021-06-10T09:38:12.636611612Z: [INFO] WARNING: Unable to find the startup DLL name. Could not find any files with extension '.runtimeconfig.json'
2021-06-10T09:38:13.064061230Z: [INFO] Writing output script to '/opt/startup/startup.sh'
2021-06-10T09:38:13.647112171Z: [INFO] Trying to find the startup DLL name...
2021-06-10T09:38:13.647167671Z: [INFO] Running the default app using command: dotnet "/defaulthome/hostingstart/hostingstart.dll"
2021-06-10T09:38:14.165655564Z: [INFO] Hosting environment: Production
2021-06-10T09:38:14.165687265Z: [INFO] Content root path: /defaulthome/hostingstart/
2021-06-10T09:38:14.165693365Z: [INFO] Now listening on: http://[::]:8080
2021-06-10T09:38:14.165697865Z: [INFO] Application started. Press Ctrl+C to shut down.

wwwroot文件夹下的文件系统

AutoMapper.dll
Cronos.dll
Humanizer.dll
MyApp
MyApp.BackOffice.Rcl.Views.dll
MyApp.BackOffice.Rcl.Views.pdb
MyApp.BackOffice.Rcl.dll
MyApp.BackOffice.Rcl.pdb
MyApp.Domain.dll
MyApp.Domain.pdb
MyApp.Domain.xml
MyApp.Infrastructure.dll
MyApp.Infrastructure.pdb
MyApp.deps.json
MyApp.dll
MyApp.pdb
MyApp.runtimeconfig.json
MyApp.xml
JWT.dll
Joonasw.AspNetCore.SecurityHeaders.dll
MetadataExtractor.dll
Microsoft.AI.DependencyCollector.dll
Microsoft.AI.EventCounterCollector.dll
Microsoft.AI.PerfCounterCollector.dll
Microsoft.AI.ServerTelemetryChannel.dll
Microsoft.AI.WindowsServer.dll
Microsoft.ApplicationInsights.AspNetCore.dll
Microsoft.ApplicationInsights.dll
Microsoft.AspNetCore.Authentication.JwtBearer.dll
Microsoft.AspNetCore.AzureAppServices.HostingStartup.dll
Microsoft.AspNetCore.AzureAppServicesIntegration.dll
Microsoft.AspNetCore.Identity.EntityFrameworkCore.dll
Microsoft.AspNetCore.Mvc.Razor.Extensions.dll
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.dll
Microsoft.AspNetCore.Razor.Language.dll
Microsoft.Azure.KeyVault.WebKey.dll
Serilog.Formatting.Compact.dll
Serilog.Settings.Configuration.dll
Serilog.Sinks.ApplicationInsights.dll
Serilog.Sinks.Async.dll
Serilog.Sinks.Console.dll
Serilog.Sinks.Debug.dll
Serilog.Sinks.File.dll
Serilog.Sinks.PeriodicBatching.dll
Serilog.Sinks.Seq.dll
Serilog.Sinks.Slack.dll
Serilog.dll
StarkbankEcdsa.dll
Swashbuckle.AspNetCore.Annotations.dll
Swashbuckle.AspNetCore.Swagger.dll
Swashbuckle.AspNetCore.SwaggerGen.dll
Swashbuckle.AspNetCore.SwaggerUI.dll
System.Composition.AttributedModel.dll
System.Composition.Convention.dll
System.Composition.Hosting.dll
System.Composition.Runtime.dll
System.Composition.TypedParts.dll
System.Configuration.ConfigurationManager.dll
System.Diagnostics.DiagnosticSource.dll
System.Diagnostics.PerformanceCounter.dll
System.IdentityModel.Tokens.Jwt.dll
System.Runtime.Caching.dll
System.Security.Cryptography.ProtectedData.dll
Twilio.dll
XmpCore.dll
appsettings.json
appsettings.production.json
appsettings.staging.json
cs
de
dotnet-aspnet-codegenerator-design.dll
es
fr
it
ja
ko
pl
pt-BR
refs
ru
runtimes

最佳答案

显然,您提到的维护是存储故障转移(卷路径更改的文件服务器重新启动),当发生这种情况时,平台会将您的应用程序切换到辅助存储。

.NET Core 应用程序有时会出现找不到启动所需的文件的情况,因为构建过程在应用程序仍在启动时找不到要运行的正确 DLL。

同时,在启动命令中指定要运行的 DLL 将是避免此问题再次发生的好方法。

在门户 -> 配置 -> 常规设置 -> 启动命令中:

dotnet example.dll

关于Linux 上的 Azure Web 应用程序突然停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67919288/

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