Azure 应用无法启动并收到 HTTP 500 错误



所以我目前正在运行一个Blazor。NET核心服务器端应用程序在Azure应用程序服务上基于linux的配置,下面是我的环境

System info
System up time: 5.05:06:19.3920000
OS version: Unix 4.15.0.112
64 bit system: True
64 bit process: True
Processor count: 1
Short instance id: bdcba9
CLR version: 4.0.30319.42000
System directory:
Current working directory: /opt/Kudu
IIS command line: /opt/Kudu/Kudu.Services.Web.dll

昨天一切都很好,但到今天为止,我对一些文本做了一个小改动,并重新发布了。突然间,我在kudu日志流中收到了一个HTTP500错误。当试图用我认为不正确的参数(也许是GetMethodFromHandle(获取cultureinfo时,你可以看到它崩溃了。在本地,它运行良好,没有任何问题,也没有遇到任何异常,即使它设置为命中所有/所有异常类型。在我的应用程序中,我也没有设置CultureInfo或使用Locale。

2020-09-12T12:07:40.245382681Z: [INFO]  [41m[30mfail[39m[22m[49m: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
2020-09-12T12:07:40.245431982Z: [INFO]        An unhandled exception has occurred while executing the request.
2020-09-12T12:07:40.247771813Z: [INFO]  System.Globalization.CultureNotFoundException: Culture is not supported. (Parameter 'name')
2020-09-12T12:07:40.247802114Z: [INFO]  ethodFromHandle is an invalid culture identifier.
2020-09-12T12:07:40.247876715Z: [INFO]     at System.Globalization.CultureInfo.GetCultureInfo(String name)
2020-09-12T12:07:40.247892415Z: [INFO]     at System.Reflection.RuntimeAssembly.GetLocale()
2020-09-12T12:07:40.247937615Z: [INFO]     at System.Reflection.RuntimeAssembly.GetName(Boolean copiedName)
2020-09-12T12:07:40.247952516Z: [INFO]     at Microsoft.AspNetCore.Mvc.ViewFeatures.ServerComponentSerializer.CreateSerializedServerComponent(ServerComponentInvocationSequence invocationId, Type rootComponent, ParameterView parameters)
2020-09-12T12:07:40.247999016Z: [INFO]     at Microsoft.AspNetCore.Mvc.ViewFeatures.ComponentRenderer.NonPrerenderedServerComponent(HttpContext context, ServerComponentInvocationSequence invocationId, Type type, ParameterView parametersCollection)
2020-09-12T12:07:40.248015117Z: [INFO]     at Microsoft.AspNetCore.Mvc.ViewFeatures.ComponentRenderer.RenderComponentAsync(ViewContext viewContext, Type componentType, RenderMode renderMode, Object parameters)
2020-09-12T12:07:40.248055617Z: [INFO]     at Microsoft.AspNetCore.Mvc.TagHelpers.ComponentTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
2020-09-12T12:07:40.248079317Z: [INFO]     at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count)
2020-09-12T12:07:40.248117818Z: [INFO]     at BHub.Pages.Pages__Host.<ExecuteAsync>b__15_1() in D:SitesBHubBHubPages_Host.cshtml:line 29
2020-09-12T12:07:40.249937843Z: [INFO]     at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
2020-09-12T12:07:40.249974943Z: [INFO]     at BHub.Pages.Pages__Host.ExecuteAsync() in D:SitesBHubBHubPages_Host.cshtml:line 5
2020-09-12T12:07:40.250014644Z: [INFO]     at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
2020-09-12T12:07:40.267442179Z: [INFO]     at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
2020-09-12T12:07:40.267524481Z: [INFO]     at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
2020-09-12T12:07:40.267669083Z: [INFO]     at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
2020-09-12T12:07:40.267711783Z: [INFO]     at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
2020-09-12T12:07:40.267807784Z: [INFO]     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

我不太确定是什么原因导致了这种情况,我想知道是否有其他人也有类似的情况,或者可以提供一些线索。我知道它从操作系统中获得了文化,但在我这边没有任何变化,它以前也在工作。我不确定我能在本地尝试什么,因为这很好,我有点倾向于Azure App/Linux配置中的问题,但是。。hmph

我不一定会把它称为解决方案,但我基本上注意到,当我部署它时,它并没有像它应该做的那样在推送文件后重新启动web服务器。我删除了这个应用程序,并将其重新添加到部署列表中,让它再次开始这样做,瞧。它现在在部署后重新启动,并且似乎可以再次工作。

Updating file (bhubliveSystem.Runtime.Caching.dll).
Updating file (bhubliveweb.config).
Publish Succeeded.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
Waiting for Web App to be ready...
Restarting the Web App...
Successfully restarted Web App.

相关内容

  • 没有找到相关文章

最新更新