locked
Test Agent Deployment Failing RRS feed

  • Question

  • I am trying to run tests on a Windows 7 test agent and it's failing. We are running TFS2015 U3.

    I have a release that uses the Visual Studio Test Agent Deployment task. I am deploying to a machine with Windows 7 SP1.

    According to the documentation I have all the prerequisites, and according the log (below) the Test Agent Configuration is failing same release Works great on a 2012 R2 machine.

    Dave

    --------------------------------------Task Log----------------------------------------------------------------

    2017-01-19T18:22:44.5782550Z Executing the powershell script: D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\DeployTestAgent.ps1
    2017-01-19T18:22:44.7344975Z ##[debug]resourceFilteringMethod = machineNames
    2017-01-19T18:22:44.9064326Z DistributedTests: Starting to deploy and configure test agent on test machines.
    2017-01-19T18:22:44.9064326Z DistributedTests: Inputs provided are:
    2017-01-19T18:22:44.9064326Z DistributedTests: Machines:
    2017-01-19T18:22:44.9064326Z DistributedTests: Username: NBFC.com\Svc_p_RMDeploy_tfs
    2017-01-19T18:22:44.9220663Z DistributedTests: Machine Group name: Win 7 Test Agent for TAC Tests
    2017-01-19T18:22:44.9220663Z DistributedTests: Run as process: True
    2017-01-19T18:22:44.9220663Z DistributedTests: Login Automatically: True
    2017-01-19T18:22:44.9220663Z DistributedTests: Disable Screen saver: True
    2017-01-19T18:22:44.9220663Z DistributedTests: Agent would be downloaded from http://go.microsoft.com/fwlink/?LinkId=615472
    2017-01-19T18:22:44.9220663Z DistributedTests: Update test agent: False
    2017-01-19T18:22:44.9220663Z DistributedTests: Run test agent as DataCollection only : True
    2017-01-19T18:22:44.9220663Z DistributedTests: Path to script that installs test agent on remote machine: D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\TestAgentInstall.ps1
    2017-01-19T18:22:44.9220663Z DistributedTests: Path to script that configures test agent on remote machine: D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\TestAgentConfiguration.ps1
    2017-01-19T18:22:44.9220663Z DistributedTests: Path to script that downloads test agent on azure remote machines : D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\DownloadTestAgent.ps1
    2017-01-19T18:22:44.9220663Z DistributedTests: Path to script that checks if test agent is installed on remote machine: D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\CheckTestAgentInstallation.ps1
    2017-01-19T18:22:44.9220663Z DistributedTests: Running TestAgent as service as data collection is turned on
    2017-01-19T18:22:45.2188714Z DistributedTests: Task 'CheckTestAgentInstallation' on machine 'TOADTFSTST04.nbfc.com:5985' is being run
    2017-01-19T18:22:55.4376502Z DistributedTests: Task 'CheckTestAgentInstallation' on machine 'TOADTFSTST04.nbfc.com:5985' completed.
    2017-01-19T18:22:55.4376502Z DistributedTests: Update test agent is disabled. Skipping test agent updates.
    2017-01-19T18:22:55.4532739Z DistributedTests: Task 'ConfigureTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' is being run
    2017-01-19T18:23:02.6095403Z DistributedTests: Task 'ConfigureTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' completed.
    2017-01-19T18:23:02.6095403Z ##[warning]DistributedTests: Task 'ConfigureTestAgent' for machine TOADTFSTST04.nbfc.com:5985's Error : System.Exception: TestAgent Configuration failed with exit code . Error code : -1
    2017-01-19T18:23:02.6095403Z ##[warning]DistributedTests: Task 'ConfigureTestAgent' for machine TOADTFSTST04.nbfc.com:5985's Log :
    2017-01-19T18:23:02.6095403Z ##[warning]  Deployment started on target machine...
    2017-01-19T18:23:02.6095403Z ##[warning]System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
    2017-01-19T18:23:02.6095403Z ##[warning]TestAgent Configuration failed with exit code . Error code : -1 ---> System.Management.Automation.RuntimeException: TestAgent Configuration failed with exit code . Error code : -1 ---> System.Management.Automation.RuntimeException: TestAgent Configuration failed with exit code . Error code : -1
    2017-01-19T18:23:02.6251554Z ##[warning]   --- End of inner exception stack trace ---
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0()
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func`1 action)
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
    2017-01-19T18:23:02.6251554Z ##[warning]   --- End of inner exception stack trace ---
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.ScriptExecutor.ExecuteScript(IPowerShell powerShell, String script, String arguments, Boolean isScriptDotSourced, Boolean useHttp)
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.DeploymentService.RunPowerShellScripts(DeploymentMachineSpecification deploymentMachine, ScriptSpecification scriptSpecification, ScriptSpecification initializationScriptSpecification, String applicationPath, IPowerShell powerShellSession)
    2017-01-19T18:23:02.6251554Z ##[warning]---> (Inner Exception #0) System.Management.Automation.RuntimeException: TestAgent Configuration failed with exit code . Error code : -1 ---> System.Management.Automation.RuntimeException: TestAgent Configuration failed with exit code . Error code : -1
    2017-01-19T18:23:02.6251554Z ##[warning]   --- End of inner exception stack trace ---
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
    2017-01-19T18:23:02.6251554Z ##[warning]   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0()
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func`1 action)
    2017-01-19T18:23:02.6251554Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)<---
    2017-01-19T18:23:02.6251554Z ##[warning]Finding whether TestAgent configuration is required
    2017-01-19T18:23:02.6251554Z ##[warning]Getting existing configuration
    2017-01-19T18:23:02.6251554Z ##[warning]Stdout : Microsoft (R) Visual Studio Test Agent Configuration Tool Version 14.102.25729.0 built by: releases/Dev14.3MU (564da8d3c1)
    2017-01-19T18:23:02.6251554Z ##[warning]Copyright (c) Microsoft Corporation.  All rights reserved.
    2017-01-19T18:23:02.6251554Z ##[warning]Getting Configuration:
    2017-01-19T18:23:02.6407802Z ##[warning]  Queried current configuration successfully.
    2017-01-19T18:23:02.6407802Z ##[warning]This test agent is running as a service.
    2017-01-19T18:23:02.6407802Z ##[warning]UserName                  : Not Available (Service not installed)
    2017-01-19T18:23:02.6407802Z ##[warning]TfsTeamProjectCollection  :                         
    2017-01-19T18:23:02.6407802Z ##[warning]DtlEnvUrl                 :                         
    2017-01-19T18:23:02.6407802Z ##[warning]DtlMachineName            :                         
    2017-01-19T18:23:02.6407802Z ##[warning]Capabilities              :                         
    2017-01-19T18:23:02.6407802Z ##[warning]Stderr :
    2017-01-19T18:23:02.6407802Z ##[warning]Exit code : 0
    2017-01-19T18:23:02.6407802Z ##[warning]Parsing configuration output
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : TfsCollection :
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : EnvUrl :
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : MachineName :
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : Username : Not Available (Service not installed)
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : EnableAutoLogon : True
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : DisableScreenSaver : True
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : RunningAsProcess : False
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : PersonalAccessTokenUser :
    2017-01-19T18:23:02.6407802Z ##[warning]Existing Configuration : Capabilities :
    2017-01-19T18:23:02.6407802Z ##[warning]DTAExecutionHost.exe is not running
    2017-01-19T18:23:02.6407802Z ##[warning]TestAgent is not running, Configuration required
    2017-01-19T18:23:02.6407802Z ##[warning]Trying to open the config file : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\\DTAExecutionHost.exe.config
    2017-01-19T18:23:02.6407802Z ##[warning]Changing trace level...
    2017-01-19T18:23:02.6407802Z ##[warning]Logs will now be stored at : C:\DtaLogs
    2017-01-19T18:23:02.6407802Z ##[warning]DTAAgentExecutionService is not present on the machine
    2017-01-19T18:23:02.6407802Z ##[warning]Stdout : Microsoft (R) Visual Studio Test Agent Configuration Tool Version 14.102.25729.0 built by: releases/Dev14.3MU (564da8d3c1)
    2017-01-19T18:23:02.6407802Z ##[warning]Copyright (c) Microsoft Corporation.  All rights reserved.
    2017-01-19T18:23:02.6407802Z ##[warning]Getting Configuration:
    2017-01-19T18:23:02.6407802Z ##[warning]  Queried current configuration successfully.
    2017-01-19T18:23:02.6407802Z ##[warning]Firewall Configuration:
    2017-01-19T18:23:02.6407802Z ##[warning]  Firewall exception could not be removed for application(s) 'Microsoft Visual Studio Test Agent Service'.
    2017-01-19T18:23:02.6407802Z ##[warning]Stderr :
    2017-01-19T18:23:02.6407802Z ##[warning]Exception : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
    2017-01-19T18:23:02.6407802Z ##[warning]Exit code : -1
    2017-01-19T18:23:02.6407802Z ##[warning]Return code received : -1
    2017-01-19T18:23:02.6565287Z ##[error]Error occured on 'TOADTFSTST04.nbfc.com:5985'. Details : 'TestAgent Configuration failed with exit code . Error code : -1'. For troubleshooting, refer http://aka.ms/remotevstest.
    2017-01-19T18:23:02.7032808Z ##[warning]For troubleshooting, refer http://aka.ms/remotevstest.
    2017-01-19T18:23:02.7032808Z ##[error]Deploy and configuration of test agent failed. Check the logs for more details.


    Dave Lloyd ALM MVP

    Thursday, January 19, 2017 9:08 PM

Answers

  • Hi Dlloyd,

    Thank you for your patience. I suggest that you could try to use the following steps:

    1. Delete the test agent.

    2. Enable windows firewall service in target machine.

    3. Clean the %temp% directory.

    4. Execute PowerShell Command Enable-PSRemoting –Force as administrator

    5. Make sure 5985 port is listening winrm e winrm/config/listener (PowerShell Command).

    6. Leave the column Test Agent location empty, let it download from internet.

    Then try to run it again.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by DlloydMVP Friday, February 3, 2017 1:30 PM
    Friday, February 3, 2017 7:09 AM
    Moderator

All replies

  • Hi Dlloyd,

    Thank you for posting here.

    Please check the DTAExecutionHost log from the test agent machine and share it here. It will be under C:\Dtalogs on the test agent machine. And please make sure:

    1. The admin login and password for the remote machine is correct in the deploy task.

    2. The firewall did not block out the connection between TFS and the test agent server.

    3. Try to download the test agent from here and install it manually( Click on "Tools for Visual Studio 2015" and then select "Agents for Visual Studio 2015" from the left navigation bar), then try to run the build directly without the deploy step. Check if the build could run successfully.

    4. Try to deploy the test agent on other machine check if it work.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 20, 2017 8:08 AM
    Moderator
  • Limitxiao...

    Thank you for the reply. Here are some answers for you.

    The C:\Dtalogs folder is empty.

    1. The user id and password on the deploy task is a local admin on the machine.

    2. We had the firewall turned off on that machine. So to the best of my knowledge it should not be the problem.

    3. I installed the agents manually and when I click it in the start menu I get this message:

    Test agent has not been configured.  Run the Test Agent Configuration Tool to configure the test agent.

    4. I ran the Deploy task on another machine and it worked fine.

    Dave


    Dave Lloyd ALM MVP

    Friday, January 20, 2017 2:41 PM
  • Hi Dave,

    Try to delete the test agent folder on agent server, then check if this issue still happen.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 23, 2017 11:01 AM
    Moderator
  • I deleted the test agent folder and ran the release again. Now I get this, but it does not stay in the log, I have to copy paste it out of the console before the release finishes and it's removed.

    ******************************************************************************

    Starting task: Deploy TestAgent on Win 7 Test Agent for TAC Tests

    ******************************************************************************
    Executing the powershell script: D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\DeployTestAgent.ps1
    DistributedTests: Starting to deploy and configure test agent on test machines.
    DistributedTests: Inputs provided are:
    DistributedTests: Machines:
    DistributedTests: Username: NBFC.com\Svc_p_RMDeploy_tfs
    DistributedTests: Machine Group name: Win 7 Test Agent for TAC Tests
    DistributedTests: Run as process: True
    DistributedTests: Login Automatically: True
    DistributedTests: Disable Screen saver: True
    DistributedTests: Agent would be downloaded from http://go.microsoft.com/fwlink/?LinkId=615472
    DistributedTests: Update test agent: True
    DistributedTests: Run test agent as DataCollection only : False
    DistributedTests: Path to script that installs test agent on remote machine: D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\TestAgentInstall.ps1
    DistributedTests: Path to script that configures test agent on remote machine: D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\TestAgentConfiguration.ps1
    DistributedTests: Path to script that downloads test agent on azure remote machines : D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\DownloadTestAgent.ps1
    DistributedTests: Path to script that checks if test agent is installed on remote machine: D:\agentServices\ReleaseAgent01\tasks\DeployVisualStudioTestAgent\1.0.21\CheckTestAgentInstallation.ps1

    DistributedTests: You may be using machine group 'Win 7 Test Agent for TAC Tests' across one or more concurrent builds. This is currently not supported. Use an unique machine group per build definition and ensure there are no concurrent builds In Progress from any given build definition using a machine group.
    DistributedTests: Starting to download testagent

    Unhandled Exception: System.Management.Automation.PSInvalidOperationException: The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.

    at System.Management.Automation.MshCommandRuntime.ThrowIfWriteNotPermitted(Boolean needsToWriteToPipeline)

    at System.Management.Automation.MshCommandRuntime.WriteHelper_ShouldWrite(ActionPreference preference, ContinueStatus lastContinueStatus)

    at System.Management.Automation.MshCommandRuntime.WriteWarning(WarningRecord record, Boolean overrideInquire)

    at System.Management.Automation.Cmdlet.WriteWarning(String text)

    at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.Logger.WriteWarning(String message)

    at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.TestAgentDownloader.wc_DownloadFileCompleted(Object sender, AsyncCompletedEventArgs e)

    at System.Net.WebClient.OnDownloadFileCompleted(AsyncCompletedEventArgs e)

    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    Worker Worker-a1b08a1c-0a40-47e5-b33c-ad634054a79d finished running job a1b08a1c-0a40-47e5-b33c-ad634054a79d

    ******************************************************************************


    Dave Lloyd ALM MVP

    Tuesday, January 31, 2017 1:34 PM
  • Hi Dlloyd,

    According to the error message "You may be using machine group 'Win 7 Test Agent for TAC Tests' across one or more concurrent builds. This is currently not supported". Did you use the group in other builds? Please create a new machine group then check the result again.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 2, 2017 9:56 AM
    Moderator
  • Yes I saw that. TO the best of my knowledge I was using it in only one release definition. However to be sure, I created a new Machine Group. And low and behold I am getting a different error, so Thank you for that.

    This is the error I am getting now.

    2017-02-02T16:29:52.3118414Z DistributedTests: Starting to download testagent
    2017-02-02T16:30:23.6556734Z DistributedTests: testagent is downloaded at: C:\Users\Svc_p_RMDeploy_tfs\AppData\Local\Temp\9fbf17d8-4e6c-4269-b8bf-0e6c23207639
    2017-02-02T16:30:24.5306529Z DistributedTests: Task 'CopyFilesToTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' is being run
    2017-02-02T16:30:27.0462886Z DistributedTests: Task 'CopyFilesToTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' completed.
    2017-02-02T16:30:27.0775492Z DistributedTests: Task 'DeployTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' is being run
    2017-02-02T16:31:27.0776542Z DistributedTests: Task 'DeployTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' is taking time. Please Wait
    2017-02-02T16:32:27.0777948Z DistributedTests: Task 'DeployTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' is taking time. Please Wait
    2017-02-02T16:33:27.0779170Z DistributedTests: Task 'DeployTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' is taking time. Please Wait
    2017-02-02T16:33:39.4373291Z DistributedTests: Task 'DeployTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' completed.
    2017-02-02T16:33:39.4529374Z DistributedTests: Task 'ConfigureTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' is being run
    2017-02-02T16:33:50.4060918Z DistributedTests: Task 'ConfigureTestAgent' on machine 'TOADTFSTST04.nbfc.com:5985' completed.
    2017-02-02T16:33:50.4216968Z ##[warning]DistributedTests: Task 'ConfigureTestAgent' for machine TOADTFSTST04.nbfc.com:5985's Error : System.Exception: TestAgent Configuration failed with exit code . Error code : -1
    2017-02-02T16:33:50.4216968Z ##[warning]DistributedTests: Task 'ConfigureTestAgent' for machine TOADTFSTST04.nbfc.com:5985's Log :
    2017-02-02T16:33:50.4216968Z ##[warning]  Deployment started on target machine...
    2017-02-02T16:33:50.4216968Z ##[warning]System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
    2017-02-02T16:33:50.4216968Z ##[warning]TestAgent Configuration failed with exit code . Error code : -1 ---> System.Management.Automation.RuntimeException: TestAgent Configuration failed with exit code . Error code : -1 ---> System.Management.Automation.RuntimeException: TestAgent Configuration failed with exit code . Error code : -1
    2017-02-02T16:33:50.4216968Z ##[warning]   --- End of inner exception stack trace ---
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0()
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func`1 action)
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
    2017-02-02T16:33:50.4216968Z ##[warning]   --- End of inner exception stack trace ---
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.ScriptExecutor.ExecuteScript(IPowerShell powerShell, String script, String arguments, Boolean isScriptDotSourced, Boolean useHttp)
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.DeploymentService.RunPowerShellScripts(DeploymentMachineSpecification deploymentMachine, ScriptSpecification scriptSpecification, ScriptSpecification initializationScriptSpecification, String applicationPath, IPowerShell powerShellSession)
    2017-02-02T16:33:50.4216968Z ##[warning]---> (Inner Exception #0) System.Management.Automation.RuntimeException: TestAgent Configuration failed with exit code . Error code : -1 ---> System.Management.Automation.RuntimeException: TestAgent Configuration failed with exit code . Error code : -1
    2017-02-02T16:33:50.4216968Z ##[warning]   --- End of inner exception stack trace ---
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
    2017-02-02T16:33:50.4216968Z ##[warning]   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0()
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
    2017-02-02T16:33:50.4216968Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
    2017-02-02T16:33:50.4373238Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func`1 action)
    2017-02-02T16:33:50.4373238Z ##[warning]   at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)<---
    2017-02-02T16:33:50.4373238Z ##[warning]Finding whether TestAgent configuration is required
    2017-02-02T16:33:50.4373238Z ##[warning]Getting existing configuration
    2017-02-02T16:33:50.4373238Z ##[warning]Stdout : Microsoft (R) Visual Studio Test Agent Configuration Tool Version 14.102.25729.0 built by: releases/Dev14.3MU (564da8d3c1)
    2017-02-02T16:33:50.4373238Z ##[warning]Copyright (c) Microsoft Corporation.  All rights reserved.
    2017-02-02T16:33:50.4373238Z ##[warning]Getting Configuration:
    2017-02-02T16:33:50.4373238Z ##[warning]  Queried current configuration successfully.
    2017-02-02T16:33:50.4373238Z ##[warning]This test agent is running as a service.
    2017-02-02T16:33:50.4373238Z ##[warning]UserName                  : Not Available (Service not installed)
    2017-02-02T16:33:50.4373238Z ##[warning]TfsTeamProjectCollection  :                         
    2017-02-02T16:33:50.4373238Z ##[warning]DtlEnvUrl                 :                         
    2017-02-02T16:33:50.4373238Z ##[warning]DtlMachineName            :                         
    2017-02-02T16:33:50.4373238Z ##[warning]Capabilities              :                         
    2017-02-02T16:33:50.4373238Z ##[warning]Stderr :
    2017-02-02T16:33:50.4373238Z ##[warning]Exit code : 0
    2017-02-02T16:33:50.4373238Z ##[warning]Parsing configuration output
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : TfsCollection :
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : EnvUrl :
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : MachineName :
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : Username : Not Available (Service not installed)
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : EnableAutoLogon : True
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : DisableScreenSaver : True
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : RunningAsProcess : False
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : PersonalAccessTokenUser :
    2017-02-02T16:33:50.4373238Z ##[warning]Existing Configuration : Capabilities :
    2017-02-02T16:33:50.4373238Z ##[warning]DTAExecutionHost.exe is not running
    2017-02-02T16:33:50.4373238Z ##[warning]TestAgent is not running, Configuration required
    2017-02-02T16:33:50.4373238Z ##[warning]Trying to open the config file : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\\DTAExecutionHost.exe.config
    2017-02-02T16:33:50.4373238Z ##[warning]Changing trace level...
    2017-02-02T16:33:50.4373238Z ##[warning]Logs will now be stored at : C:\DtaLogs
    2017-02-02T16:33:50.4373238Z ##[warning]DTAAgentExecutionService is not present on the machine
    2017-02-02T16:33:50.4373238Z ##[warning]Stdout : Microsoft (R) Visual Studio Test Agent Configuration Tool Version 14.102.25729.0 built by: releases/Dev14.3MU (564da8d3c1)
    2017-02-02T16:33:50.4373238Z ##[warning]Copyright (c) Microsoft Corporation.  All rights reserved.
    2017-02-02T16:33:50.4373238Z ##[warning]Getting Configuration:
    2017-02-02T16:33:50.4373238Z ##[warning]  Queried current configuration successfully.
    2017-02-02T16:33:50.4373238Z ##[warning]Firewall Configuration:
    2017-02-02T16:33:50.4373238Z ##[warning]  Firewall exception could not be removed for application(s) 'Microsoft Visual Studio Test Agent Service'.
    2017-02-02T16:33:50.4529700Z ##[warning]Stderr :
    2017-02-02T16:33:50.4529700Z ##[warning]Exception : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
    2017-02-02T16:33:50.4529700Z ##[warning]Exit code : -1
    2017-02-02T16:33:50.4529700Z ##[warning]Return code received : -1
    2017-02-02T16:33:50.4529700Z ##[error]Error occured on 'TOADTFSTST04.nbfc.com:5985'. Details : 'TestAgent Configuration failed with exit code . Error code : -1'. For troubleshooting, refer http://aka.ms/remotevstest.
    2017-02-02T16:33:50.4998730Z ##[warning]For troubleshooting, refer http://aka.ms/remotevstest.
    2017-02-02T16:33:50.4998730Z ##[error]Deploy and configuration of test agent failed. Check the logs for more details.


    Dave Lloyd ALM MVP

    Thursday, February 2, 2017 4:54 PM
  • I signed into the Windows 7 test agent and selected Agents for Visual Studio to see if I could configure it manually.

    When I select "Agents for Visual Studio" from the Start menu I get this message:

    ---------------------------
    Test Agent
    ---------------------------
    Test agent has not been configured.  Run the Test Agent Configuration Tool to configure the test agent.
    ---------------------------
    OK  
    ---------------------------

    Not sure if this helps or not.

    Dave


    Dave Lloyd ALM MVP

    Thursday, February 2, 2017 6:56 PM
  • Hi Dlloyd,

    Thank you for your patience. I suggest that you could try to use the following steps:

    1. Delete the test agent.

    2. Enable windows firewall service in target machine.

    3. Clean the %temp% directory.

    4. Execute PowerShell Command Enable-PSRemoting –Force as administrator

    5. Make sure 5985 port is listening winrm e winrm/config/listener (PowerShell Command).

    6. Leave the column Test Agent location empty, let it download from internet.

    Then try to run it again.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by DlloydMVP Friday, February 3, 2017 1:30 PM
    Friday, February 3, 2017 7:09 AM
    Moderator
  • That worked thanks so much.

    Dave


    Dave Lloyd ALM MVP

    Friday, February 3, 2017 1:30 PM