node.js - Azure YAML 部署失败并显示“错误:无法将 Web 包部署到应用服务。冲突(代码:409)”
问题描述
希望有人也看到了这一点。我们最后一次成功的构建是在 2019 年 12 月 6 日。新的部署尝试在部署步骤中失败了(构建和发布管道中的相同问题)。
报错如下:
Got service connection details for Azure App Service:'OUR SITE'
Package deployment using ZIP Deploy initiated.
##[error]Failed to deploy web package to App Service.
##[error]Error: Error: Failed to deploy web package to App Service. Conflict (CODE: 409)
##[warning]Error: Failed to update deployment history. Error: Bad Request (CODE: 400)
App Service Application URL: OUR SITE
这是我们的部署YAML
,很抱歉这几天一直在这里:(
# Node.js Express Web App to Linux on Azure
# Build a Node.js Express app and deploy it to Azure as a Linux web app.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
variables:
# Azure Resource Manager connection created during pipeline creation
azureSubscription: '[OUR SUB ID]'
# Web app name
webAppName: 'website-to-deploy'
# Environment name
environmentName: 'web-to-deploy'
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build --if-present
npm run test --if-present
displayName: 'npm install, build and test'
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
archiveType: zip
archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
replaceExistingArchive: true
- upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
artifact: drop
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'OUR SUBSCRIPTION'
appType: 'webAppLinux'
WebAppName: 'site-to-deploy'
packageForLinux: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
RuntimeStack: 'NODE|12-lts'
StartupCommand: 'npm start'
AppSettings: 'WE DO HAVE SOME SETTINGS'
请注意:我已尝试添加WEBSITE_WEBDEPLOY_USE_SCM = true
到配置中,但没有帮助。
上述构建没有任何更改,YAML
成功运行并输入发布管道
谢谢你的帮助。
更新:使用 MS Dev-Ops 提出的票您可以system.debug: true
在变量部分添加以获得更详细的日志记录。
这让我看到它AppService
返回了409
代码,因为它认为已经在进行部署。如果并且当我得到解决方案时,我将编辑这篇文章。
这是调试信息:
##[debug]Encountered a retriable status code: 409. Message: 'Conflict'.
##[debug][POST]https://$web040-glndev-com:***@web040-glndev-com.scm.azurewebsites.net/api/zipdeploy?isAsync=true&deployer=VSTS_ZIP_DEPLOY
##[debug]Could not parse response: {}
##[debug]Response: undefined
##[debug]Encountered a retriable status code: 409. Message: 'Conflict'.
##[debug][POST]https://$web040-glndev-com:***@web040-glndev-com.scm.azurewebsites.net/api/zipdeploy?isAsync=true&deployer=VSTS_ZIP_DEPLOY
##[debug]Could not parse response: {}
##[debug]Response: undefined
##[debug]ZIP Deploy response: {"statusCode":409,"statusMessage":"Conflict","headers":{"transfer-encoding":"chunked","content-type":"text/plain; charset=utf-8","server":"Kestrel","date":"Wed, 15 Jan 2020 17:40:47 GMT","connection":"close"},"body":"There is a deployment currently in progress. Please try again when it completes."}
##[error]Failed to deploy web package to App Service.
##[debug]Processed: ##vso[task.issue type=error;]Failed to deploy web package to App Service.
##[debug]task result: Failed
##[error]Error: Error: Failed to deploy web package to App Service. Conflict (CODE: 409)
##[debug]Processed: ##vso[task.issue type=error;]Error: Error: Failed to deploy web package to App Service. Conflict (CODE: 409)
##[debug]Processed: ##vso[task.complete result=Failed;]Error: Error: Failed to deploy web package to App Service. Conflict (CODE: 409)
##[debug][POST]https://management.azure.com/subscriptions/7a7aad03-79b0-4118-8dd1-8ebd63716c6a/resourceGroups/appsvc_linux_centralus/providers/Microsoft.Web/sites/web040-glndev-com/config/appsettings/list?api-version=2016-08-01
##[debug]Correlation ID from ARM api call response : e4ebaf0f-7ccf-4b7b-ba4d-b70b8fd13bea
##[debug]Application Insights is not configured for the App Service. Skipping adding release annotation.
票在这里:409 无法部署 web 包
解决方案
重新启动应用服务解决了我的问题。
我的应用服务计划已经是付费订阅,容量没有问题。我刚刚重新启动了应用服务,一切正常。
推荐阅读
- r - 从 SAS 过渡到 R——如何在 R 中有效地重复相同的任务
- android - PlayerNotificationManager 未显示在 exoplayer、android 上播放视频的通知?
- sql - 添加与其他列相关的检查约束
- xcode - XCode 11:后台区域监控不起作用
- sharepoint - 禁用列表/文档库上的 PowerApps 按钮
- c++ - 如何使特征接受参数包?
- c++ - 使用开放寻址在哈希表中插入节点[优化逻辑]
- node.js - 如何在进行 ember 生产构建时隐藏 .hbs 和 .js 中的部分
- python - 如果我们有概率密度函数数据作为 x 和 y,则计算百分位数
- gcloud - gcloud pubsub 发布消息问题