How to clean sources on multiple build agents - tfs

Let's say you have multiple build agents configured and you have a folder on the build agents that has some content in it that isn't from TFS (even specifying Output, some intermediate stuff like the obj folder might be generated in a project folder for example) and you deleted the folder in TFS.
Next time you'd build, you'd get an cannot be deleted because it is not empty. error. When triggering the build, you could add the Build.Clean variable as all or source to your next build to fix it. However, since you have multiple agent, only the next agent running will receive that command and clean, and any other builds you make that falls on another agent will fail again because they still have the folder.
Editing the whole build definition so they do a full clean every build would be overkill.
I am of course looking for something else than "Go in the actual folders and delete the folders manually". If it changes anything, the agents aren't hosted, but on premises.
Edit: Logs from the build server, starting with the last cannot be deleted warning:
2017-03-14T20:23:24.2384009Z d:\vso\b1\_work\32\s\[Obfuscated] cannot be deleted because it is not empty.
2017-03-14T20:23:24.4964210Z ##[error]Exit code 1 returned from process: file name 'tf', arguments 'vc get /version:24617 /recursive /overwrite d:\vso\b1\_work\32\s /loginType:OAuth /login:.,******** /noprompt'.
2017-03-14T20:23:24.5124180Z ##[debug]Microsoft.VisualStudio.Services.Agent.ProcessExitCodeException: Exit code 1 returned from process: file name 'tf', arguments 'vc get /version:24617 /recursive /overwrite d:\vso\b1\_work\32\s /loginType:OAuth /login:.,******** /noprompt'.
at Microsoft.VisualStudio.Services.Agent.ProcessInvoker.<ExecuteAsync>d__19.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.TfsVCCommandManager.<RunCommandAsync>d__26.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.TFCommandManager.<GetAsync>d__15.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.TfsVCSourceProvider.<GetSourceAsync>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.Build.BuildJobExtension.<PrepareAsync>d__23.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.JobExtensionRunner.<RunAsync>d__30.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.StepsRunner.<RunAsync>d__0.MoveNext()
2017-03-14T20:23:24.5174212Z ##[section]Finishing: Get Sources

Ran into this topic through Google.
We have the same scenario and i tried to explain it here too.
Basically how we now fixed it is we created a new build definition that we use to queue new builds with the Build.Clean = all parameter.
So we have a PowerShell script that loops over all AgentsNames we want to clean and queue a new clean build and add the Demand "Agent.Name -equals agentName".
this way your clean build is queued on all agents you want to clean.

Related

Docker Desktop not starting after trying to restore two MariaDB backups simultaneously

I've a clean installation of Docker Desktop and I did move data to secondary disk using this guide: https://dev.to/kimcuonthenet/move-docker-desktop-data-distro-out-of-system-drive-4cg2
I was using normally with a small application, then I decided to restore a .sql file (6GB backup file of a database with approximately 60GB - I have plenty space). It was 2 containers simultaneously. After some hours restoring, both containers exited with code 1.
After that, Docker Desktop crashed and when I try to start, I get a Docker Desktop dialog stating "An error occurred":
Complete error message:
Docker.Core.HttpBadResponseException:
{"message":"2 errors occurred:\n\t* starting keep alive in the data distro: waiting for wsl-keepalive to be ready: running wsl-keepalive in \"docker-desktop-data\": exit status 0xffffffff\n\t* checking if isocache exists: CreateFile \\\\wsl$\\docker-desktop-data\\isocache\\: The network name cannot be found.\n\n"}
at Docker.Core.GoBackend.GoBackendClient.<PostNoBodyWithError>d__19.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Core\GoBackend\GoBackendClient.cs:line 226
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__11.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 54
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__6.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__6.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 118
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.EngineStateMachine.<StartAsync>d__15.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 72
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.Engines.<StartAsync>d__23.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 109
Apparently, I could just restore to factory defaults, but then I'd lose data from the small application that I already had running and I don't want that.
I've rebooted and tried to execute with admin privileges but nothing. I don't know how to access .vhdx file, so no clue on how to proceed.
You guys have any ideas on how can I debug this correctly?

Cannot publishing a NuGet to TFS 2017

When I try to publish a NuGet to my TFS 2017 on-premises using a build step, I get following error messages:
2016-12-21T09:33:58.3510841Z [command]C:\Windows\system32\chcp.com 65001
2016-12-21T09:33:58.3667084Z Active code page: 65001
2016-12-21T09:34:00.7730379Z Detected NuGet version 3.3.0.212 / 3.3.0
2016-12-21T09:34:00.7730379Z SYSTEMVSSCONNECTION exists true
2016-12-21T09:34:00.7886681Z [command]C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe push -NonInteractive C:\Agent\_work\1\s\Foo.1.4.3-build-20161221-1.nupkg -Source http://myServer:8080/tfs/My%20Team%20Projects/_packaging/our-nuget/nuget/v3/index.json -ApiKey VSTS -Verbosity Detailed
2016-12-21T09:34:01.4761938Z Please provide credentials for: http://myserver:8080/tfs/My%20Team%20Projects/_packaging/our-nuget/nuget/v3/index.json
2016-12-21T09:34:01.4761938Z UserName: System.InvalidOperationException: Cannot prompt for input in non-interactive mode.
2016-12-21T09:34:01.5074440Z ##[error]Error: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1
2016-12-21T09:34:01.5074440Z ##[error]Packages failed to publish
I have also try to run the NuGet.exe push ... command from a PowerShell script as a build step, and that also failed.
When I run it manually in a ordinary PowerShell console, it works without problems.
What is the runtime difference between running it from console compared to running it in a build step? How do I make it works?
Edit 1
I have change to NuGet 3.5 and created a verbose log. Se below:
agent.workFolder=C:\Agent\_work
loading inputs and endpoints
loading ENDPOINT_AUTH_$/
loading ENDPOINT_AUTH_PARAMETER_$/_ACCESSTOKEN
loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
loading ENDPOINT_AUTH_SCHEME_$/
loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
loading INPUT_FEEDNAME
loading INPUT_NUGETFEEDTYPE
loading INPUT_NUGETVERSION
loading INPUT_SEARCHPATTERN
loading INPUT_VERBOSITY
loaded 11
check path : C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\task.json
set resource file to: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\task.json
system.culture=en-US
check path : C:\Windows\system32\chcp.com
C:\Windows\system32\chcp.com=C:\Windows\system32\chcp.com
C:\Windows\system32\chcp.com arg: ["65001"]
exec tool: C:\Windows\system32\chcp.com
Arguments:
65001
C:\Windows\system32\chcp.com 65001
Active code page: 65001
searchPattern=C:\Agent\_work\1\s\**\*.nupkg;-:**\packages\**\*.nupkg;-:**\*.symbols.nupkg
System.DefaultWorkingDirectory=C:\Agent\_work\1\s
pattern: C:\Agent\_work\1\s\**\*.nupkg, isNegative: false
Matching glob pattern: C:\Agent\_work\1\s\**\*.nupkg
Index of first wildcard: 19
find root dir: C:\Agent\_work\1
find C:\Agent\_work\1
4456 matches.
pattern: C:\Agent\_work\1\s\**\packages\**\*.nupkg, isNegative: true
Matching glob pattern: C:\Agent\_work\1\s\**\packages\**\*.nupkg
Index of first wildcard: 19
find root dir: C:\Agent\_work\1
find C:\Agent\_work\1
4456 matches.
pattern: C:\Agent\_work\1\s\**\*.symbols.nupkg, isNegative: true
Matching glob pattern: C:\Agent\_work\1\s\**\*.symbols.nupkg
Index of first wildcard: 19
find root dir: C:\Agent\_work\1
find C:\Agent\_work\1
4456 matches.
connectedServiceName=null
feedName=http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json
nuGetAdditionalArgs=null
verbosity=Detailed
nuGetFeedType=internal
nuGetPath=null
nuGetversion=3.5.0.1829
Agent.HomeDirectory=C:\Agent
looking for tool NuGet
looking for tool variant NuGet.exe
checking C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe
SYSTEMVSSCONNECTION=http://sag-s02:8080/tfs/SAG Team Projects/
Detected NuGet version 3.5.0.1938 / 3.5.0
Quirks for 3.5.0.1938:
NoTfsOnPremAuthConfig
NuGet.ForceEnableCredentialProvider=undefined
NuGetTasks.IsHostedTestEnvironment=undefined
System.TeamFoundationCollectionUri=http://sag-s02:8080/tfs/SAG%20Team%20Projects/
Credential provider is enabled.
NuGet.ForceEnableCredentialConfig=undefined
NuGetTasks.IsHostedTestEnvironment=undefined
System.TeamFoundationCollectionUri=http://sag-s02:8080/tfs/SAG%20Team%20Projects/
Credential config is disabled due to on-prem quirks.
Getting credentials for local feeds
SYSTEMVSSCONNECTION exists true
SYSTEMVSSCONNECTION exists true
Got auth token
discovered URL prefixes: http://sag-s02:8080/tfs/SAG Team Projects/
NuGetTasks.ExtraUrlPrefixesForTesting=undefined
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: push
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: -NonInteractive
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe pathArg: C:\Agent\_work\1\s\Foo.1.4.3-build-20161222-5.nupkg
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: C:\Agent\_work\1\s\Foo.1.4.3-build-20161222-5.nupkg
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: ["-Source","http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json"]
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: ["-ApiKey","VSTS"]
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: -Verbosity
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: Detailed
credProviderPath = C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet
exec tool: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe
Arguments:
push
-NonInteractive
C:\Agent\_work\1\s\Foo.1.4.3-build-20161222-5.nupkg
-Source
http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json
-ApiKey
VSTS
-Verbosity
Detailed
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe push -NonInteractive C:\Agent\_work\1\s\Foo.1.4.3-build-20161222-5.nupkg -Source http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json -ApiKey VSTS -Verbosity Detailed
NuGet Version: 3.5.0.1938
System.AggregateException: One or more errors occurred. ---> NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0.<<GetAsync>b__0>d.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 NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLockedAsync>d__2`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 NuGet.Protocol.HttpSource.<GetAsync>d__12.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.TaskAwaiter.ValidateEnd(Task task)
at NuGet.Protocol.ServiceIndexResourceV3Provider.<GetServiceIndexResourceV3>d__9.MoveNext()
--- End of inner exception stack trace ---
at NuGet.Protocol.ServiceIndexResourceV3Provider.<GetServiceIndexResourceV3>d__9.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 NuGet.Protocol.ServiceIndexResourceV3Provider.<TryCreate>d__8.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 NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`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 NuGet.Protocol.PackageUpdateResourceV3Provider.<TryCreate>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 NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`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 NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__15`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 NuGet.Commands.CommandRunnerUtility.<GetPackageUpdateResource>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 NuGet.Commands.PushRunner.<Run>d__0.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 NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__28.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
---> (Inner Exception #0) NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0.<<GetAsync>b__0>d.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 NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLockedAsync>d__2`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 NuGet.Protocol.HttpSource.<GetAsync>d__12.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.TaskAwaiter.ValidateEnd(Task task)
at NuGet.Protocol.ServiceIndexResourceV3Provider.<GetServiceIndexResourceV3>d__9.MoveNext()
--- End of inner exception stack trace ---
at NuGet.Protocol.ServiceIndexResourceV3Provider.<GetServiceIndexResourceV3>d__9.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 NuGet.Protocol.ServiceIndexResourceV3Provider.<TryCreate>d__8.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 NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`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 NuGet.Protocol.PackageUpdateResourceV3Provider.<TryCreate>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 NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`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 NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__15`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 NuGet.Commands.CommandRunnerUtility.<GetPackageUpdateResource>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 NuGet.Commands.PushRunner.<Run>d__0.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 NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__28.MoveNext()<---
rc:1
success:false
Error: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe failed with return code: 1
Processed: ##vso[task.issue type=error;]Error: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe failed with return code: 1
task result: Failed
Packages failed to publish
Processed: ##vso[task.issue type=error;]Packages failed to publish
Processed: ##vso[task.complete result=Failed;]Packages failed to publish
The error below indicates you need to provide credential to push the package:
Please provide credentials for: http://myserver:8080/tfs/My%20Team%20Projects/_packaging/our-nuget/nuget/v3/index.json
UserName: System.InvalidOperationException: Cannot prompt for input in non-interactive mode.
Check the solution here: log in as the user which will be running the builds, and update the nuget source reference (which will be in a user-specific appdata config file) with the password:
nuget sources update -Name <whatever you called it> -source http://your.nuget.repo/authed/feed/ -User <your username> -pass <your pwd>
This will save an encrypted password in a user-specific config file on that computer, and should mean you don’t get prompted for that source anymore.
Several more options are detailed over here: http://www.xavierdecoster.com/nuget-package-restore-from-a-secured-feed
Find the reason: the user name or password includes quotes when add feed source. Solution to deal with that issue:
Download Nuget 3.5
Open Command Prompt and navigate to Nuget.exe folder (CD)
Update package source through this command (Do not include quotes to user name and password):
Command:
.\nugget.exe Sources update -name '[feedname]' -source "[feed address]" -username [user name] -password [password]
Queue build to publish package
Note: Do not include quotes to user name and password, for example: ‘user1’, ”user1”, just use user1.

Running Vsts agent on nano server

I am looking to run vsts agent on docker image with nano server on it. The container already has .Net Core installed on it. I downloaded vsts agent using the Download Agent and config.cmd command. Got the following error
An error occurred while sending the request. Failed to connect. Try again or ctrl-c to quit
Here are the details
Windows Version: Microsoft Windows [Version 10.0.14393]
.Net Core Version : 1.0.1
.Net Core Build : cee57bf6c981237d80aa1631cfe83cb9ba329f12
Looking at Diagnostics log, I get the following error
[2016-10-18 07:29:46Z ERR Terminal] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: The parameter is incorrect
at System.Net.Http.WinHttpAuthHelper.SetWinHttpCredential(SafeWinHttpHandle requestHandle, ICredentials credentials, Uri uri, UInt32 authScheme, UInt32 authTarget)
at System.Net.Http.WinHttpAuthHelper.CheckResponseForAuthentication(WinHttpRequestState state, UInt32& proxyAuthScheme, UInt32& serverAuthScheme)
at System.Net.Http.WinHttpHandler.d__101.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.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.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.ConfiguredTaskAwaitable1.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.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__421.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.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.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.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.AgentServer.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.Listener.Configuration.ConfigurationManager.d__10.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.Listener.Configuration.ConfigurationManager.d__7.MoveNext()
[2016-10-18 07:29:46Z ERR Terminal] WRITE ERROR: Failed to connect. Try again or ctrl-c to quit
Can anyone help please?
I had it raised as an issue with the product team.
https://github.com/Microsoft/vsts-agent/issues/483
The scenario is not supported as yet. I.e VSTS agents can't run Windows Nano Server. Following are excerpt from the response the team
"It's likely not just this issue. The Windows build of the agent currently makes an assumption that Full .NET is installed. It has validation checks that verify that .NET >= 4.5 is installed. It sounds like it's missing validation to distinguish between .NET Full and .NET Core.
My understanding is that Nano doesn't have .NET Full, and only has .NET Core. We'll need to take a pass through the agent, given Nano constraints, and figure out what it means for an agent running on Nano."

TFS Build agent throws "unauthorized" exception

We have upgraded our TFS 2013 server to TFS 2015 and we are setting up the new build agents.
Prior to this we performed a trial run and got everything working reasonably well before we did the final conversion of our existing TFS database. The build agent worked perfectly fine.
To our surprise, our build agent no longer co-operates post-upgrade. Creating a trivial build definition and assigning it to the default queue results in an error being raised after 10-15 seconds.
We have tried re-deploying the build agent, play around with permissions and users, but to no avail.
All we get is this in the _diag\ logs:
11:18:09.699993 JobManager.StartJob(job.JobId = a9702f31-2dff-4057-8253-a32ebc106f32)
11:18:09.699993 JobInfo.ctor
11:18:09.699993 JobInfo.ctor - leave
11:18:09.699993 JobManager.StartJob - calling JobWriter.StartJob
11:18:09.699993 JobWriter.StartJob - enter
11:18:09.699993 JobWriter.StartJob - (SKIPPING)first renew
11:18:09.715619 JobWriter.StartJob - start continual renewing
11:18:09.715619 AuthorizationType : OAuth
11:18:09.731245 ---------------------------------------------------------------------------
11:18:09.731245 Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Unauthorized
11:18:09.731245 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
11:18:09.731245 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__79.MoveNext()
11:18:09.731245 --- End of stack trace from previous location where exception was thrown ---
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
11:18:09.731245 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__76`1.MoveNext()
11:18:09.731245 --- End of stack trace from previous location where exception was thrown ---
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
11:18:09.731245 at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.MoveNext()
11:18:09.731245 --- End of stack trace from previous location where exception was thrown ---
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
11:18:09.731245 at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.<ConnectAsync>d__39.MoveNext()
11:18:09.731245 --- End of stack trace from previous location where exception was thrown ---
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
11:18:09.731245 at Microsoft.TeamFoundation.DistributedTask.Agent.Common.ConnectionHelper.GetConnection(Uri serverUri, VssCredentials credentials)
11:18:09.731245 at Microsoft.TeamFoundation.DistributedTask.Agent.JobWriter.StartJob()
11:18:09.731245 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
11:18:09.731245 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__79.MoveNext()
11:18:09.731245 --- End of stack trace from previous location where exception was thrown ---
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
11:18:09.731245 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__76`1.MoveNext()
11:18:09.731245 --- End of stack trace from previous location where exception was thrown ---
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
11:18:09.731245 at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.MoveNext()
11:18:09.731245 --- End of stack trace from previous location where exception was thrown ---
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
11:18:09.731245 at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.<ConnectAsync>d__39.MoveNext()
11:18:09.731245 --- End of stack trace from previous location where exception was thrown ---
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
11:18:09.731245 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
11:18:09.731245 at Microsoft.TeamFoundation.DistributedTask.Agent.Common.ConnectionHelper.GetConnection(Uri serverUri, VssCredentials credentials)
11:18:09.731245 at Microsoft.TeamFoundation.DistributedTask.Agent.JobWriter.StartJob()
11:18:09.731245 ---------------------------------------------------------------------------
Running interactively or as a service makes no difference. I have enlisted the build agent's service user as a member of the 'Agent Pool Service Accounts' role.
I believe this is the offending request:
GET https://tfs:8443/tfs/DefaultCollection/_apis/connectionData?connectOptions=IncludeServices&lastChangeId=-1&lastChangeId64=-1 HTTP/1.1
User-Agent: VSServices/14.102.25423.0 (VsoAgent.exe) VsoAgent.exe/1.95.3
Accept-Language: en-US, nb-NO
X-TFS-FedAuthRedirect: Suppress
X-TFS-Session: 7a2e6368-a564-4231-bbd6-xxxxxxxxxx
X-VSS-Agent: VSS: b5d9c453-017f-407c-ac00-b479d0d0e8ed
Authorization: [huge bytesequence]
Host: tfs:8443
Accept-Encoding: gzip
This is rewarded with a 401. My own adminuser however is able to load this URI just fine.
My own admin user is the one I used when I set up the agent. I have also tried launching vsoagent.exe interactively from this user... But no go. Reading between the lines (and looking at some of the roles) there is a user that bares the name of the machine that the agent runs on. I guess this user was created at first and is the one that is actually used. How do I get this situation under control?
EDIT: If I run vsoagent.exe interactively from a user that is NOT included in the pool's list of "Agent Pool Service Accounts", then the agent immediately errs out with Access denied. admrunem needs Listen permissions for pool Regular to perform the action. For more information, contact the Team Foundation Server administrator.. Adding admrunem to the list gets me a little further, namely to the error message that I am trying to diagnose (The "unauthorized" exception). Note: It uses NTLM authorization at this point, then for the fatal call seems to switch to OAUTH.
Check that "Windows authentication" is enabled on Team Foundation Server IIS website. That fixed the issue for us.
Make sure the account that the agent is run under is in the "Agent Pool Service Account" role.
Make sure the queue is provisioned in the collection ( https://your-tfs-server:8080/tfs/your-collection/_admin/_AgentQueue ). If not - select "New queue.." and select the existing queue.
Make sure you deploy the Windows build agent by exactly following this article.
Try to change a domain account which is a member of the Build Agent Service Accounts group and belongs to "Agent Pool Service Account" role, to see whether the agent would work or not.

TFS 2015 - On Site Build Failures

Background: Had builds working for the past three months. Then, after getting failures I figured out the license was not valid for the Visual Studio install on our in house build server.
Steps to correct:
Fixed license issue. Along with installing all VS Updates and TFS Update 2.
Additional steps taken to correct the issue:
Builds were still failing so I deleted the agent and the build pool. Recreated a new pool and downloaded the agent.
Installed the agent on the server, using my network credentials as I'm an admin on the box and part of the agent pool admin and agent pool service account. Used my account to try an eliminate permission related issues.
Note: Everything else works with TFS. Can check in changes, can use the portal with full admin rights.
Here is the final entry in the logs
19:39:28.762991 Failed to start the job, could not create the http client with the given credentials.
The builds fail under a minute with no logs or reason on the tfs http interface.
Here are the only exceptions on the build server logs.
19:39:18.411788 Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Bad Request
19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__79.MoveNext()
19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__76`1.MoveNext()
19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
19:39:18.411788 at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.d__6.MoveNext()
19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
19:39:18.411788 at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.d__39.MoveNext()
19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
19:39:18.411788 at Microsoft.TeamFoundation.DistributedTask.Agent.Common.ConnectionHelper.GetConnection(Uri serverUri, VssCredentials credentials)
19:39:18.411788 at Microsoft.TeamFoundation.DistributedTask.Agent.JobWriter.StartJob()
19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__79.MoveNext()
19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__76`1.MoveNext()
19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
19:39:18.411788 at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.d__6.MoveNext()
19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
19:39:18.427410 at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.d__39.MoveNext()
19:39:18.427410 --- End of stack trace from previous location where exception was thrown ---
19:39:18.427410 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
19:39:18.427410 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
19:39:18.427410 at Microsoft.TeamFoundation.DistributedTask.Agent.Common.ConnectionHelper.GetConnection(Uri serverUri, VssCredentials credentials)
19:39:18.427410 at Microsoft.TeamFoundation.DistributedTask.Agent.JobWriter.StartJob()
19:39:18.427410 ---------------------------------------------------------------------------
Make sure the account that the agent is run under is in the "Agent Pool Service Account" role.
Make sure the queue is provisioned in the collection ( https://your-tfs-server:8080/tfs/your-collection/_admin/_AgentQueue ). If not - select "New queue.." and select the existing queue.
Make sure you deploy the Windows build agent by exactly following this article.
Try to change a domain account which is a member of the Build Agent Service Accounts group and belongs to "Agent Pool Service Account" role, to see whether the agent would work or not.
Check the Firewall inbound rule, check vNext build on TFS 2015 hangs on MSBuild step and produces no log files

Resources