none
TFS 2017 VNext Build Agent uses HTTP instead of HTTPS RRS feed

  • שאלה

  • Hi all,

    We are new to VNext, trying to setup a build agent 

    Our build fails to start as it cannot connect/find the agent, although we can see it is available and the user set to run it had admin role on the agent pool and agent queue

    the error we are getting is:

     The job has been abandoned because agent AUTOMATIONAGENT-BldAg1 did not renew the lock. Ensure agent is running, not sleeping, and has not lost communication with the service. 

    we are seeing this disturbing issue in the log file: the TFS server is configured for access with https protocol, and the agent was configured accordingly:

    from the agent log:

    [2017-07-01 13:29:48Z INFO MessageListener] {

      "AgentId": 4,

      "AgentName": "AUTOMATIONAGENT-BldAg1",

      "PoolId": 2,

      "ServerUrl": "https://<servername>/tfs/",

      "WorkFolder": "C:\\BldAg1"

    :But in the worker log, we can see it is trying to access it with port 8080, http:

    [2017-07-04 14:35:33Z INFO ConfigurationStore] ServiceConfigFilePath: C:\BuildAgent\.service

    [2017-07-04 14:35:34Z INFO JobRunner] Ensure endpoint url match config url base. http://<servername>:8080/tfs/RD/

    [2017-07-04 14:35:34Z INFO JobRunner] Ensure System.TaskDefinitionsUrl match config url base. http://vm-<servername>:8080/tfs/RD/

    [2017-07-04 14:35:34Z INFO JobRunner] Ensure System.TFCollectionUrl match config url base. http://vm-<servername>:8080/tfs/RD/

    [2017-07-04 14:35:34Z INFO JobRunner] Ensure SystemConnection url match config url base. http://vm-<servername>:8080/tfs/RD/

    [2017-07-04 14:35:34Z INFO JobRunner] Ensure System.TFServerUrl match config url base. http://<servername>:8080/tfs/RD/

    [2017-07-04 14:35:34Z INFO JobRunner] Creating job server with URL: http://<servername>:8080/tfs/RD/

    [2017-07-04 14:35:34Z INFO Worker] Listening for cancel message from the channel.

    [2017-07-04 14:35:34Z INFO Worker] Waiting for the job to complete or for a cancel message from the channel.

    [2017-07-04 14:35:34Z INFO Worker] Job completed.

    [2017-07-04 14:35:35Z ERR  Program] Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Found

       at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)

       at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__45.MoveNext()

    --- End of stack trace from previous location where exception was thrown ---

    would really appreciate your thought/tips on this,

    many thanks,

    Sharon.

    יום שלישי 04 יולי 2017 15:15

תשובות

כל התגובות

  • Hi

    1. are you on latest update (TFS 2017 update 1)? if not, I suggest upgrading

    2. try reconfiguring agent

    3. check out this post 

    https://stackoverflow.com/questions/42263725/tfs-build-agent-failing-to-connect-to-https-git-in-tfs-2017-when-running-as-serv

    Dan


    דן

    יום שלישי 04 יולי 2017 20:07
    מנחה דיון
  • Thanks Dan!

    1. We are running with TFS 2017 Update 1(Version 15.112.26307.0)

    2.  tried re configuring - twice.  no success

    3. This post is very nice, but it is for Git

    It does not explain what to do in case you have pure TFS source control management

    I am still trying to understand how come that the agent is configured with the correct url,

    https:\\servername.companyName.com\tfs

    while the agent is trying to access it with http:

    \http:\\servername.companyName.com\tfs\RD

    In the worker log, we keep getting: Ensure endpoint url match config url basehttp:\\servername.companyName.com:8080\tfs\RD

    Ensure System.TaskDefinitionsUrl match config url base.http:\\servername.companyName.com:8080\tfs\RD

    Ensure System.TFCollectionUrl match config url basehttp:\\servername.companyName.com:8080\tfs\RD

    Ensure SystemConnection url match config url base. http:\\servername.companyName.com:8080\tfs\RD

    Ensure System.TFServerUrl match config url base http:\\servername.companyName.com:8080\tfs\RD

    Creating job server with URL: http:\\servername.companyName.com:8080\tfs\RD

    and a little after this error stuck:

    Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Found
       at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
       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()
       at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__42`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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
       at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.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()
       at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.<ConnectAsync>d__41.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.JobServer.<ConnectAsync>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 Microsoft.VisualStudio.Services.Agent.Worker.JobRunner.<RunAsync>d__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.Agent.Worker.Worker.<RunAsync>d__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.Agent.Worker.Program.<MainAsync>d__1.MoveNext()

    Googling did not help finding the cause for using http  - how to ensure it uses https instead?

    Thanks,

    Sharon.

    יום רביעי 05 יולי 2017 11:13
  • It might be bug or an issue that requires Microsoft's assistance

    I suggest you to open a ticket using MSDN subscription, or report a bug here: https://connect.microsoft.com/VisualStudio/feedback/LoadSubmitFeedbackForm

    Dan


    דן

    יום רביעי 05 יולי 2017 21:58
    מנחה דיון
  • Thanks Dan,

    In case anyone else gets similar behavior,

    please note:

    as the same agent worked fine with one collection, but not with the other, I understood that must be related somehow to the collection DB that was upgraded from TFS 2012 to TFS 2017

    eventually, MSDN support helped me finding the root cause:

    table tbl_accessmapping

    included entries with the http url for the old collection at the old server

    removing these entries by running delete from tbl_accessmapping solved it.

    good luck to all, Sharon

    יום רביעי 25 אוקטובר 2017 11:41