I have installed multiple instances of TeamCity (latest build 2018.2.2 (build 61245)) on different Debian 9 instances, and used the OctoDeploy plugin on it to push NuGet packages to my cloud instance of Octopus Deploy.
Roughly every other build I try to push to Octopus I get the following error in the log of the build project:
[16:36:56][Octopus Deploy] Running command: dotnet Octo.dll push --server https://xxxxxxx.octopus.app --apikey SECRET --package /opt/teamcity-agent-2/work/xxxxxxxxx/xxxxxxxxxxxxx.nupkg
[16:36:56][Octopus Deploy] Pushing packages to Octopus server
[16:36:57][Octopus Deploy] Octopus Deploy Command Line Tool, version 4.42.0
[16:36:57][Octopus Deploy]
[16:37:57][Octopus Deploy]
[16:37:57][Octopus Deploy] System.Exception: Unable to connect to the Octopus Deploy server. See the inner exception for details. ---> System.Net.Http.HttpRequestException: Resource temporarily unavailable ---> System.Net.Sockets.SocketException: Resource temporarily unavailable
[16:37:57][Octopus Deploy] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
[16:37:57][Octopus Deploy] --- End of inner exception stack trace ---
[16:37:57][Octopus Deploy] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
[16:37:57][Octopus Deploy] at System.Threading.Tasks.ValueTask`1.get_Result()
[16:37:57][Octopus Deploy] at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
[16:37:57][Octopus Deploy] at System.Threading.Tasks.ValueTask`1.get_Result()
[16:37:57][Octopus Deploy] at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
[16:37:57][Octopus Deploy] at System.Threading.Tasks.ValueTask`1.get_Result()
[16:37:57][Octopus Deploy] at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
[16:37:57][Octopus Deploy] at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
[16:37:57][Octopus Deploy] at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
[16:37:57][Octopus Deploy] at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
[16:37:57][Octopus Deploy] at Octopus.Client.OctopusAsyncClient.DispatchRequest[TResponseResource](OctopusRequest request, Boolean readResponse) in Z:\buildAgent\workDir\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 553
[16:37:57][Octopus Deploy] at Octopus.Client.OctopusAsyncClient.Get[TResource](String path, Object pathParameters)
[16:37:57][Octopus Deploy] at Octopus.Client.OctopusAsyncClient.EstablishSession() in Z:\buildAgent\workDir\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 481
[16:37:57][Octopus Deploy] --- End of inner exception stack trace ---
[16:37:57][Octopus Deploy] at Octopus.Client.OctopusAsyncClient.EstablishSession() in Z:\buildAgent\workDir\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 494
[16:37:57][Octopus Deploy] at Octopus.Client.OctopusAsyncClient.Create(OctopusServerEndpoint serverEndpoint, OctopusClientOptions options, Boolean addHandler) in Z:\buildAgent\workDir\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 134
[16:37:57][Octopus Deploy] at Octopus.Client.OctopusAsyncClient.Create(OctopusServerEndpoint serverEndpoint, OctopusClientOptions options) in Z:\buildAgent\workDir\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 116
[16:37:57][Octopus Deploy] at Octopus.Cli.Commands.ApiCommand.Execute(String[] commandLineArguments) in Z:\buildAgent\workDir\d8818cc5a2905d1\source\Octopus.Cli\Commands\ApiCommand.cs:line 140
[16:37:57][Octopus Deploy] at Octopus.Cli.CliProgram.Run(String[] args) in Z:\buildAgent\workDir\d8818cc5a2905d1\source\Octopus.Cli\CliProgram.cs:line 52
[16:37:57][Octopus Deploy] Exit code: -3
[16:37:57][Octopus Deploy] Octo.exe exit code: 253
if I re-run the build straight after, most of the time the build finishes successfully and the NuGet packages gets pushed through.
I don’t understand what the issue here is?
Regards,
Alvaro