来源:http://ericphan.net/blog/2016/6/10/solving-the-tfs-build-agent-error-the-session-for-this-agent-already-exists

Recently we've been getting the following error for our TFS build agents which caused all our builds to fail

Figure: TFS Builds are failing

The error reported is "The job has been abandoned because agent <agent name> did not renew the lock. Ensure agent is running, not sleeping, and has not lost communication with the service."

Investigating the _diag folder of the build agent itself reveals the actual error.

---------------------------------------------------------------------------
The session for this agent already exists. Sleeping for 30 seconds before next retry. Attempts=1/10.
---------------------------------------------------------------------------
Microsoft.TeamFoundation.DistributedTask.WebApi.TaskAgentSessionConflictException: The task agent Agent-SYDTFSBLDP01-1 already has an active session for owner SYDTFSBLDP01.
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__79.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.WebApi.VssHttpClientBase.<SendAsync>d__76`1.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.WebApi.VssHttpClientBase.<SendAsync>d__65`1.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.WebApi.VssHttpClientBase.<SendAsync>d__64`1.MoveNext()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__79.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.WebApi.VssHttpClientBase.<SendAsync>d__76`1.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.WebApi.VssHttpClientBase.<SendAsync>d__65`1.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.WebApi.VssHttpClientBase.<SendAsync>d__64`1.MoveNext()

To fix this issue, you need to re-run the ConfigureAgent.cmd and on the first option "Do you want to also replace the server registration (default is N)" Choose "Y"

(这里我遇到的情况略有不同,我用到的ConfigureAgent文件的后缀是ps1,即是powershell文件,故需要以管理员权限打开powershell,然后运行ConfigureAgent

PS C:\Agents\2> .\ConfigureAgent.cmd
An existing configuration file was detected. This will update the local agent settings. Do you want to also replace th
e server registration (default is N)? Y

This will remove the existing agent registration and clean up the locked "session".

TFS: 解决The build agent error - the session for this agent already exists的更多相关文章

  1. vue项目报错,解决Module build failed: Error: Cannot find module 'node-sass' 问题

    1.报错问题 1 E:\WebStormFile\treehole-manage>npm run dev > xc-ui-pc-sysmanage@1.0.0 dev E:\WebStor ...

  2. 解决:install service error: InstallAsEventCreate() failed: xxx registry key already exists

    目录 一.事故现场 二.分析 三.解决方案 一.事故现场 在windows系统下安装服务,cmd窗口执行如下命令: "E:\work\_base\PsUm\PsUser\LdapWebSer ...

  3. vue-cli 报Module build failed: Error: No parser and no file path given, couldn't infer a parser.错的解决方法

    出错提示如下: ERROR Failed to compile with errors :: error in ./src/App.vue Module build failed: Error: No ...

  4. 解决 Your project contains error(s),please fix them before running your application问题

    原文地址: Android笔记:解决 Your project contains error(s),please fix them before running your application问题 ...

  5. Xcode export/upload error: Your session has expired. Please log in-b

    1.Xcode export/upload error: Your session has expired. Please log in 我在stack over flow上找到的答案:  一看pre ...

  6. vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.

    ERROR Failed to compile with 2 errors 12:00:33 error in ./src/App.vue Module build failed: Error: No ...

  7. 配置web pack loader 报错:Module build failed: Error: The node API for `babel` has been moved to `babel-core`.

    报错如下 Module build failed: Error: The node API for `babel` has been moved to `babel-core`. 在我配置loader ...

  8. Module build failed: Error: Cannot find module 'url-loader' 的坑

    本文地址:http://www.cnblogs.com/jying/p/8280956.html 开发环境:react.webpack.es5 引用图片报错:Module build failed: ...

  9. Android笔记:解决 Your project contains error(s),please fix them before running your application问题

    解决 Your project contains error(s),please fix them before running your application问题 貌似好多人都有遇到这问题,而且网 ...

随机推荐

  1. 记录一下putty的pscp的用法【转】

     转自 记录一下putty的pscp的用法 - 刘荣星的博客 https://www.liurongxing.com/how-use-the-putty-and-pscp.html 以前一直用Secu ...

  2. 待解决close

    关于close语句放在哪里,貌似会对结果产生影响 #include <iostream> #include <fstream> using namespace std; int ...

  3. 003_crlf注入漏洞

    一. (1) 线上收到一个crlf 注入的漏洞. 同时启用80和443才会暴露,配置如下: server { listen 80; listen 443 ssl; server_name www.jy ...

  4. MySQL--详细查询操作(单表记录查询、多表记录查询(连表查询)、子查询)

    一.单表查询 1.完整的语法顺序(可以不写完整,其次顺序要对) (不分组,且当前表使用聚合函数: 当前表为一组,显示统计结果 ) select distinct [*,查询字段1,查询字段2,表达式, ...

  5. 使用参数innodb_file_per_table支持MySQL InnoDB表数据共享空间自动收缩

    http://heylinux.com/archives/2367.html http://blog.csdn.net/ywh147/article/details/8996022 使用过MySQL的 ...

  6. boost.Asio lib

    Documentation for Boost.Asio http://www.boost.org/doc/libs/1_62_0/doc/html/boost_asio.html https://w ...

  7. Light OJ 1058

    题意: 简单的就组合数 C(m,n): 数据多,大, 要预处理: #include<bits/stdc++.h> using namespace std; typedef long lon ...

  8. mysql installer gentask怎么关闭

    1 前言 安装mysql community版本的,可能经常会看到mysql installer gentask console框出现,有时候甚烦,我们并不需要它经常检测更新. 2 解决方案 开始/附 ...

  9. tcp协议简单了解

    HTTP简介 HTTP协议是Hyper Text Transfer Protocol(超文本传输协议)的缩写,是用于从万维网(WWW:World Wide Web )服务器传输超文本到本地浏览器的传送 ...

  10. jemter 新增sha256函数

    1  https://blog.csdn.net/y100100/article/details/80701049 2  https://blog.csdn.net/y100100/article/d ...