Azure应用将无法启动并出现HTTP 500错误

时间:2020-09-12 12:13:00

标签: azure azure-web-app-service blazor blazor-server-side azure-appservice

所以我目前正在基于Linux的配置中在Azure App Services上运行Blazor .NET Core服务器端应用程序,以下是我的环境

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日志流中收到HTTP 500错误。当尝试获取我认为是不正确的参数的cultureinfo时,您可能会看到它崩溃(也许是GetMethodFromHandle),即使将其设置为可以击中所有/所有异常类型,它在本地也可以正常运行,没有问题,也没有任何异常。我的应用程序中也没有地方设置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:\Sites\BHub\BHub\Pages\_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:\Sites\BHub\BHub\Pages\_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

1 个答案:

答案 0 :(得分:2)

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

Updating file (bhublive\System.Runtime.Caching.dll).
Updating file (bhublive\web.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.
Web App is ready.