When I run my pipeline from my agent v3.x.x in a self-hosted windows machine, I get the following error when trying to download task AzureKeyVault@2. However, it allows downloading tasks as Powershell@2 and AzurePowershell@2, without errors. When I launch the same pipeline from a Linux Self-Hosted agent, there are no errors. The same error occurs when I try to download Bash@3 task.Some ideas of why this log is happening? -> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
This is my pipeline
trigger:
- master
pool:
name: OnPrem-pool
demands:
- agent.name -equals xxxxxxxx
steps:
- task: AzureKeyVault@2
continueOnError: true
inputs:
azureSubscription: xxxxxxxxxx
KeyVaultName: xxxxxxxxxxxxxxxx
SecretsFilter: '*'
- task: AzurePowershell@2
displayName: "Check task download"
inputs:
failOnStderr: true
targetType: 'inline'
script: echo "Hello World"
This is my error. Don't be confuse for the existance of folder vsts-agent-win-x64-2.202.0, that's the agent with version 3, but the automatic update didn't rename the folder with the current version number.
Agent name: 'xxxxxxxxxxx'
Agent machine name: 'xxxxxxxxxx'
Current agent version: '3.224.1'
Agent running as: 'xxxxx'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: AzureKeyVault (2.223.0)
##[warning]Failed to download task 'AzureKeyVault'. Error Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
##[warning]Inner Exception: An existing connection was forcibly closed by the remote host.
##[warning]Back off 15.447 seconds before retry.
##[warning]Failed to download task 'AzureKeyVault'. Error Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
##[warning]Inner Exception: An existing connection was forcibly closed by the remote host.
##[warning]Back off 14.956 seconds before retry.
##[warning]Failed to download task 'AzureKeyVault'. Error Unable to read data from the transport connection: A##[debug]Triggering repository: data-azuredevops-az-mm. repository type: Git
Prepare build directory.
##[debug]Delete existing build directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21'
##[debug]Deleting build directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21'
##[debug]Creating build directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21'
##[debug]Delete existing artifacts directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21\a'
##[debug]Creating artifacts directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21\a'
##[debug]Delete existing test results directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21\TestResults'
##[debug]Creating test results directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21\TestResults'
##[debug]Creating binaries directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21\b'
##[debug]Creating source directory: 'c:\agents\vsts-agent-win-x64-2.202.0\_work\21\s'
Set build variables.
Download all required tasks.
Downloading task: AzureKeyVault (2.223.0)
##[warning]Failed to download task 'AzureKeyVault'. Error Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
##[warning]Inner Exception: An existing connection was forcibly closed by the remote host.
##[warning]Back off 28.205 seconds before retry.
##[warning]Failed to download task 'AzureKeyVault'. Error Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
##[warning]Inner Exception: An existing connection was forcibly closed by the remote host.
##[warning]Back off 16.32 seconds before retry.
##[warning]Failed to download task 'AzureKeyVault'. Error Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
##[warning]Inner Exception: An existing connection was forcibly closed by the remote host.
##[error]Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
##[debug]System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory`1 buffer)
at System.Net.Http.HttpConnection.FillAsync(Boolean async)
at System.Net.Http.HttpConnection.CopyToContentLengthAsync(Stream destination, Boolean async, UInt64 length, Int32 bufferSize, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, TaskStepDefinitionReference task) in D:\a\1\s\src\Agent.Worker\TaskManager.cs:line 216
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, IEnumerable`1 steps) in D:\a\1\s\src\Agent.Worker\TaskManager.cs:line 76
at Microsoft.VisualStudio.Services.Agent.Worker.JobExtension.InitializeJob(IExecutionContext jobContext, AgentJobRequestMessage message) in D:\a\1\s\src\Agent.Worker\JobExtension.cs:line 168
Finishing: Initialize job
I tried to download other tasks, and that try was successfull for powershell and azurePowershell tasks. I don't know the server/URL the pipeline calls in order to download each task, and that is making things a little bit trickier