Hello
we are experiencing problems with deploying to a ssh deployment target in aws, a aws linux2 instance.
The problem is not persistant, happens between two steps, and seccond time we deploy it succeeds if you wait a minute.
step 1 aquire package ( which succeeds )
step 2 fails with error:
Could not connect to SSH endpoint: An existing connection was forcibly closed by the remote host:
14:50:42 Verbose | Could not connect to SSH endpoint: An existing connection was forcibly closed by the remote host.
| Octopus.Server.Orchestration.Targets.Ssh.SshEndpointConnectionException
| at Octopus.Server.Orchestration.Targets.Ssh.Connectivity.SshClientFactory.EstablishConnection[TClient](Func2 clientConstructor, ITaskLog taskLog) in SshClientFactory.cs:line 117 | at Octopus.Server.Orchestration.Targets.Ssh.Connectivity.SshClientFactory.EstablishSshConnection(ITaskLog taskLog) in SshClientFactory.cs:line 63 | at Octopus.Server.Orchestration.Targets.Ssh.Connectivity.ConnectionScope.GetSshClient() in ConnectionScope.cs:line 67 | at Octopus.Server.Orchestration.Targets.Ssh.SshRemoteEndpointFacade.EnsureDirectoryExists(String path, StringBuilder error) in SshRemoteEndpointFacade.cs:line 142 | at Octopus.Server.Orchestration.Targets.Ssh.SshRemoteEndpointFacade.UploadFile(String remotePath, DataStream upload, ITaskLog taskLog) in SshRemoteEndpointFacade.cs:line 75 | at Octopus.Server.Orchestration.Targets.Ssh.SshRemoteEndpointFacade.UploadFile(ScriptFile scriptFile, ITaskLog taskLog) in SshRemoteEndpointFacade.cs:line 89 | at System.Collections.Generic.List
1.ForEach(Action1 action) | at Octopus.Server.Orchestration.Targets.Ssh.SshRemoteEndpointFacade.UploadExecuteDownload(StartScriptCommand command, ITaskLog taskLog) in SshRemoteEndpointFacade.cs:line 128 | at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionExecution.Immediate.ExecutionTargets.SshBashExecutionTarget.Execute(ScriptCollection bootstrapperScripts, IReadOnlyList
1 boostrapperArguments, IReadOnlyList1 files, Nullable
1 forceIsolationLevel, Boolean raw, ITaskLog taskLog, Nullable1 isolationMutexTimeout) in SshBashExecutionTarget.cs:line 81 | at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionExecution.Immediate.ImmediateExecutor.RunOnTarget(ScriptCollection finalBootstrapperScripts, String platform, IBootstrapperScriptGenerator bootstrapperScriptGenerator, IReadOnlyList
1 bootstrapperArguments, IReadOnlyList1 allFiles, Nullable
1 isolation, Nullable1 isolationMutexTimeout, CalamariFlavour flavour, IReadOnlyList
1 deploymentTools, ExecutionTargetDetails executionTargetDetails, CalamariPlatformConstraint calamariPlatformConstraint, ITaskLog taskLog) in ImmediateExecutor.cs:line 229
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionExecution.Immediate.ImmediateExecutor.ExecuteCalamari(CalamariFlavour calamariFlavour, String calamariCommand, IReadOnlyList1 calamariArguments, IReadOnlyList
1 files, IReadOnlyList1 deploymentTools, VariableCollection extraVariables, TargetManifest targetManifest, CalamariPlatformConstraint calamariPlatformConstraint, Nullable
1 isolationMutexTimeout, ITaskLog taskLog) in ImmediateExecutor.cs:line 178
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionExecution.CommandBuilders.CalamariCommandBuilder.Execute(ITaskLog taskLog) in CalamariCommandBuilder.cs:line 147
| at Octopus.Server.Orchestration.ServerTasks.Deploy.Steps.Script.ScriptActionHandler.ExecuteWithDefaultScriptHandler(IActionHandlerContext context, ITaskLog taskLog) in ScriptActionHandler.cs:line 61
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.NewActionDispatcher.<>c__DisplayClass15_0.<Execute in NewActionDispatcher.cs:line 205
| at Octopus.Server.Infrastructure.EitherAsyncOrSync.Execute(CancellationToken cancellationToken) in EitherAsyncOrSync.cs:line 38
| at Octopus.Server.Orchestration.ServerTasks.Deploy.Guidance.ExecuteWithoutGuidance(EitherAsyncOrSync callback, String actionName, Boolean actionIsRequiredToRun, ITaskLog taskLog, CancellationToken cancellationToken) in Guidance.cs:line 116
| at Octopus.Server.Orchestration.ServerTasks.Deploy.Guidance.Execute(EitherAsyncOrSync callback, String actionName, Boolean actionIsRequiredToRun, ITaskLog taskLog, Maybe1 callbackOnExclude, CancellationToken cancellationToken) in Guidance.cs:line 67 | at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.NewActionDispatcher.Execute(ActionCommand command, Maybe
1 inContextOf, IExecutor executor, TargetManifest targetManifest, Maybe1 stagedPackagePath, IActionAndTargetScopedVariables variables, ITaskLog taskLog, Maybe
1 guidanceExcludeCallback, CancellationToken cancellationToken) in NewActionDispatcher.cs:line 211
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.NewActionDispatcher.ExecuteOnDeploymentTarget(ActionCommand command, DeploymentTarget deploymentTarget, Maybe1 guidanceExcludeCallback, ITaskLog taskLogForTarget, ITaskLog taskLogRoot, CancellationToken cancellationToken) in NewActionDispatcher.cs:line 121 | at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.NewActionDispatcher.Dispatch(ActionCommand command, DeploymentTarget deploymentTarget, ITaskLog taskLogForTarget, ITaskLog taskLogRoot, Maybe
1 guidanceExcludeCallback, CancellationToken cancellationToken) in NewActionDispatcher.cs:line 92
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ExecutionTaskController1.<>c__DisplayClass38_2.<ExecuteActionAndInitLoggingContext in ExecutionTaskController.cs:line 601 | at Octopus.Server.Infrastructure.EitherAsyncOrSync.Execute(CancellationToken cancellationToken) in EitherAsyncOrSync.cs:line 38 | at Octopus.Server.Orchestration.ServerTasks.Deploy.Guidance.ExecuteWithoutGuidance(EitherAsyncOrSync callback, String actionName, Boolean actionIsRequiredToRun, ITaskLog taskLog, CancellationToken cancellationToken) in Guidance.cs:line 116 | at Octopus.Server.Orchestration.ServerTasks.Deploy.Guidance.Execute(EitherAsyncOrSync callback, String actionName, Boolean actionIsRequiredToRun, ITaskLog taskLog, Maybe
1 callbackOnExclude, CancellationToken cancellationToken) in Guidance.cs:line 67
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ExecutionTaskController1.<>c__DisplayClass38_1.<ExecuteActionAndInitLoggingContext in ExecutionTaskController.cs:line 607 | at Octopus.Server.Infrastructure.Orchestration.UnitsOfWork.UnitOfWorkExecutor.<>c__DisplayClass4_0
2.<Execute in UnitOfWorkExecutor.cs:line 74
| at Octopus.Core.Infrastructure.UnitsOfWork.UnitOfWorkExtensionMethods.DoAsync(IUnitOfWork unitOfWork, Func1 action, CancellationToken cancellationToken, String name) in UnitOfWorkExtensionMethods.cs:line 73 | at Octopus.Core.Infrastructure.UnitsOfWork.UnitOfWorkExtensionMethods.DoAsync(IUnitOfWork unitOfWork, Func
1 action, CancellationToken cancellationToken, String name) in UnitOfWorkExtensionMethods.cs:line 73
| at Octopus.Server.Infrastructure.Orchestration.UnitsOfWork.UnitOfWorkExecutor.Execute[T1,T2](Func4 action, CancellationToken cancellationToken, String name) in UnitOfWorkExecutor.cs:line 75 | at Octopus.Server.Orchestration.ServerTasks.Deploy.ExecutionTaskController
1.<>c__DisplayClass38_0.<ExecuteActionAndInitLoggingContext in ExecutionTaskController.cs:line 608
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ExecutionTaskController1.ExecuteWithTransientErrorDetection(Func
2 action, ITaskLog taskLog, CancellationToken cancellationToken, DeploymentTarget deploymentTarget) in ExecutionTaskController.cs:line 753
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ExecutionTaskController1.ExecuteActionAndInitLoggingContext(PlannedStep step, DeploymentTarget targetContext, PlannedAction action, ITaskLog taskLogForTarget, ITaskLog taskLogRoot, CancellationToken cancellationToken) in ExecutionTaskController.cs:line 626 | --Inner Exception-- | An existing connection was forcibly closed by the remote host. | System.Net.Sockets.SocketException | at Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan readTimeout) | at Renci.SshNet.Connection.ProtocolVersionExchange.SocketReadLine(Socket socket, TimeSpan timeout, List
1 buffer)
| at Renci.SshNet.Connection.ProtocolVersionExchange.Start(String clientVersion, Socket socket, TimeSpan timeout)
| at Renci.SshNet.Session.Connect()
| at Renci.SshNet.BaseClient.CreateAndConnectSession()
| at Renci.SshNet.BaseClient.Connect()
| at Octopus.Server.Orchestration.Targets.Ssh.Connectivity.SshClientFactory.EstablishConnection[TClient](Func`2 clientConstructor, ITaskLog taskLog) in SshClientFactory.cs:line 117
hope that you can help us.
regards
Morten - JP/Politikens hus