gpt4 book ai didi

Azure Web 应用服务 "container is unhealthy"错误强制容器每 15 分钟重新启动一次

转载 作者:行者123 更新时间:2023-12-02 17:59:48 26 4
gpt4 key购买 nike

我有一个在 Azure Web 应用程序环境 (Linux) 中运行的 dot net core 3.1 应用程序。该应用程序在本地环境/调试中运行良好。发布到 Azure 时,应用程序会运行,但在应用程序日志中,我看到容器由于不健康的容器消息而每隔约 15 分钟重新启动一次。内存和处理器负载远低于 50%,并且应用程序上没有特殊负载。

我不知道为什么它在日志中显示“不健康”并如此频繁地重新启动容器。配置设置中是否缺少任何内容?

为什么容器会频繁重新启动以及在哪里查找更多错误特定信息来调试此问题?

欢迎任何提示。

应用程序日志:

2020-10-06T08:08:57.693Z INFO  - Starting container for site
2020-10-06T08:08:57.693Z INFO - docker run -d -p 5159:8080 --name wttcycleswebapp_0_8c7e9ba1 -e WEBSITE_SITE_NAME=WTTCyclesWebApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wttcycleswebapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=92c475eedd41771f9c6f8d7f8c52ad11b610d1d082a92269eb132b8b216a0d8d -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:3.1-latest_20200717.2 dotnet Cycles.dll

2020-10-06T08:08:58.845Z INFO - Initiating warmup request to container wttcycleswebapp_0_8c7e9ba1 for site wttcycleswebapp
2020-10-06T08:09:04.094Z INFO - Container wttcycleswebapp_0_8c7e9ba1 for site wttcycleswebapp initialized successfully and is ready to serve requests.
2020-10-06T08:24:34.102Z ERROR - Container for wttcycleswebapp_0_8c7e9ba1 site wttcycleswebapp is unhealthy, Stopping site.
2020-10-06T08:24:34.102Z INFO - Stopping site wttcycleswebapp because it is not healthy.
2020-10-06T08:27:15.247Z INFO - Starting container for site
2020-10-06T08:27:15.248Z INFO - docker run -d -p 6236:8080 --name wttcycleswebapp_0_6391dc4a -e WEBSITE_SITE_NAME=WTTCyclesWebApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wttcycleswebapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=92c475eedd41771f9c6f8d7f8c52ad11b610d1d082a92269eb132b8b216a0d8d -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:3.1-latest_20200717.2 dotnet Cycles.dll

2020-10-06T08:27:16.384Z INFO - Initiating warmup request to container wttcycleswebapp_0_6391dc4a for site wttcycleswebapp
2020-10-06T08:27:20.657Z INFO - Container wttcycleswebapp_0_6391dc4a for site wttcycleswebapp initialized successfully and is ready to serve requests.
2020-10-06T08:36:35.799Z ERROR - Container for wttcycleswebapp_0_6391dc4a site wttcycleswebapp is unhealthy, Stopping site.
2020-10-06T08:36:35.799Z INFO - Stopping site wttcycleswebapp because it is not healthy.
2020-10-06T08:36:38.668Z INFO - Starting container for site
2020-10-06T08:36:38.669Z INFO - docker run -d -p 3648:8080 --name wttcycleswebapp_0_6ad6dbd7 -e WEBSITE_SITE_NAME=WTTCyclesWebApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wttcycleswebapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=92c475eedd41771f9c6f8d7f8c52ad11b610d1d082a92269eb132b8b216a0d8d -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:3.1-latest_20200717.2 dotnet Cycles.dll

2020-10-06T08:36:39.633Z INFO - Initiating warmup request to container wttcycleswebapp_0_6ad6dbd7 for site wttcycleswebapp
2020-10-06T08:36:43.884Z INFO - Container wttcycleswebapp_0_6ad6dbd7 for site wttcycleswebapp initialized successfully and is ready to serve requests.
2020-10-06T08:51:38.900Z ERROR - Container for wttcycleswebapp_0_6ad6dbd7 site wttcycleswebapp is unhealthy, Stopping site.
2020-10-06T08:51:38.901Z INFO - Stopping site wttcycleswebapp because it is not healthy.
2020-10-06T08:51:39.775Z INFO - Starting container for site
2020-10-06T08:51:39.776Z INFO - docker run -d -p 3002:8080 --name wttcycleswebapp_0_f59f6020 -e WEBSITE_SITE_NAME=WTTCyclesWebApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wttcycleswebapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=92c475eedd41771f9c6f8d7f8c52ad11b610d1d082a92269eb132b8b216a0d8d -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:3.1-latest_20200717.2 dotnet Cycles.dll

2020-10-06T08:51:40.854Z INFO - Initiating warmup request to container wttcycleswebapp_0_f59f6020 for site wttcycleswebapp
2020-10-06T08:51:45.135Z INFO - Container wttcycleswebapp_0_f59f6020 for site wttcycleswebapp initialized successfully and is ready to serve requests.
2020-10-06T09:23:50.153Z ERROR - Container for wttcycleswebapp_0_f59f6020 site wttcycleswebapp is unhealthy, Stopping site.
2020-10-06T09:23:50.154Z INFO - Stopping site wttcycleswebapp because it is not healthy.
2020-10-06T09:23:50.958Z INFO - Starting container for site
2020-10-06T09:23:50.959Z INFO - docker run -d -p 3270:8080 --name wttcycleswebapp_0_0c8ce05e -e WEBSITE_SITE_NAME=WTTCyclesWebApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wttcycleswebapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=92c475eedd41771f9c6f8d7f8c52ad11b610d1d082a92269eb132b8b216a0d8d -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:3.1-latest_20200717.2 dotnet Cycles.dll

2020-10-06T09:24:01.308Z INFO - Initiating warmup request to container wttcycleswebapp_0_0c8ce05e for site wttcycleswebapp
2020-10-06T09:24:01.600Z INFO - Container wttcycleswebapp_0_0c8ce05e for site wttcycleswebapp initialized successfully and is ready to serve requests.
2020-10-06T11:00:33.648Z INFO - Starting container for site
2020-10-06T11:00:33.649Z INFO - docker run -d -p 4757:8080 --name wttcycleswebapp_2_de12fb53 -e WEBSITE_SITE_NAME=WTTCyclesWebApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wttcycleswebapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=92c475eedd41771f9c6f8d7f8c52ad11b610d1d082a92269eb132b8b216a0d8d -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:3.1-latest_20200717.2 dotnet Cycles.dll

2020-10-06T11:00:35.792Z INFO - Initiating warmup request to container wttcycleswebapp_2_de12fb53 for site wttcycleswebapp
2020-10-06T11:00:42.307Z INFO - Container wttcycleswebapp_2_de12fb53 for site wttcycleswebapp initialized successfully and is ready to serve requests.
2020-10-06T11:16:17.316Z ERROR - Container for wttcycleswebapp_2_de12fb53 site wttcycleswebapp is unhealthy, Stopping site.
2020-10-06T11:16:17.316Z INFO - Stopping site wttcycleswebapp because it is not healthy.
2020-10-06T11:16:24.769Z INFO - Starting container for site
2020-10-06T11:16:24.769Z INFO - docker run -d -p 1185:8080 --name wttcycleswebapp_0_3904d3bf -e WEBSITE_SITE_NAME=WTTCyclesWebApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wttcycleswebapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=92c475eedd41771f9c6f8d7f8c52ad11b610d1d082a92269eb132b8b216a0d8d -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:3.1-latest_20200717.2 dotnet Cycles.dll

2020-10-06T11:16:25.662Z INFO - Initiating warmup request to container wttcycleswebapp_0_3904d3bf for site wttcycleswebapp
2020-10-06T11:16:36.943Z INFO - Container wttcycleswebapp_0_3904d3bf for site wttcycleswebapp initialized successfully and is ready to serve requests.
2020-10-06T11:31:56.959Z ERROR - Container for wttcycleswebapp_0_3904d3bf site wttcycleswebapp is unhealthy, Stopping site.
2020-10-06T11:31:56.959Z INFO - Stopping site wttcycleswebapp because it is not healthy.
2020-10-06T11:31:58.658Z INFO - Starting container for site
2020-10-06T11:31:58.659Z INFO - docker run -d -p 2576:8080 --name wttcycleswebapp_0_590a51f3 -e WEBSITE_SITE_NAME=WTTCyclesWebApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wttcycleswebapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=92c475eedd41771f9c6f8d7f8c52ad11b610d1d082a92269eb132b8b216a0d8d -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:3.1-latest_20200717.2 dotnet Cycles.dll

2020-10-06T11:31:59.684Z INFO - Initiating warmup request to container wttcycleswebapp_0_590a51f3 for site wttcycleswebapp
2020-10-06T11:32:03.912Z INFO - Container wttcycleswebapp_0_590a51f3 for site wttcycleswebapp initialized successfully and is ready to serve requests.

另外,我在“容器崩溃”日志中可以看到:

Container exited unexpectedly: last 10 seconds logs [
2020-10-06T11:16:14.928728537Z Could not open output /home/logs/dumps/coredump.f7d267b6a38a.28.1601982035: No such file or directory
2020-10-06T11:16:14.931442136Z Writing minidump with heap to file /home/logs/dumps/coredump.f7d267b6a38a.28.1601982035
2020-10-06T11:16:15.118711399Z /opt/startup/startup.sh: line 10: 28 Aborted (core dumped) dotnet Cycles.dll
]

最佳答案

尝试在文件系统上写入日志时,您的应用程序似乎崩溃了。如果您的日志写入磁盘或每 15 分钟轮换一次,这可能是失败的原因。作为一个好的做法,最好将日志重定向到标准控制台输出,而不是将它们写入文件系统。

另一个可能的解释可能是日志位置的权限问题

关于Azure Web 应用服务 "container is unhealthy"错误强制容器每 15 分钟重新启动一次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64225671/

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