Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-SFClusterUpgradeProgress : Failed to deserialize json response from server #79

Open
K-Cully opened this issue Oct 17, 2019 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@K-Cully
Copy link
Member

K-Cully commented Oct 17, 2019

Describe the bug
When calling Get-SFClusterUpgradeProgress against a Cluster in the "Ready" state, the error below is thrown.
Service Fabric version: 6.5.664.9590

Get-SFClusterUpgradeProgress : Failed to deserialize json response from server.
At line:1 char:1
+ Get-SFClusterUpgradeProgress
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-SFClusterUpgradeProgress], ServiceFabricException
+ FullyQualifiedErrorId : GetClusterUpgradeProgressErrorId,Microsoft.ServiceFabric.Powershell.Http.GetClusterUpgradeProgressCmdlet

To Reproduce
Connect to a secure cluster.
Run Get-SFClusterUpgradeProgress

Expected behavior
A result is returned to the caller.

@amanbha amanbha added the bug Something isn't working label Dec 14, 2019
@amanbha amanbha self-assigned this Dec 14, 2019
@hbuckle
Copy link

hbuckle commented Dec 28, 2019

I believe this is a problem with the API - the json response from GetUpgradeProgress is below and the ApplicationHealthPolicyMap property is wrong, according to the docs it should be an array not an object

{
  "CodeVersion": "6.5.676.9590",
  "ConfigVersion": "2",
  "UpgradeDomains": [
    {
      "Name": "0",
      "State": "Completed"
    },
    {
      "Name": "1",
      "State": "Completed"
    },
    {
      "Name": "2",
      "State": "Completed"
    },
    {
      "Name": "3",
      "State": "Completed"
    },
    {
      "Name": "4",
      "State": "Completed"
    }
  ],
  "UpgradeState": "RollingForwardCompleted",
  "NextUpgradeDomain": "",
  "RollingUpgradeMode": "Monitored",
  "UpgradeDescription": {
    "CodeVersion": "6.5.676.9590",
    "ConfigVersion": "2",
    "UpgradeKind": "Rolling",
    "RollingUpgradeMode": "Monitored",
    "UpgradeReplicaSetCheckTimeoutInSeconds": 4294967295,
    "ForceRestart": false,
    "MonitoringPolicy": {
      "FailureAction": "Rollback",
      "HealthCheckWaitDurationInMilliseconds": "PT0H0M30S",
      "HealthCheckStableDurationInMilliseconds": "PT0H1M0S",
      "HealthCheckRetryTimeoutInMilliseconds": "PT0H45M0S",
      "UpgradeTimeoutInMilliseconds": "PT12H0M0S",
      "UpgradeDomainTimeoutInMilliseconds": "PT2H0M0S"
    },
    "ClusterHealthPolicy": {
      "ConsiderWarningAsError": false,
      "MaxPercentUnhealthyNodes": 100,
      "MaxPercentUnhealthyApplications": 0
    },
    "EnableDeltaHealthEvaluation": true,
    "ClusterUpgradeHealthPolicy": {
      "MaxPercentDeltaUnhealthyNodes": 0,
      "MaxPercentUpgradeDomainDeltaUnhealthyNodes": 0
    },
    "ApplicationHealthPolicyMap": {
      "ApplicationHealthPolicyMap": [
        {
          "Key": "fabric:\/System",
          "Value": {
            "ConsiderWarningAsError": false,
            "MaxPercentUnhealthyDeployedApplications": 0,
            "DefaultServiceTypeHealthPolicy": {
              "MaxPercentUnhealthyServices": 0,
              "MaxPercentUnhealthyPartitionsPerService": 0,
              "MaxPercentUnhealthyReplicasPerPartition": 0
            },
            "ServiceTypeHealthPolicyMap": [
              {
                "Key": "ClusterManagerServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "DnsServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "EventStoreServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "FMServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "FaultAnalysisServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "FileStoreServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "NamingStoreService",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "RepairManagerServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "UpgradeServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              }
            ]
          }
        }
      ]
    },
    "SortOrder": "Default"
  },
  "UpgradeDurationInMilliseconds": "PT0H18M1.98432S",
  "UpgradeDomainDurationInMilliseconds": "PT0H0M0.0636127S",
  "UnhealthyEvaluations": [],
  "CurrentUpgradeDomainProgress": {
    "DomainName": "",
    "NodeUpgradeProgressList": []
  },
  "StartTimestampUtc": "2019-12-27T14:15:33.886Z",
  "FailureTimestampUtc": "0001-01-01T00:00:00.000Z",
  "FailureReason": "None",
  "UpgradeDomainProgressAtFailure": {
    "DomainName": "",
    "NodeUpgradeProgressList": []
  }
}

Full exception

Exception Info: Microsoft.ServiceFabric.Common.Exceptions.ServiceFabricException: Failed to deserialize json response from server.
  ---> Newtonsoft.Json.JsonReaderException: Unexpected JsonToken StartObject.
    at Microsoft.ServiceFabric.Client.Http.JsonReaderExtensions.ReadStartArray(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.JsonReaderExtensions.ReadList[T](JsonReader reader, Func`2 deserializerFunc)
    at Microsoft.ServiceFabric.Client.Http.Serialization.ClusterUpgradeDescriptionObjectConverter.GetFromJsonProperties(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.JsonReaderExtensions.Deserialize[T](JsonReader reader, Func`2 getFromJsonPropertiesFunc)
    at Microsoft.ServiceFabric.Client.Http.Serialization.ClusterUpgradeDescriptionObjectConverter.Deserialize(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.Serialization.ClusterUpgradeProgressObjectConverter.GetFromJsonProperties(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.JsonReaderExtensions.Deserialize[T](JsonReader reader, Func`2 getFromJsonPropertiesFunc)
    at Microsoft.ServiceFabric.Client.Http.Serialization.ClusterUpgradeProgressObjectConverter.Deserialize(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.ServiceFabricHttpClient.SendAsyncGetResponse[T](Func`1 requestFunc, String relativeUri, Func`2 deserializeFunc, String requestId, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at Microsoft.ServiceFabric.Client.Http.ServiceFabricHttpClient.SendAsyncGetResponse[T](Func`1 requestFunc, String relativeUri, Func`2 deserializeFunc, String requestId, CancellationToken cancellationToken)

@hbuckle
Copy link

hbuckle commented Sep 3, 2020

@amanbha - any update on this? The bug I linked has been closed, but it is still not resolved

@amanbha
Copy link
Contributor

amanbha commented Sep 3, 2020

@hbuckle are you still able to repro with latest nuget package of client library and latest SF runtime, I will also followup reg. the swagger update\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants