首页 > 解决方案 > Azure Devops 管道 PublishBuildArtifact 任务错误容器找不到

问题描述

我正在尝试在 ADO 管道中发布构建工件,但最终出现了问题

由于找不到容器而无法上传工件

早些时候,相同的脚本运行良好。

我所做的唯一更改是设置trigger: none而不是trigger: master以停止 CI 构建触发器并手动运行管道。

yaml

trigger:
- master

pool:
  vmImage: windows-2019

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '16.x'
  displayName: 'Node.js Install'

- task: Npm@1
  inputs:
    command: 'install'
    workingDir: '$(System.DefaultWorkingDirectory)\OnlineBooking'

- script: |
    workingDir: '$(System.DefaultWorkingDirectory)'
    node build.js
  displayName: 'Build Project'

- task: CopyFiles@2
  inputs:
    SourceFolder: 'D:\a\1\s\temp\OnlineBooking\build\wap\build'
    Contents: 'OnlineBooking.zip'
    TargetFolder: '$(build.artifactstagingdirectory)'
    CleanTargetFolder: true

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'
    ArtifactName: 'OnlineBooking'

日志:

Retry attempt 0. Exception: The container 16892178 could not be found. 
2021-08-13T15:05:54.9483088Z Intermittent failure attempting to call the restapis System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage] <AssociateAsync>b__0(). Retry attempt 1. Exception: The container 16892178 could not be found. 
2021-08-13T15:05:54.9484146Z Intermittent failure attempting to call the restapis System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage] <AssociateAsync>b__0(). Retry attempt 2. Exception: The container 16892178 could not be found. 
2021-08-13T15:05:54.9485219Z Fail to upload 'OnlineBooking/OnlineBooking.zip' due to 'The container 16892178 could not be found.'.
2021-08-13T15:05:54.9487833Z Microsoft.VisualStudio.Services.FileContainer.ContainerNotFoundException: The container 16892178 could not be found.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.CreateItemForArtifactUpload(Int64 containerId, String itemPath, Guid scopeIdentifier, String artifactHash, Int64 fileLength, CancellationToken cancellationToken, Object userState)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.FileContainerServer.<>c__DisplayClass17_1.<<AssociateAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Services.Agent.Worker.RetryHelper.Retry[T](Func`1 action, Func`2 timeDelayInterval, Func`2 shouldRetryOnException)
   at Microsoft.VisualStudio.Services.Agent.Worker.RetryHelper.Retry[T](Func`1 action, Func`2 timeDelayInterval, Func`2 shouldRetryOnException)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.FileContainerServer.AssociateAsync(IAsyncCommandContext context, ConcurrentQueue`1 associateQueue, CancellationToken token)
2021-08-13T15:05:54.9490406Z 1 files failed to upload, retry these files after a minute.
2021-08-13T15:05:54.9490658Z Retry file upload after 60 seconds.
2021-08-13T15:06:00.0088101Z Retry file upload after 55 seconds.
2021-08-13T15:06:05.0568617Z Retry file upload after 50 seconds.
2021-08-13T15:06:10.1177816Z Retry file upload after 45 seconds.
2021-08-13T15:06:15.2097932Z Retry file upload after 40 seconds.
2021-08-13T15:06:19.7734672Z Retry file upload after 35 seconds.
2021-08-13T15:06:24.8510986Z Retry file upload after 30 seconds.
2021-08-13T15:06:29.9148313Z Retry file upload after 25 seconds.
2021-08-13T15:06:34.9479097Z Retry file upload after 20 seconds.
2021-08-13T15:06:40.0238444Z Retry file upload after 15 seconds.
2021-08-13T15:06:45.0731398Z Retry file upload after 10 seconds.
2021-08-13T15:06:50.1178453Z Retry file upload after 5 seconds.
2021-08-13T15:06:55.1807933Z Start retry 1 failed files upload.

标签: azureazure-devopsazure-pipelinesazure-pipelines-release-pipelineazure-pipelines-build-task

解决方案


我尝试了您的示例 yaml(触发器:无),它适用于工件任务。 在此处输入图像描述

建议再次尝试检查是否是临时问题。

如果问题仍然存在,请确认:

  1. 改回“触发器:master”,启用 CI 触发器,管道会正常工作吗?
  2. 它是否适用于其他帐户(例如:组织所有者)?
  3. 勾选“启用系统诊断”复选框以获取管道诊断日志以进行进一步检查。

推荐阅读