zoukankan      html  css  js  c++  java
  • TFS: 解决The build agent error

    来源: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

    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:Agents2> .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".

  • 相关阅读:
    转载: JS 中 new 操作符
    转载: js的值,对象,原型
    php setcookie(name, value, expires, path, domain, secure) 参数详解
    转载:js数组对象操作
    转载: js数组与 json 的区别
    转载: js的Prototype属性 解释及常用方法
    行人检测程序对接景区测试人数比对数据库切换时间不准确排查
    TSINGSEE青犀视频行人检测集成票务系统读取票务系统数据库为空的问题
    EasyWasmPlayer播放视频报错Uncaught (in promise)DOMException
    名胜景区部署TSINGSEE青犀视频监控具备哪些现实意义?
  • 原文地址:https://www.cnblogs.com/144823836yj/p/10383464.html
Copyright © 2011-2022 走看看