Tentacles cannot be reached (health check fails) after migration

Hi Alexander,

This resets Octopus’s view of the connectivity status rather than Tentacle’s, so it can’t be done via Tentacle.exe config. Instead it would need to be done via the REST API.

You do it by fetching the machine resource, setting the Squid property to null, then PUTting the resource back. This can be done via the REST API directly or via Octopus.Client:

Paul

Paul

That’s what I figured, but just wanted to make sure. Thanks folks!

Hi,

Im trying to reset the connection to a machine using the api however im getting the following error:

{
“ErrorMessage”: “Value cannot be null.\r\nParameter name: instance”,
“FullException”: “System.ArgumentNullException: Value cannot be null.\r\nParameter name: instance\r\n at System.ComponentModel.DataAnnotations.ValidationContext…ctor(Object instance, IServiceProvider serviceProvider, IDictionary2 items)\r\n at Nancy.Validation.DataAnnotations.DataAnnotationsValidatorAdapter.<Validate>d__4.MoveNext()\r\n at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection)\r\n at Nancy.Validation.DataAnnotations.PropertyValidator.Validate(Object instance)\r\n at Nancy.Validation.DataAnnotations.DataAnnotationsValidator.Validate(Object instance, NancyContext context)\r\n at Octopus.Platform.Web.Api.Responder1.BindAndValidateTModel in y:\work\refs\heads\master\source\Octopus.Platform.Web\Api\Responder.cs:line 84\r\n at Octopus.Platform.Web.Api.ModifyResponseDescriptor2.Responder.Execute() in y:\\work\\refs\\heads\\master\\source\\Octopus.Platform.Web\\Api\\ModifyResponseDescriptor.cs:line 39\r\n at Octopus.Platform.Web.Api.Responder1.Respond(TDescriptor options, NancyContext context) in y:\work\refs\heads\master\source\Octopus.Platform.Web\Api\Responder.cs:line 163\r\n at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)\r\n at CallSite.Target(Closure , CallSite , Object , Object , NancyContext )\r\n at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass5.<.ctor>b__2(Object o) in y:\work\refs\heads\master\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 47\r\n at CallSite.Target(Closure , CallSite , Func`2 , Object )\r\n at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)”
}

Powershell:
$baseUri = “https://octopus
$command = $($baseUri + “/api/machines/machines-2721”)

$machine = Invoke-RestMethod -Method Get -Uri $command -Header @{“X-Octopus-ApiKey”=“API-***********************”}
$machine.Squid=$null

$new = Invoke-RestMethod -Method Put -Uri $command -Body $machine -Header @{“X-Octopus-ApiKey”=“API-***********************”}

Octopus Version: Octopus Deploy 2.5.8.447

Hi Avi

I think the problem is you’re not casting the $machine back to JSON before invoking the API.

Try this
$body = $machine | ConvertTo-Json
$new = Invoke-RestMethod -Method Put -Uri $command -Body $body -Header @{“X-Octopus-ApiKey”=“API-***********************”}

Let me know if that works for you.

Regards

Damian

Cool thanks that works.

I’m jumping on this thread for confirmation of phenomenon related to the initial error that this post describes. I too received the same communication errors after upgrading from 1.6 to v2.0 using a remote script. I referred to this post, and resetting the connection via the “Reset” button in the GUI fixed it. The problem was, I had upgraded 150+ machines, and had to reset all via the GUI. I got halfway through this and stopped. It was late, and I planned on finishing the resets the next day. Upon bringing up the GUI the following morning (~20 hrs later), I found that the rest of the machines were no longer reporting communication errors, and were now online. ?? Is there some sort of auto-reset that happens after a machine has been offline for xx hours or xx number of retries? I’m trying to explain this without thinking it was “magic” :slight_smile: As far as I know, no one else was on the server, or had restarted it, etc. Thoughts anyone??

Hi Karl,

Octopus goes through and resets the connection for your machines. But it takes awhile, and as you had 150 machines it would have taken a few hours to go through and update.
As you left it overnight the remaining machines reset themselves. It actually causes some issues if you have machines that are offline, as it tries to continually reset the connections. But in this case its working as it should!

Sorry to spoil the magic :wink:
Vanessa