We are seeing intermittent failures in the last couple of weeks while deploying releases using octo.exe from our build server (Jenkins). The build server and octopus server are both in Azure and on the same subnet, so I do not suspect it is actually network related (No traffic is crossing our firewall). When the error occurs, Jenkins fails, however Octopus continues the deploy and actually ends up with a successful deploy… which in theory is good, but none of our CI tests end up running.
The error in the Jenkins console is:
System.Net.Http.HttpRequestException: Error while copying content to a stream.
---> 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.Security.SslStream.<FillBufferAsync>g__InternalFillBufferAsync|215_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial)
at System.Net.Security.SslStream.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer)
at System.Net.Http.HttpConnection.FillAsync()
at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.CopyToAsyncCore(Stream destination, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionResponseContent.SerializeToStreamAsync(Stream stream, TransportContext context, CancellationToken cancellationToken)
at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
--- End of inner exception stack trace ---
at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Octopus.Client.OctopusAsyncClient.DispatchRequest[TResponseResource](OctopusRequest request, Boolean readResponse)
at Octopus.Client.OctopusAsyncClient.Get[TResource](String path, Object pathParameters)
at Octopus.Client.Repositories.Async.TaskRepository.GetDetails(TaskResource resource, Nullable`1 includeVerboseOutput, Nullable`1 tail)
at Octopus.Cli.Commands.Deployment.TaskOutputProgressPrinter.Render(IOctopusAsyncRepository repository, ICommandOutputProvider commandOutputProvider, TaskResource resource)
at Octopus.Client.Repositories.Async.TaskRepository.WaitForCompletion(TaskResource[] tasks, Int32 pollIntervalSeconds, Nullable`1 timeoutAfter, Func`2 interval)
at Octopus.Cli.Commands.Deployment.DeploymentCommandBase.WaitForDeploymentToComplete(IReadOnlyList`1 deployments, ProjectResource project, ReleaseResource release)
at Octopus.Cli.Commands.Deployment.DeploymentCommandBase.DeployRelease(ProjectResource project, ReleaseResource release)
at Octopus.Cli.Commands.Deployment.DeployReleaseCommand.Request()
at Octopus.Cli.Commands.ApiCommand.Execute()
at Octopus.Cli.Commands.ApiCommand.Execute(String[] commandLineArguments)
at Octopus.Cli.CliProgram.Run(String[] args)
Exit code: -3
Exec: Error executing command F:\octo\Octo.exe deploy-release --project=XXXX_DB --Deployto=QA --Tenant=$env:Tenant
--version=$BuildVer --server=$OctoURL --apiKey=$OctoAPIKey --progress --deploymenttimeout=05:00:00 --timeout=1200.
We are running:
Octopus 2020.02.13
Octo.exe 7.3.7 (this was also happening on 6.15.1 so I tried upgrading as a fix)