【发布时间】:2020-09-16 02:52:34
【问题描述】:
我已经部署了一个 Azure Linux 应用程序服务,它运行一个带有 LoopBack 4 框架的 NodeJS 应用程序已经有一段时间了,但是从上周左右开始,我在使用 Azure DevOps 部署新版本的应用程序时遇到了麻烦。
上周部署应用时,需要多次重启才能启动该应用。从昨天开始,申请可用大约需要 7 个小时,而今天(在撰写本文时)需要 3 个小时。
这目前仅在我的开发环境中(产品将仅在拉取请求时部署),但我认为当我为此部署新版本时,我的生产环境也会发生同样的情况。很遗憾,我目前无法尝试。
当我打开日志流时,除了Waiting for response to warmup request for container,我没有看到任何错误。
我不知道它是否与启动应用程序的超时有关,因为我在“诊断和解决问题”屏幕中收到该错误消息,但是当我运行我的应用程序时,我的开发机器,它会在不到 5 秒的时间内启动。
我尝试通过以下方式将WEBSITES_CONTAINER_START_TIME_LIMIT 设置为1800:
- 门户>应用服务>配置>应用设置
- 用于设置应用设置的 DevOps 作业
但这并没有达到预期的结果,因为我仍然看到Waiting for response to warup request for container 消息。
在 Azure 门户的“诊断和解决问题”屏幕中,我也遇到容器崩溃错误。我希望我会看到关于它失败的原因的某种错误,但我看到的只是以下输出:
Container qusito-core-dev_0_fdc9a431 couldn't be started: Logs = 2020-09-11T13:43:59.410899652Z _____
2020-09-11T13:43:59.410934153Z / _ \ __________ _________ ____
2020-09-11T13:43:59.410938953Z / /_\ \___ / | \_ __ \_/ __ \
2020-09-11T13:43:59.410942753Z / | \/ /| | /| | \/\ ___/
2020-09-11T13:43:59.410946453Z \____|__ /_____ \____/ |__| \___ >
2020-09-11T13:43:59.410950153Z \/ \/ \/
2020-09-11T13:43:59.410953753Z A P P S E R V I C E O N L I N U X
2020-09-11T13:43:59.410957153Z
2020-09-11T13:43:59.410960353Z Documentation: http://aka.ms/webapp-linux
2020-09-11T13:43:59.410963553Z NodeJS quickstart: https://aka.ms/node-qs
2020-09-11T13:43:59.410966853Z NodeJS Version : v10.14.2
2020-09-11T13:43:59.410970153Z Note: Any data outside '/home' is not persisted
2020-09-11T13:43:59.410973453Z
2020-09-11T13:44:00.211504840Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2020-09-11T13:44:00.211887043Z Could not find operation ID in manifest. Generating an operation id...
2020-09-11T13:44:00.211897743Z Build Operation ID: 7cf16daf-ccef-4ad1-b496-50778dafc913
2020-09-11T13:44:02.114481171Z Writing output script to '/opt/startup/startup.sh'
2020-09-11T13:44:02.490713708Z Running #!/bin/sh
2020-09-11T13:44:02.491320612Z
2020-09-11T13:44:02.491332412Z # Enter the source directory to make sure the script runs where the user expects
2020-09-11T13:44:02.491336512Z cd "/home/site/wwwroot"
2020-09-11T13:44:02.491340212Z
2020-09-11T13:44:02.491344012Z export NODE_PATH=$(npm root --quiet -g):$NODE_PATH
2020-09-11T13:44:02.491347512Z if [ -z "$PORT" ]; then
2020-09-11T13:44:02.493136724Z export PORT=8080
2020-09-11T13:44:02.493148924Z fi
2020-09-11T13:44:02.493152724Z
2020-09-11T13:44:02.493341325Z PATH="$PATH:/home/site/wwwroot" npm run start
2020-09-11T13:44:06.600726640Z npm info it worked if it ends with ok
2020-09-11T13:44:06.600776740Z npm info using npm@6.9.0
2020-09-11T13:44:06.600875440Z npm info using node@v10.14.2
2020-09-11T13:44:06.868226973Z npm info lifecycle core@1.0.0~prestart: core@1.0.0
2020-09-11T13:44:06.885230583Z
2020-09-11T13:44:06.885248883Z > core@1.0.0 prestart /home/site/wwwroot
2020-09-11T13:44:06.885253583Z > npm run build
2020-09-11T13:44:06.885264583Z
2020-09-11T13:44:07.662776822Z npm info it worked if it ends with ok
2020-09-11T13:44:07.663855429Z npm info using npm@6.9.0
2020-09-11T13:44:07.664656534Z npm info using node@v10.14.2
2020-09-11T13:44:07.823510864Z npm info lifecycle core@1.0.0~prebuild: core@1.0.0
2020-09-11T13:44:07.824905373Z npm info lifecycle core@1.0.0~build: core@1.0.0
2020-09-11T13:44:07.835657242Z
2020-09-11T13:44:07.835673743Z > core@1.0.0 build /home/site/wwwroot
2020-09-11T13:44:07.835678743Z > lb-tsc
2020-09-11T13:44:07.835682343Z
此时我被这个问题所困扰。我在 SO 上的某处看到了一个参考,即日志流(在 Azure 门户中)不完全支持登录 Linux,但我不知道在哪里可以找到任何其他日志。 对我应该如何前进的任何帮助表示赞赏。
【问题讨论】:
标签: node.js azure npm loopback4 azure-appservice