microsoft/SdnDiagnostics

Move-SdnServiceFabricReplica fails if only using a single NC node

arudell opened this issue · 0 comments

Describe the bug
Attempting to run Move-SdnServiceFabricReplica fails when only running a single NC.

Move-SdnServiceFabricReplica -NetworkController $nc -ServiceName 'fabric:/NetworkController/GatewayManager'
No nodes satisfied all the constraints
    + CategoryInfo          : InvalidOperation: (Microsoft.Servi...usterConnection:ClusterConnection) [Move-ServiceFab
   ricPrimaryReplica], FabricException
    + FullyQualifiedErrorId : MoveReplicaErrorId,Microsoft.ServiceFabric.Powershell.MovePrimaryReplica
    + PSComputerName        : <COMPUTERNAME>

Trace-Output : [COMPUTERNAME] System.NullReferenceException: Unable to return results from service fabric
at Invoke-SdnServiceFabricCommand, C:\Program Files\WindowsPowerShell\Modules\SdnDiagnostics\2.2208.397.134009\modules\
NetworkController\public\Invoke-SdnServiceFabricCommand.ps1: line 83
at Move-SdnServiceFabricReplica, C:\Program Files\WindowsPowerShell\Modules\SdnDiagnostics\2.2208.397.134009\modules\Ne
tworkController\public\Move-SdnServiceFabricReplica.ps1: line 78
at <ScriptBlock>, <No file>: line 1
At C:\Program Files\WindowsPowerShell\Modules\SdnDiagnostics\2.2208.397.134009\modules\NetworkController\public\Invoke-
SdnServiceFabricCommand.ps1:94 char:59
+ ... {1}" -f $_.Exception, $_.ScriptStackTrace | Trace-Output -Level:Error
+                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Trace-Output

Expected behavior
This is expected from SF cluster perspective, since no node to move the service to. We should gracefully handle this exception.

Environment Details (please complete the following information):

  • Windows Server OS:
  • SdnDiagnostics Version: