Azure Devops:Pipeline 无法部署到 Linux Web App

时间:2021-07-09 09:34:26

标签: azure-devops azure-web-app-service

我有一个部署到我的 Azure Web 应用程序的管道,但大多数情况下会出错,因为它无法部署到我的 Web 应用程序。任务大约需要 25 分钟:

...
Copying file: 'frontend/.gitignore'
Copying file: 'frontend/README.md'
Copying file: 'frontend/package.json'
Copying file: 'frontend/tsconfig.json'
Copying file: 'frontend/yarn.lock'
Omitting next output lines...
An error has occurred during web site deployment.
Kudu Sync failed
\n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
##[error]Failed to deploy web package to App Service.
##[error]To debug further please check Kudu stack trace URL : https://$someapp:***@someapp.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace
##[error]Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
...

当我启用:system.debug = true 时,在开始复制工件文件之前,我看到这些日志重复了很多次:

POLL URL RESULT: {"statusCode":202,"statusMessage":"Accepted","headers":{"transfer-encoding":"chunked","content-type":"application/json; charset=utf-8","location":"http://XXXXXXXXX.scm.azurewebsites.net:80/api/deployments/latest?deployer=VSTS_ZIP_DEPLOY&time=2021-07-09_09-01-41Z","server":"Kestrel","date":"Fri, 09 Jul 2021 09:23:37 GMT","connection":"close"},"body":{"id":"68a7a8811796416b993924437493ff87","status":0,"status_text":"Building and Deploying '68a7a8811796416b993924437493ff87'.","author_email":"N/A","author":"N/A","deployer":"VSTS_ZIP_DEPLOY","message":"Created via a push deployment","progress":"Running deployment command...","received_time":"2021-07-09T09:01:50.4159225Z","start_time":"2021-07-09T09:01:51.775357Z","end_time":null,"last_success_end_time":null,"complete":false,"active":false,"is_temp":false,"is_readonly":true,"url":null,"log_url":null,"site_name":"XXXXXXXXXXXXe"}}
Deployment status: 0 'Building and Deploying '68a7a8811796416b993924437493ff87'.'. retry after 5 seconds
setting affinity cookie ["ARRAffinity=c06e9bb74f52245b3695b3079a52f6acbc70c3ee812f67e4fa3f5f65088ff4f7;Path=/;HttpOnly;Secure;Domain=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.scm.azurewebsites.net","ARRAffinitySameSite=c06e9bb74f52245b3695b3079a52f6acbc70c3ee812f67e4fa3f5f65088ff4f7;Path=/;HttpOnly;SameSite=None;Secure;Domain=XXXXXXXXXXXXXXX.scm.azurewebsites.net"]
[GET]https://XXXXXXXXXXX-test.scm.azurewebsites.net:443/api/deployments/latest?deployer=VSTS_ZIP_DEPLOY&time=2021-07-09_09-01-41Z

POLL URL RESULT: {"statusCode":202,"statusMessage":"Accepted","headers":{"transfer-encoding":"chunked","content-type":"application/json; charset=utf-8","location":"http://XXXXXXXXXXXXXXXXXXX.scm.azurewebsites.net:80/api/deployments/latest?deployer=VSTS_ZIP_DEPLOY&time=2021-07-09_09-01-41Z","server":"Kestrel","date":"Fri, 09 Jul 2021 09:23:45 GMT","connection":"close"},"body":{"id":"68a7a8811796416b993924437493ff87","status":0,"status_text":"Building and Deploying '68a7a8811796416b993924437493ff87'.","author_email":"N/A","author":"N/A","deployer":"VSTS_ZIP_DEPLOY","message":"Created via a push deployment","progress":"Running deployment command...","received_time":"2021-07-09T09:01:50.4159225Z","start_time":"2021-07-09T09:01:51.775357Z","end_time":null,"last_success_end_time":null,"complete":false,"active":false,"is_temp":false,"is_readonly":true,"url":null,"log_url":null,"site_name":"XXXXXXXXXXXX"}}
Deployment status: 0 'Building and Deploying '68a7a8811796416b993924437493ff87'.'. retry after 5 seconds
setting affinity cookie ["ARRAffinity=c06e9bb74f52245b3695b3079a52f6acbc70c3ee812f67e4fa3f5f65088ff4f7;Path=/;HttpOnly;Secure;Domain=XXXXXXXXXXXXXXXXXXXXXX.scm.azurewebsites.net","ARRAffinitySameSite=c06e9bb74f52245b3695b3079a52f6acbc70c3ee812f67e4fa3f5f65088ff4f7;Path=/;HttpOnly;SameSite=None;Secure;Domain=XXXXXXXXXXXXXXXXXX"]

此任务仅在 myweb 应用程序中的特定插槽失败,作者插槽和生产插槽工作正常,工作大约需要 6 分钟

有什么想法可能出问题了吗?

1 个答案:

答案 0 :(得分:0)

根据执行 here 的讨论和故障排除,我尝试在 Standard S1 定价层上设置 Linux 应用服务,启用 5(最大)插槽,并通过 Azure Pipelines 配置 CI/CD .不幸的是,尽管进行了多次不同的试验,我还是无法重现与您相同的错误。

我建议您尝试以下操作:

    部署日志中的
  • Kudu Sync failed 类似于大约一年前的未解决问题:ZipDelpoy on azure web app linux fails during kudu sync #2972。请检查 kudu 上 https://<appname>.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/deployment 或 Kudu 的 DebugConsole (/LogFiles/kudu/\*) 上的跟踪/部署日志文件,并检查这是否是由部署锁定失败引起的。在这种情况下,请检查 this wiki 以在部署期间处理锁定的文件。
  • 尝试不同的部署方法,例如 run from package(以避免资源锁定)、使用 FTP/Slocal git deployment。 这应该可以帮助您进一步缩小问题的范围,无论是由应用服务/部署方法引起的,还是由 ADO 管道/任务引起的。
  • 扩展到下一个更高层并重新触发您的管道。如果成功,您可以缩减到原始层。这也会间接重启您的 SCM 站点。

如果上述解决方法没有帮助,您可以检查以下内容:

  • 使用 TakeAppOfflineFlagDeploymentTypeRenameFilesFlag 等选项自定义部署任务以简化部署。
  • 尝试在部署前重新启动应用/插槽以回收应用池。
  • 检查您的应用是否正在运行到您的层级的任何 prescribed limits(例如:文件系统存储)。
  • 深入了解您的应用的 available metrics 以识别任何 CPU/内存异常。
  • 尝试使用 Diagnose and solve problems 工具获取有关您的应用的任何其他见解。
  • 如果您的环境允许,请尝试设置并部署到您的应用服务中的新槽,或尝试验证这是否发生在不同区域的另一个应用中。
相关问题