Error: The underlying connection was closed: An unexpected error occurred on a send

Hello Everyone. Im starting off a Octopus POC and trying to install a tenticle onto my demo Windows 2016 server. However, when I try to use a polling tentacle I get this error. Was wondering if anyone can guide me in the right direction:

Checking connectivity on the server communications port 10943…
Error: ===============================================================================
Error: The underlying connection was closed: An unexpected error occurred on a send.
Error: System.Net.WebException
Error: at System.Net.HttpWebRequest.GetResponse()
Error: at Octopus.Tentacle.Communications.OctopusServerChecker.<>c__DisplayClass2_0.b__1()
Error: at Octopus.Tentacle.Communications.OctopusServerChecker.Retry(Action action, Int32 retryCount, TimeSpan initalDelay, Double backOffFactor)
Error: at Octopus.Tentacle.Communications.OctopusServerChecker.CheckServerCommunicationsIsOpen(Uri serverAddress, IWebProxy proxyOverride)
Error: at Octopus.Tentacle.Commands.RegisterMachineCommandBase1.StartAsync Error: at Octopus.Tentacle.Commands.RegisterMachineCommandBase1.Start()
Error: at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
Error: at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown)
Error: at Octopus.Shared.Startup.OctopusProgram.RunHost(ICommandHost host)
Error: at Octopus.Shared.Startup.OctopusProgram.Run()
Error:
Error: --Inner Exception–
Error: The handshake failed due to an unexpected packet format.
Error: System.IO.IOException
Error: at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
Error: at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
Error: at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
Error: at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
Error: at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
Error: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
Error: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
Error: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
Error: at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
Error: at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
Error: at System.Net.ConnectStream.WriteHeaders(Boolean async)
Error: -------------------------------------------------------------------------------

Hi there paksan,

Thanks for getting in touch.

With regard to tentacles failing to connect, we have a standard set of troubleshooting advice at the following URL:

This error seems to be TLS-related, and we’ve seen a few recently. We have a small team investigating at the moment, since it seems like something that may have been impacted by an update or a recent change in one of our dependencies.

If you could run through the troubleshooting doc and get back to us with a bit more info, that’d be fantastic

  • Tentacle version
  • Server version
  • Are you using Octopus Cloud or on-premise?
  • Windows version (2016?)
  • Have you applied recent windows updates?
  • are you able to attach a full tentacle log?
  • and other information you feel may be relevant

Thanks,

Jason

Hello,

Sure, Id love to help. So here is the info about my setup per your questions:

·
Tentacle version: tentacle.5.0.0-x64

·
Server version: windows 2016 Standard

·
Are you using Octopus Cloud or on-premise?: Octopus Cloud

·
Windows version (2016?)

·

·
Have you applied recent windows updates? Yes, this is a new server so we patched it to whatever the latest available patches are:

·

·
are you able to attach a full tentacle log?

I am able to initially log into our cloud instance and verify my credentials with no issues. So I know that outbound internet is going out

cid:image007.png@01D546A8.61DD97E0

I am also able to pull environment details into the configuration as well

Error Im getting is still there as you can see below and in attached log

Proxy use is disabled

Checking connectivity on the server communications port 10943…

Error: ===============================================================================

Error: The underlying connection was closed: An unexpected error occurred on a send.

Error: System.Net.WebException

Error: at System.Net.HttpWebRequest.GetResponse()

Error: at Octopus.Tentacle.Communications.OctopusServerChecker.<>c__DisplayClass2_0.b__1()

Error: at Octopus.Tentacle.Communications.OctopusServerChecker.Retry(Action action, Int32 retryCount, TimeSpan initalDelay, Double backOffFactor)

Error: at Octopus.Tentacle.Communications.OctopusServerChecker.CheckServerCommunicationsIsOpen(Uri serverAddress, IWebProxy proxyOverride)

Error: at Octopus.Tentacle.Commands.RegisterMachineCommandBase`1.StartAsync

Error: at Octopus.Tentacle.Commands.RegisterMachineCommandBase`1.Start()

Error: at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)

Error: at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown)

Error: at Octopus.Shared.Startup.OctopusProgram.RunHost(ICommandHost host)

Error: at Octopus.Shared.Startup.OctopusProgram.Run()

Error:

Error: --Inner Exception–

Error: The handshake failed due to an unexpected packet format.

Error: System.IO.IOException

Error: at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)

Error: at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)

Error: at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)

Error: at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)

Error: at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)

Error: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

Error: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

Error: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

Error: at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)

Error: at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)

Error: at System.Net.ConnectStream.WriteHeaders(Boolean async)

Error: -------------------------------------------------------------------------------

Error: Terminating process with exit code 100

Error: Full error details are available in the log files at:

Error: C:\Octopus\Logs

Error: C:\Users\paadmin\AppData\Local\Octopus\Logs

Error: If you need help, please send these log files to https://octopus.com/support

Error: -------------------------------------------------------------------------------

Error:

Error: The previous command returned a non-zero exit code of: 100

Error: The command that failed was: “C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe” register-with --instance “Tentacle” --server “https://transceptadeploy.octopus.app” --name
“HQ-OCTOPOC” --comms-style “TentacleActive” --server-comms-port “10943” --username "paksan@transcepta.com" --password “Snipers3269” --space “Default” --environment “NoEnvironmnet” --role “norole” --policy “Default Machine Policy”

Deleted instance: Tentacle

·
and other information you feel may be relevant

Verified that TLS 1.0-1.2 are enabled and also used IICRYpto to enable ALL settings to cover all the bases.

I placed the server in a OU with no group policies applied to it and I still get the error. However, our servers in Azure and our laptops running windows 10 don’t seem to have this issue as I installed the tentacles onto them without issues.
We don’t patch our Azure very often.

These updates were applied to the server:

I uninstalled the Security Update KB4462917 and rebooted but no dice

OctopusTentacle.txt (10.9 KB)

closed as duplicate in email support channel