VSTS构建代理程序在步骤'发布工件:删除'中

时间:2017-04-25 08:06:09

标签: networking publish azure-pipelines on-prem

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

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

我们正在努力找到根本原因,非常感谢任何诊断此问题的帮助!

以下是相关版本信息:

  

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

以下是日志的摘录:

  

017-04-25T07:28:14.1561247Z ## [section]开始:发布工件:掉落   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]异步命令启动:上传工件   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:发送请求时发生错误。 ---&GT; 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.ConfiguredTaskAwaitable 1.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.ConfiguredTaskAwaitable 1.ConfiguredTaskAwaiter.GetResult()      在Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.d__17.MoveNext()   ---从抛出异常的先前位置开始的堆栈跟踪结束---      在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)      在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)      在System.Runtime.CompilerServices.TaskAwaiter 1.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.ConfiguredTaskAwaitable 1.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] RuntimeInformation:Microsoft Windows 6.3.9600。   [2017-04-25 08:33:04Z INFO AgentProcess]版本:2.115.0

1 个答案:

答案 0 :(得分:0)

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

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

我们重试每个块并进行退避重试。

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

然后,如果我们仍然无法上传一个块,即使重试,我们也会将该文件放入重试队列再进行一次传递。

你可以看到,我们非常努力。

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

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

要尝试的另一个实验是私有云VM(如azure)上的私有代理。这样可以在上传时提供更快的云网络,同时也可以控制私有代理(安装所需的软件,增量源和包装等)。

您是否看到我正在描述的重试?我也将此转发给我们的代理开发者。如果还有其他要添加的内容,我会进行编辑。