Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect-ServiceFabricCluster doesn't work after "Reset local cluster"

After running "Reset local cluster" using the task tray icon for a local Service Fabric cluster the Connect-ServiceFabricCluster powershell command is no longer able to connect to the cluster in a powershell window where that command previously succeeded.

Before reset

Connect works fine:

PS C:\Users\Administrator> Connect-ServiceFabricCluster
True
WARNING: Cluster connection with the same name already existed, the old connection will be deleted


ConnectionEndpoint   :
FabricClientSettings : {
                       ClientFriendlyName                   : PowerShell-46eba43f-9981-4a04-93ce-dcc8bc707059
                       PartitionLocationCacheLimit          : 100000
                       PartitionLocationCacheBucketCount    : 1024
                       ServiceChangePollInterval            : 00:02:00
                       ConnectionInitializationTimeout      : 00:00:02
                       KeepAliveInterval                    : 00:00:20
                       ConnectionIdleTimeout                : 00:00:00
                       HealthOperationTimeout               : 00:02:00
                       HealthReportSendInterval             : 00:00:00
                       HealthReportRetrySendInterval        : 00:00:30
                       NotificationGatewayConnectionTimeout : 00:00:30
                       NotificationCacheUpdateTimeout       : 00:00:30
                       AuthTokenBufferSize                  : 4096
                       }
GatewayInformation   : {
                       NodeAddress                          : localhost:19000
                       NodeId                               : bf865279ba277deb864a976fbf4c200e
                       NodeInstanceId                       : 131314568099152528
                       NodeName                             : _Node_0
                       }

Reset

"Reset local cluster" manually with tray icon right-click, then:

After reset

Connect fails if run again in same powershell window:

PS C:\Users\Administrator> Connect-ServiceFabricCluster
WARNING: Failed to contact Naming Service. Attempting to contact Failover Manager Service...
WARNING: Failed to contact Failover Manager Service, Attempting to contact FMM...
False
Connect-ServiceFabricCluster : The object is closed.
At line:1 char:1
+ Connect-ServiceFabricCluster
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricObjectClosedException
    + FullyQualifiedErrorId : TestClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster

New window

Start a new powershell window and Connect-ServiceFabricCluster works there, but the original powershell window never recovers.


I can't work out where it's hiding the state it's using to remember the broken connection.

I tried deleting the $ClusterConnection variable to no effect.

Remove-Variable ClusterConnection

I had a look at C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ServiceFabric\ but it's a compiled .net module so not the easiest to follow.


related: https://stackoverflow.com/a/38104087/10245

like image 571
Tim Abell Avatar asked Feb 05 '23 02:02

Tim Abell


1 Answers

That's a known issue.

Cluster connection fails with "Object is closed" Solution Close the current PowerShell window and open a new PowerShell window as an administrator. You should now be able to successfully connect

like image 199
LoekD Avatar answered Mar 11 '23 16:03

LoekD