【问题标题】:VSTS Build agent issues in step 'Publish Artifact: drop'步骤“发布工件:丢弃”中的 VSTS 构建代理问题
【发布时间】:2017-09-22 03:08:29
【问题描述】:

我们在 vsts 构建中看到不一致的失败。这些突然出现了。

  • 代理在本地运行。 使用托管构建代理时,我们没有发现任何问题。
  • 在连续构建时,需要多次重试。通常构建会失败,但有时不会。
  • 不同项目中的多个构建定义受到影响

我们正在努力寻找根本原因,任何诊断此问题的帮助将不胜感激!

以下是相关版本信息:

[2017-04-25 07:25:58Z INFO AgentProcess] 代理是为 Windows 构建的 - win7-x64。 [2017-04-25 07:25:58Z INFO AgentProcess] 运行时信息:Microsoft Windows 6.3.9600。 [2017-04-25 07:25:58Z INFO AgentProcess] 版本:2.111.1

以下是日志的摘录:

017-04-25T07:28:14.1561247Z ##[section]开始:发布工件:drop 2017-04-25T07:28:14.1561247Z ======================================== ======================================= 2017-04-25T07:28:14.1561247Z 任务:发布构建工件 2017-04-25T07:28:14.1561247Z 描述:将构建工件发布到服务器或文件共享 2017-04-25T07:28:14.1561247Z 版本:1.0.40 2017-04-25T07:28:14.1561247Z 作者:微软公司 2017-04-25T07:28:14.1561247Z 帮助:More Information 2017-04-25T07:28:14.1561247Z ======================================== ======================================= 2017-04-25T07:28:15.0779877Z ##[section]Async 命令开始:上传工件 2017-04-25T07:28:15.0779877Z 上传 8 个文件 2017-04-25T07:28:20.1111153Z 文件总数:8 ---- 处理的文件:7 (87%) 2017-04-25T07:28:30.2611071Z 文件总数:8 ---- 已处理文件:7 (87%) 2017-04-25T07:28:35.3611234Z 由于“发送请求时出错”,无法上传“E:\Build\agents\scully_work\4\a\Project.Name.Web.zip”。 2017-04-25T07:28:35.3611234Z System.Net.Http.HttpRequestException:发送请求时出错。 ---> System.Net.Http.WinHttpException: 与服务器的连接异常终止 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在 System.Net.Http.WinHttpHandler.d__101.MoveNext() --- 内部异常堆栈跟踪结束 --- 在 Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.d__3.MoveNext() --- 从先前抛出异常的位置结束堆栈跟踪 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在 System.Net.Http.HttpClient.d__58.MoveNext() --- 从先前抛出异常的位置结束堆栈跟踪 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在 System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__45.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() 在 Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.d__17.MoveNext() --- 从先前抛出异常的位置结束堆栈跟踪 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.<UploadFileAsync>d__16.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Services.Agent.Worker.Build.FileContainerServer.<UploadAsync>d__14.MoveNext() 2017-04-25T07:28:35.3611234Z Detail upload trace for file that fail to upload: drop/Project.Name.Web.zip 2017-04-25T07:28:35.3611234Z Begin chunking upload file 'drop/Project.Name.Web.zip', chunk size '4194304 Bytes', total chunks '3'. 2017-04-25T07:28:35.3611234Z Attempt '1' for uploading chunk '1' of file 'drop/Project.Name.Web.zip'. 2017-04-25T07:28:35.3611234Z Generate new HttpRequest for uploading file 'drop/Project.Name.Web.zip', chunk '1' of '3'. 2017-04-25T07:28:35.3611234Z Start uploading file 'drop/Project.Name.Web.zip' to server, chunk '1'. 2017-04-25T07:28:35.3611234Z Chunk '1' attempt '1' of file 'drop/Project.Name.Web.zip' fail to send request to server. Error: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: The connection with the server was terminated abnormally at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.WinHttpHandler.<StartRequest>d__101.MoveNext() --- End of inner exception stack trace --- at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.<SendAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() 在 Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__45.MoveNext() --- 从先前抛出异常的位置结束堆栈跟踪 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 在 Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.d__17.MoveNext()。 2017-04-25T07:28:35.3611234Z 在尝试“2”块“1”之前退避 5.16 秒

更新: 将代理更新到最新的稳定版,问题仍然存在:

[2017-04-25 08:33:04Z INFO AgentProcess] 代理是为 Windows 构建的 - win7-x64。 [2017-04-25 08:33:04Z INFO AgentProcess] 运行时信息:Microsoft Windows 6.3.9600。 [2017-04-25 08:33:04Z INFO AgentProcess] 版本:2.115.0

【问题讨论】:

  • 你检查网络吗?
  • 我们目前正在诊断是否是内部网络问题,请及时通知您。

标签: networking azure-pipelines publish


【解决方案1】:

这通常意味着您的代理和您遇到中断的服务之间存在网络问题。

从 2.x 代理开始,我们积极尝试处理网络状况。我们将每个文件分成块 (4MB),打开一个 http 流并将该文件块通过管道传输到服务。每个文件块都有很长的时间(10分钟)

我们有每块重试和退避重试。

Backoff 5.16 seconds before attempt '2' chunk '1'

然后,如果我们重试后仍然无法上传一个块,我们将该文件放入重试队列中再通过一次。

如您所见,我们非常努力。

网络中断越多,文件越大,几率越大。此外,如果上传速度非常慢,它可能无法及时上传块(10 分钟内 4mb 是很长的时间),但在您的情况下,看起来流/网络正在中断。

您应该检查网络。您的机器和服务之间出现中断。

另一个可以尝试的实验是私有云虚拟机(如 azure)上的私有代理。这为您提供了更快的上传云网络,还可以控制私有代理(安装您想要的软件、增量源和打包等...)。

你看到我描述的重试了吗?我也将此转发给我们的代理开发人员。如果还有什么要补充的,我会编辑。

【讨论】:

  • 是的,我们可以看到您描述的重试次数。
  • 在设置了一个天蓝色的云虚拟机并经历了安装我们项目所需的所有构建代理工具的痛苦之后,我可以确认问题只存在于从我们的内部网络发布时。 AzureVM 完全没有问题,甚至不必在连续构建时重试。下一步将在内部网络上设置另一台服务器/开发机器。
  • 原来是ISP问题……我给你的同事发了一份详细的报告。内网很好
  • 我同意,我的问题已经回答了,但是问题还没有解决!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-11-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-14
相关资源
最近更新 更多